How should I store a GUID in Oracle?

后端 未结 7 810
无人及你
无人及你 2020-12-08 02:16

I am coming from the SQL server world where we had uniqueidentifier. Is there an equivalent in oracle? This column will be frequently queried so performance is the key.

7条回答
  •  半阙折子戏
    2020-12-08 02:35

    If I understand the question properly, you want to generate a unique id when you insert a row in the db.
    You could use a sequence to do this. link here
    Once you have created your sequence you can use it like this:

    INSERT INTO mytable (col1, col2) VALUES (myseq.NEXTVAL, 'some other data');
    

提交回复
热议问题