Using a Function In The Insert Statement

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Using a Function In The Insert Statement

Post 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.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post 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
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
Post Reply