Bug 168812

Summary: SELECT * INTO statement updates only first 20 rows
Product: db Reporter: Petr Blaha <blaha>
Component: Show DataAssignee: Jiri Rechtacek <jrechtacek>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: nleck
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:
Attachments: patch

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.
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo