You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2012/05/15 12:00:32 UTC

[Db-derby Wiki] Update of "ListFileNamesOfTables" by KristianWaagan

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The "ListFileNamesOfTables" page has been changed by KristianWaagan:
http://wiki.apache.org/db-derby/ListFileNamesOfTables?action=diff&rev1=2&rev2=3

  (CONGLOMERATENUMBER)  ||  '.dat'as varchar(12)) as file , isindex
   from SYS.SYSCONGLOMERATES a, SYS.SYSTABLES b
   where a.TABLEID = b.TABLEID AND b.TABLETYPE <> 'S' 
- and isindex = 'false'
  order by file;
  }}}
  
+ This will list all the non-system tables and indexes. If you want to exclude indexes, add the predicate '' and isindex = 'false' ''.
+ 
+ === Creating the java function 'bigintToHexString' within the database (using an existing Java API method) ===
+ 
+ In this case we can take advantage of the fact there is already a suitable method in the Java API:
+ 
+ {{{
+ CREATE FUNCTION bigintToHexString(hexString bigint)
+      RETURNS VARCHAR(16)
+      PARAMETER STYLE JAVA NO SQL
+      LANGUAGE JAVA 
+      EXTERNAL NAME 'java.lang.Long.bigintToHexString';
+ }}}
+ 
+ You're done and can run the query :)
+ 
- === Creating the java function 'bigintToHexString' within the database ===
+ === Creating the java function 'bigintToHexString' within the database (using your own method) ===
  
  1. Create and compile the java method {{{
  // Class supporting Derby Java Stored Procedures and Functions