You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In oracle 23ai I have created a domain
create domain do_uuid
as raw(16) default sys_guid() not null
annotations (UI_display 'UUID', Classification 'uuid')
display lower(
substr(lpad(rawtohex(uuid),32,'0'),1,8)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),9,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),13,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),17,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),21));
Create table x
add cp_id domain do_uuid,
nam varchar2(40) default 'test'
this gives a error in de generated the api with
om_tapigen.compile_api(p_table_name => 'X'
,p_enable_column_defaults => TRUE);
procedure and function create_rows
Make a workaround as follows:
FUNCTION util_get_column_data_default
(
p_table_name IN VARCHAR2
,p_column_name IN VARCHAR2
,p_owner IN VARCHAR2 DEFAULT USER
) RETURN VARCHAR2 AS
v_return all_tab_columns.data_default%TYPE;
--- HACK LVK
--- When having a primary with a domain default value sys_guid()
--- this function give the value sys_guid() back but with a length of 40
--- If you concatenate a string to THIS is not done (see list_params_w_pk )
/*
CURSOR c_utc IS
SELECT data_default -- LVK
FROM all_tab_columns
WHERE owner = p_owner
AND table_name = p_table_name
AND column_name = p_column_name;
BEGIN
OPEN c_utc;
FETCH c_utc
INTO v_return;
CLOSE c_utc;
RETURN substr(v_return
,1
,4000);
*/
BEGIN
SELECT a.data_default_vc
INTO v_return
FROM all_tab_columns a
WHERE owner = p_owner
AND table_name = p_table_name
AND column_name = p_column_name;
IF instr(v_return
,'sys_guid()') = 1
THEN
v_return := 'sys_guid()';
END IF;
RETURN(v_return);
END util_get_column_data_default;
The text was updated successfully, but these errors were encountered:
In oracle 23ai I have created a domain
create domain do_uuid
as raw(16) default sys_guid() not null
annotations (UI_display 'UUID', Classification 'uuid')
display lower(
substr(lpad(rawtohex(uuid),32,'0'),1,8)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),9,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),13,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),17,4)||'-'||
substr(lpad(rawtohex(uuid),32,'0'),21));
Create table x
add cp_id domain do_uuid,
nam varchar2(40) default 'test'
this gives a error in de generated the api with
om_tapigen.compile_api(p_table_name => 'X'
,p_enable_column_defaults => TRUE);
procedure and function create_rows
Make a workaround as follows:
FUNCTION util_get_column_data_default
(
p_table_name IN VARCHAR2
,p_column_name IN VARCHAR2
,p_owner IN VARCHAR2 DEFAULT USER
) RETURN VARCHAR2 AS
v_return all_tab_columns.data_default%TYPE;
--- HACK LVK
--- When having a primary with a domain default value sys_guid()
--- this function give the value sys_guid() back but with a length of 40
--- If you concatenate a string to THIS is not done (see list_params_w_pk )
BEGIN
SELECT a.data_default_vc
INTO v_return
FROM all_tab_columns a
WHERE owner = p_owner
AND table_name = p_table_name
AND column_name = p_column_name;
END util_get_column_data_default;
The text was updated successfully, but these errors were encountered: