[ http://issues.apache.org/jira/browse/DERBY-337?page=all ]
Satheesh Bandaram updated DERBY-337: ------------------------------------ Description: DBLOOK schema dumping tool doesn't emit SQL statements for functions. It covers procedures and all other database objects, but not funtions. Here is an example I tried: [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:41:20.603 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); At this point, the database has only one table 'T'. Now create a function: C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij ij version 10.1 ij> connect 'tdb'; ij> create function gatp(SCH VARCHAR(128), TBL VARCHAR(128)) RETURNS VARCHAR(100 0) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestPropertyInfo.getAllTableProperties' LANGUAGE JAVA PARAMETER STYLE JAVA; 0 rows inserted/updated/deleted ij> quit; Now try dblook. Should show a function, but doesn't. [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:41:20.603 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); Now create a procedure: C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij ij version 10.1 ij> connect 'tdb'; ij> create procedure insertAsciiColumn( stmtText varchar( 256), colNumber int) P ARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.StreamUtil.insertAsc iiColumn'; 0 rows inserted/updated/deleted ij> DBLOOK output include newly created procedure, but still not function statement. [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:43:09.5 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for stored procedures -- ---------------------------------------------- CREATE PROCEDURE "APP"."INSERTASCIICOLUMN" (IN STMTTEXT VARCHAR(256),IN COLNUMBE R INTEGER) LANGUAGE JAVA PARAMETER STYLE JAVA MODIFIES SQL DATA EXTERNAL NAME 'o rg.apache.derbyTesting.functionTests.util.StreamUtil.insertAsciiColumn' ; -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); was: DBLOOK schema dumping tool doesn't emit SQL statements for functions. It covers procedures and all other database objects, but not funtions. Here is an example I tried: [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:41:20.603 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); At this point, the database has only one table 'T'. Now create a function: C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij ij version 10.1 ij> connect 'tdb'; ij> create procedure insertAsciiColumn( stmtText varchar( 256), colNumber int) P ARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.StreamUtil.insertAsciiColumn'; 0 rows inserted/updated/deleted Now the output of DBLOOK should show the procedure, but it doesn't. [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:41:20.603 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); Now create a procedure: C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij ij version 10.1 ij> connect 'tdb'; ij> create procedure insertAsciiColumn( stmtText varchar( 256), colNumber int) P ARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.StreamUtil.insertAsc iiColumn'; 0 rows inserted/updated/deleted ij> DBLOOK output include newly created procedure, but still not function statement. [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' -- Timestamp: 2005-06-05 09:43:09.5 -- Source database is: tdb -- Connection URL is: jdbc:derby:tdb -- appendLogs: false -- ---------------------------------------------- -- DDL Statements for stored procedures -- ---------------------------------------------- CREATE PROCEDURE "APP"."INSERTASCIICOLUMN" (IN STMTTEXT VARCHAR(256),IN COLNUMBE R INTEGER) LANGUAGE JAVA PARAMETER STYLE JAVA MODIFIES SQL DATA EXTERNAL NAME 'o rg.apache.derbyTesting.functionTests.util.StreamUtil.insertAsciiColumn' ; -- ---------------------------------------------- -- DDL Statements for tables -- ---------------------------------------------- CREATE TABLE "APP"."T" ("I" INTEGER); Fix cut and paste error in the description. > dblook doesn't generate SQL statements for SQL functions. > --------------------------------------------------------- > > Key: DERBY-337 > URL: http://issues.apache.org/jira/browse/DERBY-337 > Project: Derby > Type: Bug > Components: Tools > Versions: 10.0.2.0 > Environment: All platforms. > Reporter: Satheesh Bandaram > Priority: Critical > Fix For: 10.1.0.0 > > DBLOOK schema dumping tool doesn't emit SQL statements for functions. It > covers procedures and all other database objects, but not funtions. Here is > an example I tried: > [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' > -- Timestamp: 2005-06-05 09:41:20.603 > -- Source database is: tdb > -- Connection URL is: jdbc:derby:tdb > -- appendLogs: false > -- ---------------------------------------------- > -- DDL Statements for tables > -- ---------------------------------------------- > CREATE TABLE "APP"."T" ("I" INTEGER); > At this point, the database has only one table 'T'. Now create a function: > C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij > ij version 10.1 > ij> connect 'tdb'; > ij> create function gatp(SCH VARCHAR(128), TBL VARCHAR(128)) RETURNS > VARCHAR(100 > 0) > EXTERNAL NAME > 'org.apache.derbyTesting.functionTests.util.TestPropertyInfo.getAllTableProperties' > LANGUAGE JAVA PARAMETER STYLE JAVA; > 0 rows inserted/updated/deleted > ij> quit; > Now try dblook. Should show a function, but doesn't. > [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' > -- Timestamp: 2005-06-05 09:41:20.603 > -- Source database is: tdb > -- Connection URL is: jdbc:derby:tdb > -- appendLogs: false > -- ---------------------------------------------- > -- DDL Statements for tables > -- ---------------------------------------------- > CREATE TABLE "APP"."T" ("I" INTEGER); > Now create a procedure: > C:\DerbyCode\bug>java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij > ij version 10.1 > ij> connect 'tdb'; > ij> create procedure insertAsciiColumn( stmtText varchar( 256), colNumber > int) P > ARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA > EXTERNAL NAME > 'org.apache.derbyTesting.functionTests.util.StreamUtil.insertAsc > iiColumn'; > 0 rows inserted/updated/deleted > ij> > DBLOOK output include newly created procedure, but still not function > statement. > [bandaram:satheesh] java org.apache.derby.tools.dblook -d 'jdbc:derby:tdb' > -- Timestamp: 2005-06-05 09:43:09.5 > -- Source database is: tdb > -- Connection URL is: jdbc:derby:tdb > -- appendLogs: false > -- ---------------------------------------------- > -- DDL Statements for stored procedures > -- ---------------------------------------------- > CREATE PROCEDURE "APP"."INSERTASCIICOLUMN" (IN STMTTEXT VARCHAR(256),IN > COLNUMBE > R INTEGER) LANGUAGE JAVA PARAMETER STYLE JAVA MODIFIES SQL DATA EXTERNAL NAME > 'o > rg.apache.derbyTesting.functionTests.util.StreamUtil.insertAsciiColumn' ; > -- ---------------------------------------------- > -- DDL Statements for tables > -- ---------------------------------------------- > CREATE TABLE "APP"."T" ("I" INTEGER); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira