I mainly work with sql server (when I work with databases) and I am trying to learn pl-sql.
Is there any equivalent of sql-server guid auto-generation as primary keys in Oracle?
You can use SYS_GUID()to create a GUID and use it as the DEFAULT value for the column:
SYS_GUID()
CREATE TABLE test_table ( uid_col RAW(32) DEFAULT SYS_GUID(), some_val VARCHAR2(10) );
EDIT : See the answers to this question for more details .
Make the char or varchar2 column data type differently raw to convey future issues.
Source: https://habr.com/ru/post/1733271/More articles:направленный граф с минимальным числом цепей - language-agnosticReceive mail in Ruby / Rails - emailRecommendations for the file server to be used with the Rails application - filesystemsВ чем преимущество утилизации LINQ to SQL DataContext? - c#Rails getting partial view via browser url - javascriptIPod nano development options? - ipodHow can I see the SQL generated from a LINQ to SQL query? - sqlDo all dynamic languages have a problem with circular import? - pythonУдалить JQuery validationEngine из формы - jqueryWhy do I keep getting php error with unexpected ")" in the FOR statement? - htmlAll Articles