Page 1 of 1

Using a Function In The Insert Statement

Posted: Mon Jun 02, 2014 10:04 pm
by jerome_rajan
Hi,

We have an Oracle stage with a custom insert SQL. To fulfill some requirements, we are modifying the insert to include a function so that my insert will look something like :

Code: Select all

INSERT INTO XYZ_EDI_852_DLY_FACT 
(EDI_SNDR_KEY,......,BU_CODE,OPER_WK_END_DT) VALUES (:1,...., GET_BU_CODE_X(:11,:2),GET_WK_CLS_DT(:2) );
As can be seen, one of the functions takes 2 parameters and I have no clue how to escape the comma between both these parameters.

Help appreciated.

Posted: Tue Jun 03, 2014 6:58 am
by chulett
Are you sure you need to escape it at all? Are you getting a syntax or runtime error that you can share? If for some reason that approach isn't manageable, you could use the function in a lookup / select before the insert so that you just have a 'normal' value to insert in the target. Or perhaps even in the source SQL itself if applicable.

Posted: Tue Jun 03, 2014 7:45 am
by jerome_rajan
Thanks Craig.
The error I was getting was because of incorrect bind variables and not because of the comma. Got through it. Thank you