From kaitlin41@example.org Tue Feb 01 13:48:09 2005 Return-Path: <kaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 39913 invoked from network); 1 Feb 2005 13:48:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 1 Feb 2005 13:48:08 -0000 Received: (qmail 94241 invoked by uid 500); 1 Feb 2005 13:48:07 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 94167 invoked by uid 500); 1 Feb 2005 13:48:06 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk list-help: <mailto:kaitlin41@example.org> list-unsubscribe: <mailto:kaitlin41@example.org> list-post: <mailto:kaitlin41@example.org> List-Id: <derby-dev.db.apache.org> Reply-To: "Derby Development" <kaitlin41@example.org> Delivered-To: mailing list kaitlin41@example.org Received: (qmail 94130 invoked by uid 99); 1 Feb 2005 13:48:06 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from brmea-mail-4.Sun.COM (HELO brmea-mail-4.sun.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 05:48:03 -0800 Received: from phys-biff-1 ([83.161.120.155]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j11Dlxdt003485 for <kaitlin41@example.org>; Tue, 1 Feb 2005 06:48:00 -0700 (MST) Received: from conversion-daemon.biff-mail1.india.sun.com by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <kaitlin41@example.org> (original mail from kaitlin41@example.org) for kaitlin41@example.org; Tue, 01 Feb 2005 19:17:58 +0530 (IST) Received: from [83.161.120.155] (lilly.India.Sun.COM [83.161.120.155]) by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <kaitlin41@example.org> for kaitlin41@example.org; Tue, 01 Feb 2005 19:17:58 +0530 (IST) Date: Tue, 01 Feb 2005 19:16:06 +0530 From: Shreyas Kaushik <kaitlin41@example.org> Subject: Re: [jira] Commented: (DERBY-18) Exposed name matching has bugs when the column name is qualified with a schema name. In-reply-to: <kaitlin41@example.org> To: Derby Development <kaitlin41@example.org> Message-id: <kaitlin41@example.org> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (X11/20041208) References: <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Any updates on this?? thanks Shreyas Shreyas Kaushik wrote: > I am attaching the latest diffs for Derby-18. > > This tries to address Dan's comments in his previous mails. > Let me know the whether the extra checks that I have added, in > comparision to the diffs I sent out earlier > are correct/sufficient. > > thanks > Shreyas > > Shreyas Kaushik wrote: > >> My answers inline. >> >> Shreyas >> >> Daniel John Debrunner wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Shreyas Kaushik wrote: >>> >>> >>> >>>> Dan, >>>> >>>> I did the patch for this. >>>> >>>> From your comments I looked at the getSchemaDescriptor() in >>>> QueryTreeNode. The schema name was getting >>>> stored there but not stored in the TableName in the corresponding >>>> node. >>>> >>>> Since *null* schema implies current schema I just called bind() in >>>> TableName.java whereever the schema was null. >>>> >>> >>> >>> >>> I'm not sure this is correct, because if you remember you patch to >>> Derby-13, a TableName with a null schema can represent a correlation >>> name (which don't have schemas). So the fact a TableName's schema name >>> is null does not always mean that its schema name maps to the current >>> schema. Thus only when a TableName represents a implicitly schema >>> qualifed name (table, view, procedure, function, trigger, index, >>> constraint name) should its lack of schema name be converted to the >>> current schema. Possibly the only case that doesn't have an implicit >>> schema name is the correlation name. >>> >>> >> Yes you are right, I agree . >> >>> Thus the patch needs to be careful of this overloaded use of TableName. >>> Does your patch handle this correctly? >> >> >> While binding the TableName object with schema name see whether >> correlation nae is null or not, along these lines. >> >>> Without looking at the code in >>> detail I'm not sure how to handle this correctly, if you haven't made >>> any progress I can try give and help out tomorrow. >>> >>> >> Your help and comments would be helpful for me to learn going >> forward. Thanks :-) >> >>> Dan. >>> >>> -----BEGIN PGP SIGNATURE----- >>> Version: GnuPG v1.2.5 (MingW32) >>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >>> >>> iD8DBQFB+c6jIv0S4qsbfuQRAvmcAJ9Nu4H0HzhGxg+S8nOJqBxi1gbbAQCgtWjO >>> dLSVBATTSeJjkHrin45ygk4= >>> =3KaU >>> -----END PGP SIGNATURE----- >>> >>> >>> >------------------------------------------------------------------------ > >Index: java/engine/org/apache/derby/impl/sql/compile/FromList.java >=================================================================== >--- java/engine/org/apache/derby/impl/sql/compile/FromList.java (revision 148848) >+++ java/engine/org/apache/derby/impl/sql/compile/FromList.java (working copy) >@@ -138,6 +138,7 @@ > */ > TableName leftTable = null; > TableName rightTable = null; >+ > if (! (fromTable instanceof TableOperatorNode)) > { > /* Check for duplicate table name in FROM list */ >@@ -146,12 +147,18 @@ > { > leftTable = fromTable.getTableName(); > >+ if(leftTable.getSchemaName() == null && fromTable.correlationName == null) >+ leftTable.bind(this.getDataDictionary()); >+ > if(((FromTable) elementAt(index)) instanceof TableOperatorNode) { > continue; > } > >- else { >+ else { > rightTable = ((FromTable) elementAt(index)).getTableName(); >+ >+ if(rightTable.getSchemaName() == null && ((FromTable) elementAt(index)).correlationName == null) >+ rightTable.bind(this.getDataDictionary()); > } > if(leftTable.equals(rightTable)) > { >@@ -291,6 +298,7 @@ > { > fromTable = (FromTable) elementAt(index); > setElementAt(fromTable.bindNonVTITables(dataDictionary, fromListParam), index); >+ > } > for (int index = 0; index < size; index++) > { >@@ -499,9 +507,9 @@ > int size = size(); > for (int index = 0; index < size; index++) > { >- fromTable = (FromTable) elementAt(index); >+ fromTable = (FromTable) elementAt(index); > >- /* We can stop if we've found a matching column or table name >+ /* We can stop if we've found a matching column or table name > * at the previous nesting level. > */ > currentLevel = fromTable.getLevel(); >Index: java/engine/org/apache/derby/impl/sql/compile/FromVTI.java >=================================================================== >--- java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (revision 148848) >+++ java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (working copy) >@@ -988,6 +988,13 @@ > > columnsTableName = columnReference.getTableNameNode(); > >+ if(columnsTableName != null) >+ if(columnsTableName.getSchemaName() == null && correlationName == null) >+ columnsTableName.bind(this.getDataDictionary()); >+ >+ if(exposedName != null) >+ if(exposedName.getSchemaName() == null && correlationName == null) >+ exposedName.bind(this.getDataDictionary()); > /* > ** If the column did not specify a name, or the specified name > ** matches the table we're looking at, see whether the column >Index: java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java >=================================================================== >--- java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (revision 148848) >+++ java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (working copy) >@@ -2125,6 +2125,7 @@ > { > TableDescriptor tableDescriptor = bindTableDescriptor(); > >+ > /* if (tableDescriptor.getTableType() == TableDescriptor.VTI_TYPE) { > ResultSetNode vtiNode = getNodeFactory().mapTableAsVTI(getContextManager(), tableDescriptor); > return vtiNode.bindNonVTITables(dataDictionary, fromListParam); >@@ -2445,6 +2446,10 @@ > > columnsTableName = columnReference.getTableNameNode(); > >+ if(columnsTableName != null) { >+ if(columnsTableName.getSchemaName() == null && correlationName == null) >+ columnsTableName.bind(this.getDataDictionary()); >+ } > /* > ** If there is a correlation name, use that instead of the > ** table name. >@@ -2458,6 +2463,8 @@ > exposedTableName = tableName; > } > >+ if(exposedTableName.getSchemaName() == null && correlationName == null) >+ exposedTableName.bind(this.getDataDictionary()); > /* > ** If the column did not specify a name, or the specified name > ** matches the table we're looking at, see whether the column >@@ -2465,6 +2472,7 @@ > */ > if (columnsTableName == null || columnsTableName.equals(exposedTableName)) > { >+ > resultColumn = resultColumns.getResultColumn(columnReference.getColumnName()); > /* Did we find a match? */ > if (resultColumn != null) >@@ -2480,8 +2488,7 @@ > tableDescriptor.setReferencedColumnMap(referencedColumnMap); > } > } >- } >- >+ } > return resultColumn; > } > >Index: java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java >=================================================================== >--- java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java (revision 148848) >+++ java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java (working copy) >@@ -305,6 +305,10 @@ > > columnsTableName = columnReference.getTableNameNode(); > >+ if(columnsTableName != null) >+ if(columnsTableName.getSchemaName() == null && correlationName == null) >+ columnsTableName.bind(this.getDataDictionary()); >+ > if (SanityManager.DEBUG) > { > SanityManager.ASSERT(preStmt!=null, "must have prepared statement"); >@@ -324,6 +328,11 @@ > SanityManager.ASSERT(baseTableName!=null,"no name on target table"); > } > >+ if(baseTableName != null) >+ if(baseTableName.getSchemaName() == null && correlationName == null) >+ baseTableName.bind(this.getDataDictionary()); >+ >+ > /* > * If the column did not specify a name, or the specified name > * matches the table we're looking at, see whether the column > > From kaitlin41@example.org Tue Feb 01 13:58:43 2005 Return-Path: <kaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 45419 invoked from network); 1 Feb 2005 13:58:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 1 Feb 2005 13:58:42 -0000 Received: (qmail 19848 invoked by uid 500); 1 Feb 2005 13:58:41 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 19821 invoked by uid 500); 1 Feb 2005 13:58:41 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk list-help: <mailto:kaitlin41@example.org> list-unsubscribe: <mailto:kaitlin41@example.org> list-post: <mailto:kaitlin41@example.org> List-Id: <derby-dev.db.apache.org> Reply-To: "Derby Development" <kaitlin41@example.org> Delivered-To: mailing list kaitlin41@example.org Received: (qmail 19805 invoked by uid 99); 1 Feb 2005 13:58:40 -0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from e34.co.us.ibm.com (HELO e34.co.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 05:58:35 -0800 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [83.161.120.155]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j11DwWaQ528696 for <kaitlin41@example.org>; Tue, 1 Feb 2005 08:58:32 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [83.161.120.155]) by d03relay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j11DwWku229194 for <kaitlin41@example.org>; Tue, 1 Feb 2005 06:58:32 -0700 Received: from d03av01.boulder.ibm.com (loopback [83.161.120.155]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j11DwWfO021400 for <kaitlin41@example.org>; Tue, 1 Feb 2005 06:58:32 -0700 Received: from [83.161.120.155] (sig-9-48-124-172.mts.ibm.com [83.161.120.155]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j11DwRKu021246; Tue, 1 Feb 2005 06:58:28 -0700 Message-ID: <kaitlin41@example.org> Date: Tue, 01 Feb 2005 05:56:56 -0800 From: myrna <kaitlin41@example.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development <kaitlin41@example.org> Subject: [PATCH] testing - add jdbcapi & jdbc20 suites to derbynetmats Content-Type: multipart/mixed; boundary="------------010003070603070902090605" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------010003070603070902090605 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, Networkserver testing can/should be augmented by running the jdbc20 & jdbcapi suites. As happens after applying attached patch. Thx, Myrna --------------010003070603070902090605 Content-Type: text/plain; name="tst020105.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tst020105.diff" Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/importExport.out =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/importExport.out (revision 0) +++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/importExport.out (revision 0) @@ -0,0 +1,25 @@ +Test importExport starting +testing non-existing data file +The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE04: Data file not found: extinout/Z.dat +testing null data file +The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE05: Data file can not be null. +testing empty table +testing empty table with Delimited format +testing empty table import Field/Char Delimiters +PASS: setup complete +testing import/export with default options +testing IE with code set 8859_1 +testing IE with delimiter and codeset +testing IE with delimiters(%, &) and Cp1252 +testing IE with delimiters(%, &) and UTF-16 +testing IE with delimiters(^, #) and WRONG ENCODEINGH +Got IOException while writing data to the file +testing datatypes that does not have Export Supprt +Column 'C1' in the table is of type BLOB, it is not supported by import/export. +Column 'C1' in the table is of type BLOB, it is not supported by import/export. +The exception 'SQL Exception: Read endOfFile at unexpected place on line 2' was thrown while evaluating an expression. SQLSTATE: XIE0E: Read endOfFile at unexpected place on line 2 +PASS: finished testing import and export +PASS: teardown complete +PASS: finished cleaning up the temporary objects from database +PASS +Test importExport finished Property changes on: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/importExport.out ___________________________________________________________________ Name: svn:eol-style + native Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out (revision 0) +++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out (revision 0) @@ -0,0 +1,721 @@ +ij> --table used for export +create table ex_emp(id int , name char(7) , skills varchar(200), salary decimal(10,2)) ; +0 rows inserted/updated/deleted +ij> --table used for import +create table imp_emp(id int , name char(7), skills varchar(200), salary decimal(10,2)) ; +0 rows inserted/updated/deleted +ij> --After an export from ex_emp and import to imp_emp both tables should have +-----same data. +-----double delimter cases with default character delimter " +-----field seperator character inside a double delimited string as first line +insert into ex_emp values(99, 'smith' , 'tennis"p,l,ayer"', 190.55) ; +1 row inserted/updated/deleted +ij> -- Perform Export: +call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + null, null, null) ; +Statement executed. +ij> -- Perform Import +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , + null, null, null, 0) ; +Statement executed. +ij> insert into ex_emp values(100, 'smith' , 'tennis"player"', 190.55) ; +1 row inserted/updated/deleted +ij> insert into ex_emp values(101, 'smith' , 'tennis"player', 190.55) ; +1 row inserted/updated/deleted +ij> insert into ex_emp values(102, 'smith' , '"tennis"player', 190.55) ; +1 row inserted/updated/deleted +ij> insert into ex_emp values(103, 'smith' , '"tennis"player"', 190.55) ; +1 row inserted/updated/deleted +ij> insert into ex_emp values(104, 'smith' , '"tennis"""""""""""""""""""""""""""""""""""""player"', null) ; +1 row inserted/updated/deleted +ij> --empty string +insert into ex_emp values(105, 'smith' , '""', 190.55) ; +1 row inserted/updated/deleted +ij> --just delimeter inside +insert into ex_emp values(106, 'smith' , '"""""""""""""""""""', 190.55); +1 row inserted/updated/deleted +ij> --null value +insert into ex_emp values(107, 'smith"' , null, 190.55) ; +1 row inserted/updated/deleted +ij> --all values are nulls +insert into ex_emp values(108, null , null, null) ; +1 row inserted/updated/deleted +ij> -- Perform Export: +call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + null, null, null) ; +Statement executed. +ij> -- Perform Import +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , + null, null, null, 0) ; +Statement executed. +ij> select * from ex_emp; +ID |NAME |SKILLS |SALARY +----- +99 |smith |tennis"p,l,ayer" |190.55 +100 |smith |tennis"player" |190.55 +101 |smith |tennis"player |190.55 +102 |smith |"tennis"player |190.55 +103 |smith |"tennis"player" |190.55 +104 |smith |"tennis"""""""""""""""""""""""""""""""""""""player" |NULL +105 |smith |"" |190.55 +106 |smith |""""""""""""""""""" |190.55 +107 |smith" |NULL |190.55 +108 |NULL |NULL |NULL +ij> select * from imp_emp; +ID |NAME |SKILLS |SALARY +----- +99 |smith |tennis"p,l,ayer" |190.55 +99 |smith |tennis"p,l,ayer" |190.55 +100 |smith |tennis"player" |190.55 +101 |smith |tennis"player |190.55 +102 |smith |"tennis"player |190.55 +103 |smith |"tennis"player" |190.55 +104 |smith |"tennis"""""""""""""""""""""""""""""""""""""player" |NULL +105 |smith |"" |190.55 +106 |smith |""""""""""""""""""" |190.55 +107 |smith" |NULL |190.55 +108 |NULL |NULL |NULL +ij> --checking query +select count(*) from imp_emp, ex_emp + where ex_emp.id = imp_emp.id and + (ex_emp.skills=imp_emp.skills or + (ex_emp.skills is NULL and imp_emp.skills is NULL)); +1 +----- +11 +ij> delete from imp_emp where id < 105; +7 rows inserted/updated/deleted +ij> --export from ex_emp using the a query only rows that got deleted in imp_emp +call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from ex_emp where id < 105', + 'extinout/emp.dat' , null, null, null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , + null, null, null, 0) ; +Statement executed. +ij> --checking query +select count(*) from imp_emp, ex_emp + where ex_emp.id = imp_emp.id and + (ex_emp.skills=imp_emp.skills or + (ex_emp.skills is NULL and imp_emp.skills is NULL)); +1 +----- +10 +ij> --export the columns in different column order than in the table. +call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select name , salary , skills, id from ex_emp where id < 105', + 'extinout/emp.dat' , null, null, null) ; +Statement executed. +ij> -- import them in to a with order different than in the table; +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'name, salary, skills, id', null, + 'extinout/emp.dat', null, null, null, 1) ; +Statement executed. +ij> --check query +select count(*) from imp_emp, ex_emp + where ex_emp.id = imp_emp.id and + (ex_emp.skills=imp_emp.skills or + (ex_emp.skills is NULL and imp_emp.skills is NULL)); +1 +----- +6 +ij> -- do import replace into the table with table order but using column indexes +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,null, '4, 1, 3, 2', + 'extinout/emp.dat', null, null, null, 1) ; +Statement executed. +ij> --check query +select count(*) from imp_emp, ex_emp + where ex_emp.id = imp_emp.id and + (ex_emp.skills=imp_emp.skills or + (ex_emp.skills is NULL and imp_emp.skills is NULL)); +1 +----- +6 +ij> --replace using insert column names and column indexes +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'salary, id, skills, name', '2, 4, 3, 1', + 'extinout/emp.dat', null, null, null, 1) ; +Statement executed. +ij> --check query +select count(*) from imp_emp, ex_emp + where ex_emp.id = imp_emp.id and + (ex_emp.skills=imp_emp.skills or + (ex_emp.skills is NULL and imp_emp.skills is NULL)); +1 +----- +6 +ij> ---testing with different delimiters +----- single quote(') as character delimiter +call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + null, '''', null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , + null, '''', null, 1) ; +Statement executed. +ij> select * from imp_emp ; +ID |NAME |SKILLS |SALARY +----- +99 |smith |tennis"p,l,ayer" |190.55 +100 |smith |tennis"player" |190.55 +101 |smith |tennis"player |190.55 +102 |smith |"tennis"player |190.55 +103 |smith |"tennis"player" |190.55 +104 |smith |"tennis"""""""""""""""""""""""""""""""""""""player" |NULL +105 |smith |"" |190.55 +106 |smith |""""""""""""""""""" |190.55 +107 |smith" |NULL |190.55 +108 |NULL |NULL |NULL +ij> -- single quote(') as column delimiter +call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + '''',null, null) ; +Statement executed. +ij> delete from imp_emp ; +10 rows inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , + '''', null, null, 0) ; +Statement executed. +ij> select * from imp_emp; +ID |NAME |SKILLS |SALARY +----- +99 |smith |tennis"p,l,ayer" |190.55 +100 |smith |tennis"player" |190.55 +101 |smith |tennis"player |190.55 +102 |smith |"tennis"player |190.55 +103 |smith |"tennis"player" |190.55 +104 |smith |"tennis"""""""""""""""""""""""""""""""""""""player" |NULL +105 |smith |"" |190.55 +106 |smith |""""""""""""""""""" |190.55 +107 |smith" |NULL |190.55 +108 |NULL |NULL |NULL +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + '*', '%', null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , + '*', '%', null, 1) ; +Statement executed. +ij> select * from imp_emp ; +ID |NAME |SKILLS |SALARY +----- +99 |smith |tennis"p,l,ayer" |190.55 +100 |smith |tennis"player" |190.55 +101 |smith |tennis"player |190.55 +102 |smith |"tennis"player |190.55 +103 |smith |"tennis"player" |190.55 +104 |smith |"tennis"""""""""""""""""""""""""""""""""""""player" |NULL +105 |smith |"" |190.55 +106 |smith |""""""""""""""""""" |190.55 +107 |smith" |NULL |190.55 +108 |NULL |NULL |NULL +ij> --cases for identity columns +-----create table emp1(id int generated always as identity (start with 100), name char(7), +----- skills varchar(200), salary decimal(10,2),skills varchar(200)); +-----check import export with real and double that can not be explictitly +-----casted from VARCHAR type . +create table noncast(c1 double , c2 real ) ; +0 rows inserted/updated/deleted +ij> insert into noncast values(1.5 , 6.7 ) ; +1 row inserted/updated/deleted +ij> insert into noncast values(2.5 , 8.999) ; +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP' , 'noncast' , 'extinout/noncast.dat' , null , null , null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'noncast' , 'extinout/noncast.dat' , null , null , null , 0) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'noncast', 'c2 , c1' , '2, 1' , + 'extinout/noncast.dat' , null , null , null , 0) ; +Statement executed. +ij> select * from noncast ; +C1 |C2 +----- +1.5 |6.7 +2.5 |8.999 +1.5 |6.7 +2.5 |8.999 +1.5 |6.7 +2.5 |8.999 +ij> --check import/export of time types +CREATE TABLE TTYPES(DATETYPE DATE, TIMETYPE TIME, TSTAMPTYPE TIMESTAMP ); +0 rows inserted/updated/deleted +ij> insert into ttypes values('1999-09-09' , '12:15:19' , 'xxxxxxFILTERED-TIMESTAMPxxxxx); +1 row inserted/updated/deleted +ij> insert into ttypes values('2999-12-01' , '13:16:10' , 'xxxxxxFILTERED-TIMESTAMPxxxxx); +1 row inserted/updated/deleted +ij> insert into ttypes values('3000-11-02' , '14:17:21' , 'xxxxxxFILTERED-TIMESTAMPxxxxx); +1 row inserted/updated/deleted +ij> insert into ttypes values('2004-04-03' , '15:18:31' , 'xxxxxxFILTERED-TIMESTAMPxxxxx); +1 row inserted/updated/deleted +ij> insert into ttypes values(null , null , null); +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , + null, null, null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , + null, null, null, 0) ; +Statement executed. +ij> select * from ttypes; +DATETYPE |TIMETYPE |TSTAMPTYPE +----- +1999-09-09 |12:15:19 |xxxxxxFILTERED-TIMESTAMPxxxxx +2999-12-01 |13:16:10 |xxxxxxFILTERED-TIMESTAMPxxxxx +3000-11-02 |14:17:21 |xxxxxxFILTERED-TIMESTAMPxxxxx +2004-04-03 |15:18:31 |xxxxxxFILTERED-TIMESTAMPxxxxx +NULL |NULL |NULL +1999-09-09 |12:15:19 |xxxxxxFILTERED-TIMESTAMPxxxxx +2999-12-01 |13:16:10 |xxxxxxFILTERED-TIMESTAMPxxxxx +3000-11-02 |14:17:21 |xxxxxxFILTERED-TIMESTAMPxxxxx +2004-04-03 |15:18:31 |xxxxxxFILTERED-TIMESTAMPxxxxx +NULL |NULL |NULL +ij> ---Import should commit on success and rollback on any failures +autocommit off ; +ij> create table t1(a int ) ; +0 rows inserted/updated/deleted +ij> insert into t1 values(1) ; +1 row inserted/updated/deleted +ij> insert into t1 values(2) ; +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , + null, null, null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , + null, null, null, 0) ; +Statement executed. +ij> --above import should have committed , following rollback should be a noop. +rollback; +ij> select * from t1; +A +----- +1 +2 +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --file not found error should rollback +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , + null, null, null, 0) ; +ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE04: Data file not found: extinout/nofile.del +ij> commit; +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --table not found error should issue a implicit rollback +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , + null, null, null, 0) ; +ERROR XIE0M: Table 'NOTABLE' does not exist. +ij> commit ; +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +ij> delete from t1; +4 rows inserted/updated/deleted +ij> ---check commit/rollback with replace options using +insert into t1 values(1) ; +1 row inserted/updated/deleted +ij> insert into t1 values(2) ; +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , + null, null, null) ; +Statement executed. +ij> --above export should have a commit.rollback below should be a noop +rollback; +ij> select * from t1; +A +----- +1 +2 +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , + null, null, null, 1) ; +Statement executed. +ij> --above import should have committed , following rollback should be a noop. +rollback; +ij> select * from t1; +A +----- +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --file not found error should rollback +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , + null, null, null, 1) ; +ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE04: Data file not found: extinout/nofile.del +ij> commit; +ij> select * from t1 ; +A +----- +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --table not found error should issue a implicit rollback +call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , + null, null, null, 1) ; +ERROR XIE0M: Table 'NOTABLE' does not exist. +ij> commit ; +ij> ---check IMPORT_DATA calls commit/rollback +select * from t1 ; +A +----- +1 +2 +ij> delete from t1; +2 rows inserted/updated/deleted +ij> ---check commit/rollback with replace options using +insert into t1 values(1) ; +1 row inserted/updated/deleted +ij> insert into t1 values(2) ; +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , + null, null, null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , + null, null, null, 0) ; +Statement executed. +ij> --above import should have committed , following rollback should be a noop. +rollback; +ij> select * from t1; +A +----- +1 +2 +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --file not found error should rollback +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1' , 'extinout/nofile.del' , + null, null, null, 0) ; +ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE04: Data file not found: extinout/nofile.del +ij> commit; +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +ij> insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> --table not found error should issue a implicit rollback +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'notable' , 'a' , '1', 'extinout/t1.del' , + null, null, null, 1) ; +ERROR XIE0M: Table 'NOTABLE' does not exist. +ij> commit ; +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +ij> autocommit on ; +ij> --make sure commit import code is ok in autcommit mode. +insert into t1 values(3) ; +1 row inserted/updated/deleted +ij> insert into t1 values(4) ; +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , + null, null, null, 0) ; +Statement executed. +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +3 +4 +1 +2 +ij> insert into t1 values(5) ; +1 row inserted/updated/deleted +ij> insert into t1 values(6) ; +1 row inserted/updated/deleted +ij> --following import will back , but should not have any impact on inserts +call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1' , 'extinout/nofile.del' , + null, null, null, 0) ; +ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression. SQLSTATE: 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression. SQLSTATE: XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'. SQLSTATE: XIE04: Data file not found: extinout/nofile.del +ij> select * from t1 ; +A +----- +1 +2 +1 +2 +3 +4 +1 +2 +5 +6 +ij> --END IMPORT COMMIT/ROLLBACK TESTSING +-----all types supported by DB2 cloudscape import/export +create table alltypes(chartype char(20) , + biginttype bigint , + datetype date , + decimaltype decimal(10,5) , + doubletype double , + inttype integer , + lvartype long varchar , + realtype real , + sminttype smallint , + timetype time , + tstamptype timestamp , + vartype varchar(50)); +0 rows inserted/updated/deleted +ij> insert into alltypes values('chartype string' , + 9223372036854775807, + '1993-10-29' , + 12345.54321, + 10E307, + 508-709-1184, + 'long varchar testing', + 10E3, + 32767, + '09.39.43', + 'xxxxxxFILTERED-TIMESTAMPxxxxx, + 'varchar testing'); +1 row inserted/updated/deleted +ij> insert into alltypes values('chartype string' , + -9223372036854775808, + '1993-10-29' , + 0.0, + -10E307, + -508-709-1184, + 'long varchar testing', + -10E3, + 32767, + '09.39.43', + 'xxxxxxFILTERED-TIMESTAMPxxxxx, + 'varchar testing'); +1 row inserted/updated/deleted +ij> insert into alltypes values('"chartype" string' , + 9223372036854775807, + '1993-10-29' , + -12345.54321, + 10E307, + 508-709-1184, + 'long "varchar" testing', + 10E3, + 32767, + '09.39.43', + 'xxxxxxFILTERED-TIMESTAMPxxxxx, + '"varchar" testing'); +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , + null, null, null) ; +Statement executed. +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , + null, null, null, 0) ; +Statement executed. +ij> select * from alltypes ; +CHARTYPE |BIGINTTYPE |DATETYPE |DECIMALTYPE |DOUBLETYPE |INTTYPE |LVARTYPE |REALTYPE |SMINT& |TIMETYPE |TSTAMPTYPE |VARTYPE +----- +chartype string |9223372036854775807 |1993-10-29 |12345.54321 |1.0E308 |508-709-1184 |long varchar testing |10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |varchar testing +chartype string |-9223372036854775808 |1993-10-29 |0.00000 |-1.0E308 |-508-709-1184 |long varchar testing |-10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |varchar testing +"chartype" string |9223372036854775807 |1993-10-29 |-12345.54321 |1.0E308 |508-709-1184 |long "varchar" testing |10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |"varchar" testing +chartype string |9223372036854775807 |1993-10-29 |12345.54321 |1.0E308 |508-709-1184 |long varchar testing |10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |varchar testing +chartype string |-9223372036854775808 |1993-10-29 |0.00000 |-1.0E308 |-508-709-1184 |long varchar testing |-10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |varchar testing +"chartype" string |9223372036854775807 |1993-10-29 |-12345.54321 |1.0E308 |508-709-1184 |long "varchar" testing |10000.0 |32767 |09:39:43 |xxxxxxFILTERED-TIMESTAMPxxxxx |"varchar" testing +ij> delete from alltypes; +6 rows inserted/updated/deleted +ij> --import should work with trigger enabled on append and should not work on replace +create table test1(a char(20)) ; +0 rows inserted/updated/deleted +ij> create trigger trig_import after INSERT on alltypes +referencing new as newrow +for each row mode db2sql +insert into test1 values(newrow.chartype); +0 rows inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , + null, null, null, 0) ; +Statement executed. +ij> select count(*) from alltypes ; +1 +----- +3 +ij> select * from test1; +A +----- +chartype string +chartype string +"chartype" string +ij> delete from alltypes; +3 rows inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , + null, null, null, 1) ; +ERROR 38000: The exception 'SQL Exception: Bulk insert replace is not permitted on 'APP.ALLTYPES' because it has an enabled trigger (TRIG_IMPORT).' was thrown while evaluating an expression. SQLSTATE: 42Z08: Bulk insert replace is not permitted on 'APP.ALLTYPES' because it has an enabled trigger (TRIG_IMPORT). +ij> select count(*) from alltypes; +1 +----- +0 +ij> drop trigger trig_import; +0 rows inserted/updated/deleted +ij> drop table test1; +0 rows inserted/updated/deleted +ij> --test importing to identity columns +create table table1(c1 char(30), + c2 int generated always as identity, + c3 real, + c4 char(1)); +0 rows inserted/updated/deleted +ij> create table table2(c1 char(30), + c2 int, + c3 real, + c4 char(1)); +0 rows inserted/updated/deleted +ij> insert into table2 values('Robert',100, 45.2, 'J'); +1 row inserted/updated/deleted +ij> insert into table2 values('Mike',101, 76.9, 'K'); +1 row inserted/updated/deleted +ij> insert into table2 values('Leo',102, 23.4, 'I'); +1 row inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select c1,c3,c4 from table2' , 'extinout/import.del' , + null, null, null) ; +Statement executed. +ij> CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL,'table1', 'c1,c3,c4' , null, 'extinout/import.del',null, null,null,0); +Statement executed. +ij> select * from table1; +C1 |C2 |C3 |C4 +----- +Robert |1 |45.2 |J +Mike |2 |76.9 |K +Leo |3 |23.4 |I +ij> delete from table1; +3 rows inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del', null, null, null) ; +Statement executed. +ij> --following import should fail becuase of inserting into identity column. +CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1); +ERROR 38000: The exception 'SQL Exception: Attempt to modify an identity column 'C2'.' was thrown while evaluating an expression. SQLSTATE: 42Z23: Attempt to modify an identity column 'C2'. +ij> --following import should be succesful +CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL, 'table1', 'c1,c3,c4' , '1,3,4', 'extinout/import.del',null, null, null,1); +Statement executed. +ij> select * from table1; +C1 |C2 |C3 |C4 +----- +Robert |1 |45.2 |J +Mike |2 |76.9 |K +Leo |3 |23.4 |I +ij> update table2 set c2=null; +3 rows inserted/updated/deleted +ij> --check null values import to identity columns should also fail +call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del' , + null, null, null) ; +Statement executed. +ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1); +ERROR 38000: The exception 'SQL Exception: Attempt to modify an identity column 'C2'.' was thrown while evaluating an expression. SQLSTATE: 42Z23: Attempt to modify an identity column 'C2'. +ij> select * from table1; +C1 |C2 |C3 |C4 +----- +Robert |1 |45.2 |J +Mike |2 |76.9 |K +Leo |3 |23.4 |I +ij> --check that replace fails when there dependents and replaced data +-----does not violate foreign key constraints. +create table parent(a int not null primary key); +0 rows inserted/updated/deleted +ij> insert into parent values (1) , (2) , (3) , (4) ; +4 rows inserted/updated/deleted +ij> create table child(b int references parent(a)); +0 rows inserted/updated/deleted +ij> insert into child values (1) , (2) , (3) , (4) ; +4 rows inserted/updated/deleted +ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from parent where a < 3' , 'extinout/parent.del' , + null, null, null) ; +Statement executed. +ij> --replace should fail because of dependent table +CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'parent', 'extinout/parent.del',null, null, null,1); +ERROR 38000: The exception 'SQL Exception: INSERT on table 'PARENT' caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3). The statement has been rolled back.' was thrown while evaluating an expression. SQLSTATE: 23503: INSERT on table 'PARENT' caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3). The statement has been rolled back. +ij> select * from parent; +A +----- +1 +2 +3 +4 +ij> ---test with a file which has a differen records seperators (\n, \r , \r\n) +create table nt1( a int , b char(30)); +0 rows inserted/updated/deleted +ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'nt1', 'extin/mixednl.del',null, null, null,0); +Statement executed. +ij> select * from nt1; +A |B +----- +0 |XXXXXX0 +1 |XXXXXX1 +2 |XXXXXX2 +3 |XXXXXX3 +4 |XXXXXX4 +5 |YYYYY5 +6 |YYYYY6 +7 |YYYYY7 +8 |YYYYY8 +9 |YYYYY9 +10 |ZZZZZZ10 +11 |ZZZZZZ11 +12 |ZZZZZZ12 +13 |ZZZZZZ13 +14 |ZZZZZZ14 +ij> drop table nt1 ; +0 rows inserted/updated/deleted +ij> --test case for bug 5977;(with lot of text data) +create table position_info + ( + position_code varchar(10) not null , + literal_no int not null , + job_category_code varchar(10), + summary_description long varchar, + detail_description long varchar, + web_flag varchar(1) + ); +0 rows inserted/updated/deleted +ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extin/position_info.del', + null, null, null, 1); +Statement executed. +ij> select count(*) from position_info ; +1 +----- +680 +ij> select detail_description from position_info where position_code='AG1000'; +DETAIL_DESCRIPTION +----- +Essential Duties and Responsibilities (include but not limited to): +*Assist the director in his work activities in leading the& +ij> CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del', + null, null, null); +Statement executed. +ij> delete from position_info; +680 rows inserted/updated/deleted +ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del', + null, null, null, 1); +Statement executed. +ij> select count(*) from position_info ; +1 +----- +680 +ij> select detail_description from position_info where position_code='AG1000'; +DETAIL_DESCRIPTION +----- +Essential Duties and Responsibilities (include but not limited to): +*Assist the director in his work activities in leading the& +ij> Property changes on: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out ___________________________________________________________________ Name: svn:eol-style + native Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out (revision 0) +++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/LOBTest.out (revision 0) @@ -0,0 +1,3873 @@ +create table bit_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol char (8 ) for bit data ) +insert into bit_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS char (8 ) for bit data) ) +insert into bit_table ( col_0 ) values ( 'true' ) + com.ibm.db2.jcc.c.SqlException: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. +insert into bit_table ( col_1 ) values ( 'true' ) +insert into bit_table ( col_2 ) values ( 'true' ) +insert into bit_table ( col_3 ) values ( 'true' ) +insert into bit_table ( col_4 ) values cast ( X'0074007200750065' AS char(10) for bit data) +insert into bit_table ( col_5 ) values cast ( X'0074007200750065' AS long varchar for bit data) +insert into bit_table ( col_6 ) values cast ( X'0074007200750065' AS blob(80)) +insert into bit_table ( typecol ) values cast ( X'0074007200750065' AS char (8 ) for bit data) +=== Columntype int +select col_0 from bit_table + 0 getObject ->'100' : java.lang.Integer + 0 getArray -> EXCEPTION (not yet implemented) + 0 getAsciiStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getBigDecimal ->'100' : java.math.BigDecimal + 0 getBinaryStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getBoolean ->'true' : java.lang.Boolean + 0 getByte ->'100' : java.lang.Byte + 0 getBytes -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getCharacterStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getDate -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getDouble ->'100.0' : java.lang.Double + 0 getFloat ->'100.0' : java.lang.Float + 0 getInt ->'100' : java.lang.Integer + 0 getLong ->'100' : java.lang.Long + 0 getRef -> EXCEPTION (not yet implemented) + 0 getShort ->'100' : java.lang.Short + 0 getString ->'100' : java.lang.String + 0 getTime -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 0 getTimeStamp -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) +=== Columntype char(10) +select col_1 from bit_table + 1 getObject ->'101 ' : java.lang.String + 1 getArray -> EXCEPTION (not yet implemented) + 1 getAsciiStream ->Object' : java.io.InputStream + 1 getBigDecimal ->'101' : java.math.BigDecimal + 1 getBinaryStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 1 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 1 getBoolean ->'true' : java.lang.Boolean + 1 getByte ->'101' : java.lang.Byte + 1 getBytes -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 1 getCharacterStream ->Object' : java.io.Reader + 1 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 1 getDate -> EXCEPTION (Invalid data conversion: Parameter instance 101 is invalid for requested conversion to java.sql.Date.) + 1 getDouble ->'101.0' : java.lang.Double + 1 getFloat ->'101.0' : java.lang.Float + 1 getInt ->'101' : java.lang.Integer + 1 getLong ->'101' : java.lang.Long + 1 getRef -> EXCEPTION (not yet implemented) + 1 getShort ->'101' : java.lang.Short + 1 getString ->'101 ' : java.lang.String + 1 getTime -> EXCEPTION (Invalid data conversion: Parameter instance 101 is invalid for requested conversion to java.sql.Time.) + 1 getTimeStamp -> EXCEPTION (Invalid data conversion: Parameter instance 101 is invalid for requested conversion to java.sql.Timestamp.) +=== Columntype varchar(80) +select col_2 from bit_table + 2 getObject ->'102' : java.lang.String + 2 getArray -> EXCEPTION (not yet implemented) + 2 getAsciiStream ->Object' : java.io.InputStream + 2 getBigDecimal ->'102' : java.math.BigDecimal + 2 getBinaryStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 2 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 2 getBoolean ->'true' : java.lang.Boolean + 2 getByte ->'102' : java.lang.Byte + 2 getBytes -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 2 getCharacterStream ->Object' : java.io.Reader + 2 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 2 getDate -> EXCEPTION (String index out of range: 3) + 2 getDouble ->'102.0' : java.lang.Double + 2 getFloat ->'102.0' : java.lang.Float + 2 getInt ->'102' : java.lang.Integer + 2 getLong ->'102' : java.lang.Long + 2 getRef -> EXCEPTION (not yet implemented) + 2 getShort ->'102' : java.lang.Short + 2 getString ->'102' : java.lang.String + 2 getTime -> EXCEPTION (Invalid data conversion: Parameter instance 102 is invalid for requested conversion to java.sql.Time.) + 2 getTimeStamp -> EXCEPTION (String index out of range: 3) +=== Columntype long varchar +select col_3 from bit_table + 3 getObject ->'103' : java.lang.String + 3 getArray -> EXCEPTION (not yet implemented) + 3 getAsciiStream ->Object' : java.io.InputStream + 3 getBigDecimal ->'103' : java.math.BigDecimal + 3 getBinaryStream -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 3 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 3 getBoolean ->'true' : java.lang.Boolean + 3 getByte ->'103' : java.lang.Byte + 3 getBytes -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 3 getCharacterStream ->Object' : java.io.Reader + 3 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 3 getDate -> EXCEPTION (String index out of range: 3) + 3 getDouble ->'103.0' : java.lang.Double + 3 getFloat ->'103.0' : java.lang.Float + 3 getInt ->'103' : java.lang.Integer + 3 getLong ->'103' : java.lang.Long + 3 getRef -> EXCEPTION (not yet implemented) + 3 getShort ->'103' : java.lang.Short + 3 getString ->'103' : java.lang.String + 3 getTime -> EXCEPTION (Invalid data conversion: Parameter instance 103 is invalid for requested conversion to java.sql.Time.) + 3 getTimeStamp -> EXCEPTION (String index out of range: 3) +=== Columntype char(10) for bit data +select col_4 from bit_table + 4 getObject ->Object' : byte[] + 4 getArray -> EXCEPTION (not yet implemented) + 4 getAsciiStream ->Object' : java.io.InputStream + 4 getBigDecimal -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getBinaryStream ->Object' : java.io.InputStream + 4 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getBoolean -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getByte -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getBytes ->Object' : byte[] + 4 getCharacterStream ->Object' : java.io.Reader + 4 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getDate -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getDouble -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getFloat -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getInt -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getLong -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getRef -> EXCEPTION (not yet implemented) + 4 getShort -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getString ->'00310030003420202020' : java.lang.String + 4 getTime -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 4 getTimeStamp -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) +=== Columntype long varchar for bit data +select col_5 from bit_table + 5 getObject ->Object' : byte[] + 5 getArray -> EXCEPTION (not yet implemented) + 5 getAsciiStream ->Object' : java.io.InputStream + 5 getBigDecimal -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getBinaryStream ->Object' : java.io.InputStream + 5 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getBoolean -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getByte -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getBytes ->Object' : byte[] + 5 getCharacterStream ->Object' : java.io.Reader + 5 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getDate -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getDouble -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getFloat -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getInt -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getLong -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getRef -> EXCEPTION (not yet implemented) + 5 getShort -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getString ->'003100300035' : java.lang.String + 5 getTime -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 5 getTimeStamp -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) +=== Columntype blob(80) +select col_6 from bit_table + 6 getObject ->Object' : java.sql.Blob + 6 getArray -> EXCEPTION (not yet implemented) + 6 getAsciiStream ->Object' : java.io.InputStream + 6 getBigDecimal -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getBinaryStream ->Object' : java.io.InputStream + 6 getBlob ->Object' : java.sql.Blob + 6 getBoolean -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getByte -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getBytes ->Object' : byte[] + 6 getCharacterStream ->Object' : java.io.Reader + 6 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getDate -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getDouble -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getFloat -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getInt -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getLong -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getRef -> EXCEPTION (not yet implemented) + 6 getShort -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getString ->'003100300036' : java.lang.String + 6 getTime -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 6 getTimeStamp -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) +=== Columntype char (8 ) for bit data +select typecol from bit_table + 7 getObject ->Object' : byte[] + 7 getArray -> EXCEPTION (not yet implemented) + 7 getAsciiStream ->Object' : java.io.InputStream + 7 getBigDecimal -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getBinaryStream ->Object' : java.io.InputStream + 7 getBlob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getBoolean -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getByte -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getBytes ->Object' : byte[] + 7 getCharacterStream ->Object' : java.io.Reader + 7 getClob -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getDate -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getDouble -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getFloat -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getInt -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getLong -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getRef -> EXCEPTION (not yet implemented) + 7 getShort -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getString ->'0031003000372020' : java.lang.String + 7 getTime -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) + 7 getTimeStamp -> EXCEPTION (Invalid data conversion: Wrong result column type for requested conversion.) +-----< METADATA TESTS +select col_0 from bit_table + ---- 1 + Column : COL_0 + Type : 4 + TypeName : INTEGER + ClassName : java.lang.Integer + Label : COL_0 + DisplaySz : 11 + Precision : 10 + Scale : 0 + isCurrency: false + isCaseSens: false + isDefWrite: false + isWrite : false + isSearchab: true + OUT = '100' : java.lang.Integer + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL +select col_1 from bit_table + ---- 1 + Column : COL_1 + Type : 1 + TypeName : CHAR + ClassName : java.lang.String + Label : COL_1 + DisplaySz : 10 + Precision : 10 + Scale : 0 + isCurrency: false + isCaseSens: true + isDefWrite: false + isWrite : false + isSearchab: true + OUT = '101 ' : java.lang.String + OUT = 'true ' : java.lang.String + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL +select col_2 from bit_table + ---- 1 + Column : COL_2 + Type : 12 + TypeName : VARCHAR + ClassName : java.lang.String + Label : COL_2 + DisplaySz : 80 + Precision : 80 + Scale : 0 + isCurrency: false + isCaseSens: true + isDefWrite: false + isWrite : false + isSearchab: true + OUT = '102' : java.lang.String + OUT = NULL + OUT = 'true' : java.lang.String + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL +select col_3 from bit_table + ---- 1 + Column : COL_3 + Type : -1 + TypeName : LONG VARCHAR + ClassName : java.lang.String + Label : COL_3 + DisplaySz : 32700 + Precision : 32700 + Scale : 0 + isCurrency: false + isCaseSens: true + isDefWrite: false + isWrite : false + isSearchab: true + OUT = '103' : java.lang.String + OUT = NULL + OUT = NULL + OUT = 'true' : java.lang.String + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL +select col_4 from bit_table + ---- 1 + Column : COL_4 + Type : -2 + TypeName : CHAR FOR BIT DATA + ClassName : byte[] + Label : COL_4 + DisplaySz : 20 + Precision : 10 + Scale : 0 + isCurrency: false + isCaseSens: false + isDefWrite: false + isWrite : false + isSearchab: true + OUT = Object : byte[] + OUT = NULL + OUT = NULL + OUT = NULL + OUT = Object : byte[] + OUT = NULL + OUT = NULL + OUT = NULL +select col_5 from bit_table + ---- 1 + Column : COL_5 + Type : -4 + TypeName : LONG VARCHAR FOR BIT DATA + ClassName : byte[] + Label : COL_5 + DisplaySz : 65400 + Precision : 32700 + Scale : 0 + isCurrency: false + isCaseSens: false + isDefWrite: false + isWrite : false + isSearchab: true + OUT = Object : byte[] + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = Object : byte[] + OUT = NULL + OUT = NULL +select col_6 from bit_table + ---- 1 + Column : COL_6 + Type : 2004 + TypeName : BLOB + ClassName : java.sql.Blob + Label : COL_6 + DisplaySz : 160 + Precision : 80 + Scale : 0 + isCurrency: false + isCaseSens: false + isDefWrite: false + isWrite : false + isSearchab: true + OUT = Object : java.sql.Blob + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = Object : java.sql.Blob + OUT = NULL +select typecol from bit_table + ---- 1 + Column : TYPECOL + Type : -2 + TypeName : CHAR FOR BIT DATA + ClassName : byte[] + Label : TYPECOL + DisplaySz : 16 + Precision : 8 + Scale : 0 + isCurrency: false + isCaseSens: false + isDefWrite: false + isWrite : false + isSearchab: true + OUT = Object : byte[] + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = NULL + OUT = Object : byte[] +-----< columns CAST TO type: METADATA TESTS +select cast( col_0 as char (8) for bit data ) from bit_table + com.ibm.db2.jcc.c.SqlException: Cannot convert types 'INTEGER' to 'CHAR () FOR BIT DATA'. +select cast( col_1 as char (8) for bit data ) from bit_table + com.ibm.db2.jcc.c.SqlException: Cannot convert types 'CHAR' to 'CHAR () FOR BIT DATA'. +select cast( col_2 as char (8) for bit data ) from bit_table + com.ibm.db2.jcc.c.SqlException: Cannot convert types 'VARCHAR' to
{'source': 'Apache Software Foundation Public Mail Archives'}