using the SYS_GUID() function [message #317843] |
Sun, 04 May 2008 03:56  |
durgadas.menon
Messages: 365 Registered: December 2007 Location: Nowhere
|
Senior Member |
|
|
Hi,
I am trying to assign a unique number to the primary key of my table by using the sys_guid() function but only the first letter of the sequence is being inserted, here is what I did
create table test (ID long raw default sys_guid(), name varchar2(10))
insert into test(name) values ('DAS');
insert into test(name) values ('DDAS');
Quote: | I Name
6 DAS
E DDAS
|
Can anyone tell me how to insert the 32 digits?
- Das
|
|
|
|
|
|
|
Re: using the SYS_GUID() function [message #362059 is a reply to message #362053] |
Sun, 30 November 2008 06:19   |
 |
Littlefoot
Messages: 21826 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Apparently, it is not. Here's the list of Oracle 10g's reserved words.
[Adding a few more lines after seeing Michel's reply]
SQL> desc v$reserved_words
Name Null? Type
----------------------------------------- -------- ----------------
KEYWORD VARCHAR2(30)
LENGTH NUMBER
RESERVED VARCHAR2(1)
RES_TYPE VARCHAR2(1)
RES_ATTR VARCHAR2(1)
RES_SEMI VARCHAR2(1)
DUPLICATE VARCHAR2(1)
SQL> select * from v$reserved_words where keyword = 'NAME';
KEYWORD LENGTH R R R R D
------------------------------ ---------- - - - - -
NAME 4 N N N N N
SQL> v$reserved_words lists all keywords. "Reserved" column's meaning is: a value of Y means that the keyword cannot be used as an identifier. A value of N means that it is not reserved.
As "reserved" column's value for the "NAME" keyword equals "N", it seems that "NAME" is a keyword, but is not reserved word.
[Updated on: Sun, 30 November 2008 06:23] Report message to a moderator
|
|
|
|
|
|
|
|
Re: using the SYS_GUID() function [message #362067 is a reply to message #362065] |
Sun, 30 November 2008 08:52  |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
billkathj wrote on Sun, 30 November 2008 13:36 | OK, the USER case is because RES_SEMI = 'Y'.
|
No, the RES_SEMI does not explain the first example.
Don't trust Oracle, if it is in this view, don't use it.
Regards
Michel
|
|
|