This is a fallback script for a delete script i am running. Here is the query i am using to generate the insert statements.
select 'insert into remark_element(ELEMENTID,
REMARKID,
VALUE,
POSITION,
INFO_TYPE,
SCRIPTID)
values('||elementid||',
'||remarkid||',
'''||nvl(value,'null')||''',
'||position||',
'||nvl(info_type,null)||',
'||nvl(scriptid,null)||''||')'
from remark_element
where elementid in(....
This is the result of that query:
insert into remark_element(ELEMENTID,
REMARKID,
VALUE,
POSITION,
INFO_TYPE,
SCRIPTID)
values(29650520,
20263860,
'0/877-426-6251-A',
1,,);
running this gives ORA-00936: missing expression because of the empty info_type and scriptid, fields, which are both numbers and are allowed to be nullable. i need the generated query to say
insert into remark_element(ELEMENTID,
REMARKID,
VALUE,
POSITION,
INFO_TYPE,
SCRIPTID)
values(29650520,
20263860,
'0/877-426-6251-A',
1,
null,
null);
when info_type and scriptid are null. i have tried doing nvl(info_type,'null') but get ORA-01722: invalid number for trying to put a string into a number field. how can i manipulate this to return as null instead of ,, when the info_type or scriptid is null