On Mon, Nov 14, 2011 at 12:49:46PM -0600, GGTESTER scratched on the wall:
> Can anybody show me how to use a function like
> "hex(randomblob(37))" as a column default (to create a SQL Server type
> unique identifier)?

  Expressions much be in parens.  Otherwise, just as you would expect:


sqlite> CREATE TABLE t ( r DEFAULT (  hex(randomblob(37)) )  );
sqlite> INSERT INTO t DEFAULT VALUES;
sqlite> INSERT INTO t DEFAULT VALUES;
sqlite> INSERT INTO t DEFAULT VALUES;
sqlite> INSERT INTO t DEFAULT VALUES;
sqlite> INSERT INTO t DEFAULT VALUES;
sqlite> SELECT * FROM t;
0530ABEA69D05C61F820BE6D06B3F394E4BF43DE5D120AD5BF91A7337AD5864494F04E2A8F
0471D87FEF35D4BD0D563BB1F28392B292EC45D169926A63823C27AB734905B71402030869
C402005D96F3C8EB6EA6652893019DEEF0E9F2D4F2449D76BDF76D7B38693B1A3218A2E026
11161A109353822ED6D708482D0490FAA3647EC7590FDF912F334D84B88D0EAE9962CDE463
6B37D811DE4ED9CDB4D96877C32D0B710CB7EEC11C9E428CA6AAEE9FDA74932E4EFF67AC5E
sqlite> 


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to