Little by little, I'm starting to get stored procedures sorted out, and this is the next step.
I have a process where I feed in a job number, then create an invoice header and the invoice lines. I wrote it first using Alpha to execute the inserts and get the result sets and that works just fine. Now I'm trying to put it in a stored procedure. (never satisfied!)
My problem is I'd like to get the invoice number that was created back out as an output variable. I've been through the WIKI, but once you get beyond State="MA", it doesn't explain things very well.
So far, I've got a stored procedure that I've successfully tested in Navicat that is
create_invoice(IN p_jobno INT, OUT p_invno INT)
and, in Alpha, I'm trying
cnx.open("::name::sda")
argz.add("argJobno",e.rv.session.__protected__jobno)
argz.set("argInvno",0,OutputArgument)
this set statement if probably part of the problem...I've tried several variations using quotes and using the word "as"...the WIKI isn't clear and there's no example... but this is the only version I've found that doesn't give an error.
cnx.execute("call create_invoice(:argJobno,:argInvno)",argz)
This also doesn't give an error, but it also dosn't work.
Next problem is, if this did work, how do I get the value back out of the output variable?
I've tried
crs=cnx.ResultSet
crs.data(1)
but that gives an error
I've also tried
vInvnum=:argInvno
which also gives an error.
I'd appreciate it if anyone could help me with any part of this puzzle.
Thanks,
Pat
I have a process where I feed in a job number, then create an invoice header and the invoice lines. I wrote it first using Alpha to execute the inserts and get the result sets and that works just fine. Now I'm trying to put it in a stored procedure. (never satisfied!)
My problem is I'd like to get the invoice number that was created back out as an output variable. I've been through the WIKI, but once you get beyond State="MA", it doesn't explain things very well.
So far, I've got a stored procedure that I've successfully tested in Navicat that is
create_invoice(IN p_jobno INT, OUT p_invno INT)
and, in Alpha, I'm trying
cnx.open("::name::sda")
argz.add("argJobno",e.rv.session.__protected__jobno)
argz.set("argInvno",0,OutputArgument)
this set statement if probably part of the problem...I've tried several variations using quotes and using the word "as"...the WIKI isn't clear and there's no example... but this is the only version I've found that doesn't give an error.
cnx.execute("call create_invoice(:argJobno,:argInvno)",argz)
This also doesn't give an error, but it also dosn't work.
Next problem is, if this did work, how do I get the value back out of the output variable?
I've tried
crs=cnx.ResultSet
crs.data(1)
but that gives an error
I've also tried
vInvnum=:argInvno
which also gives an error.
I'd appreciate it if anyone could help me with any part of this puzzle.
Thanks,
Pat
Comment