[prev in list] [next in list] [prev in thread] [next in thread]
List: hsqldb-user
Subject: Re: [Hsqldb-user] Is it possible in HSQLDB to have a Function call
From: "Fred Toussi" <fredt () users ! sourceforge ! net>
Date: 2011-08-04 21:38:52
Message-ID: 1312493932.22273.2159596777 () webmail ! messagingengine ! com
[Download RAW message or body]
No. Default expressions can be constants or one of the specified set of
functions as listed in the Guide.
You can define a BEFORE INSERT trigger to call your function and insert
the value.
Fred
On Thu, 04 Aug 2011 14:16 -0700, "Tmo_hsqldb_q" <tmoy@bgcpartners.com>
wrote:
>
> I created the function
>
> CREATE FUNCTION newid(flag int)
> RETURNS VARCHAR(36)
> NO SQL
> LANGUAGE JAVA
> EXTERNAL NAME 'CLASSPATH:com.myorg.functions.HSQLDBFunctions.newID'
>
>
> then attempted to create the following table with the newid function call
> following the DEFAULT tag:
>
>
> CREATE TABLE TESTNEWID
> (
> sessionID VARCHAR(36) DEFAULT newid(1) NOT NULL
> )
>
>
> I get the error:
>
> unexpected token: NEWID : line: 3 / Error Code: -5581 / State: 42581
> --
> View this message in context:
> http://old.nabble.com/Is-it-possible-in-HSQLDB-to-have-a-Function-call-to-produce-DEFAULT-value-in-Create-Table-statement--tp32197884p32197884.html
> Sent from the HSQLDB - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Hsqldb-user mailing list
> Hsqldb-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user
>
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic