I know how to send Oracle queries in with parameters but I am having trouble with a few particularly sticky ones involving Sequences and Sysdate.
What I want to do is send a record in with an insert statement and then turn around and get the sequence number that was applied to it. I can get this done with SQL text strings like so:
Record goes in
Sequence comes out:
But parameterizing this hasnt been trivial. I keep getting errors about bad data values. I realize that I could substitute .NETs Now for Oracles SYSDATE but I shouldnt have to and one is client time and the other is server time.
Any suggestions?
What I want to do is send a record in with an insert statement and then turn around and get the sequence number that was applied to it. I can get this done with SQL text strings like so:
Record goes in
PHP:
strRequestInsert = "INSERT INTO aTable (REQUESTID, REQUESTSTARTDATE, REQUESTPP, REQUESTUSER," & _
" REQUESTCOMPLETED) VALUES (VIZ_REQUEST_SEQ.NEXTVAL, SYSDATE," & PPMS & ", " & strUser & ", N)"
Sequence comes out:
PHP:
strRequestID = "SELECT VIZ_REQUEST_SEQ.CURRVAL from aTable"
But parameterizing this hasnt been trivial. I keep getting errors about bad data values. I realize that I could substitute .NETs Now for Oracles SYSDATE but I shouldnt have to and one is client time and the other is server time.
Any suggestions?