Pass an array through an Oracle function

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
wvanellis
Newbie
Posts: 3
Joined: Fri May 19, 2017 7:41 pm

Pass an array through an Oracle function

Post by wvanellis » Wed Sep 26, 2018 12:45 pm

Hi All,

I have an Oracle function that uses 4 data elements. I have a file with these four elements that I want to ultimately pass through the function, however, I'm stuck at connecting to the database when using the function.

This connection and query works:


DBConnect>Provider=MSDASQL.1;Password=xxxx;Persist Security Info=True;User ID=xxxx;Data Source=STARPTCH,dbH

DBQuery>dbH,select SPRIDEN_PIDM from SPRIDEN where SPRIDEN_PIDM = '393724',rset,NumRecs,NumFields


However, this connection gives me the "no valid connection" error, yet the "DBConnect" string is identical in both:


DBConnect>Provider=MSDASQL.1;Password=starptch2345;Persist Security Info=True;User ID=u0a6d;Data Source=STARPTCH,dbH

DBExec> dbH, execute baninst1.WVU_OIM_WIDM_PKG.RESET_SSB_ACCT ('393724', 'loadtest2027', '15-JAN-2099', 'U0A6D'), rset,NumRecs,NumFields

//Still get the error whether I use DBExec or DBQurey....


Let>r=0
Repeat>r
Let>r=r+1
Let>f=0
Repeat>f
Let>f=f+1
Let>this_field=rset_%r%_%f%
Message>this_field
Until>f=numFields
Until>r=numRecs

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Pass an array through an Oracle function

Post by Marcus Tettmar » Thu Sep 27, 2018 3:54 pm

You have a bunch of spaces in the DBExec line. It's trying to connect via " dbH " which doesn't exist. Try removing the spaces.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts