This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168812 - SELECT * INTO statement updates only first 20 rows
Summary: SELECT * INTO statement updates only first 20 rows
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
: 169430 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-20 13:31 UTC by Petr Blaha
Modified: 2010-06-14 13:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (883 bytes, text/plain)
2009-07-21 08:22 UTC, Petr Blaha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2009-07-20 13:31:26 UTC
NB 6.7.1 & NB 6.7
Steps:
1) try to invoke statement SELECT * INTO table2 FROM table1
ERROR: only first 21 rows are updated.
Workaround: create table1 and invoke statement INSERT INTO table2 SELECT * FROM table1
Comment 1 Jiri Rechtacek 2009-07-20 14:23:25 UTC
The construct SELECT ... INTO TABLE is a SQL extension of SQL standard. Only some databases supports such Transact-SQL
extentions (eg.PostgreSQL, Sybase, MS SQL). IMHO I don't think it meets the P2 quality level but I'm going to fix it
regardless the priority anyway.
Comment 2 nleck 2009-07-20 21:44:26 UTC
Workaround: create table2 and invoke statement INSERT INTO table2 SELECT * FROM table1

BTW: SELECT INTO is implemented in all databases that I've used including Oracle, Sybase, My SQL, MS SQL, HSQLDB,
Firebird and Derby
Comment 3 Petr Blaha 2009-07-21 08:21:29 UTC
I attached the fix for the issue.
Comment 4 Petr Blaha 2009-07-21 08:22:37 UTC
Created attachment 84972 [details]
patch
Comment 5 Jiri Rechtacek 2009-07-21 10:18:13 UTC
> ------- Additional comments from nleck@netbeans.org Mon Jul 20 20:44:26 +0000 2009 -------
> BTW: SELECT INTO is implemented in all databases that I've used including Oracle, Sybase, My SQL, MS SQL, HSQLDB,
> Firebird and Derby

No, Oracle nor MySQL support such statement. See http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html.
Output from SQL*Plus:
SQL> select * into locations_backup from locations;
select * into locations_backup from locations
              *
ERROR at line 1:
ORA-00905: missing keyword

pblaha: the patch looks good. I'll applay it. Thanks
Comment 6 Jiri Rechtacek 2009-07-21 10:28:38 UTC
core-main/rev/a3110f186887
Comment 7 Quality Engineering 2009-07-23 07:45:29 UTC
Integrated into 'main-golden', will be available in build *200907230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a3110f186887
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #168812: SELECT * INTO  statement updates only first 20 rows (applied blaha's patch)
Comment 8 Jiri Rechtacek 2009-07-29 10:29:12 UTC
*** Issue 169430 has been marked as a duplicate of this issue. ***
Comment 9 Antonin Nebuzelsky 2010-06-14 13:12:11 UTC
Removing RELNOTE keyword.