mousemat24
asked on
How to bind variables in Oracle using classic ASP
Hi there
Wonder if you can help me?
I'm using classic ASP (Javascript), I have a function in Oracle, and I want to bind my variables to the SELECT statement.
This is what I have currently
strSQL = "SELECT First_Name, Last_Name, REPLACE(Phone, ' ', '') AS Phone, TCOUNT FROM TABLE(MYPKG.MY_PAGEINATION ('" + last.toUpperCase() + "%', '" + first.toUpperCase() + "%' , NULL, " + start + ", " + end + "))";
How to I get this to work with bidning my variables.
I've done something like this, but not too sure if its correct?
var oCmd = Server.CreateObject("ADODB .Command") ;
oCmd.ActiveConnection = connSt;
var ln1 = oCmd.CreateParameter("P_LA STNAME", 200, 1, 30, last.toUpperCase())
oCmd.Parameters.Append ln1
var fn1 = oCmd.CreateParameter("P_LA STNAME", 200, 1, 30, first.toUpperCase())
oCmd.Parameters.Append fn1
var pn1 = oCmd.CreateParameter("P_PH ONE", 200, 1, 30, "")
oCmd.Parameters.Append pn1
var lo = oCmd.CreateParameter("P_LO WNUM", 200, 1, 30, "")
oCmd.Parameters.Append lo
var hi = oCmd.CreateParameter("P_HI NUM", 200, 1, 30, "")
oCmd.Parameters.Append hi
Thanks
Mousemat24
Wonder if you can help me?
I'm using classic ASP (Javascript), I have a function in Oracle, and I want to bind my variables to the SELECT statement.
This is what I have currently
strSQL = "SELECT First_Name, Last_Name, REPLACE(Phone, ' ', '') AS Phone, TCOUNT FROM TABLE(MYPKG.MY_PAGEINATION
How to I get this to work with bidning my variables.
I've done something like this, but not too sure if its correct?
var oCmd = Server.CreateObject("ADODB
oCmd.ActiveConnection = connSt;
var ln1 = oCmd.CreateParameter("P_LA
oCmd.Parameters.Append ln1
var fn1 = oCmd.CreateParameter("P_LA
oCmd.Parameters.Append fn1
var pn1 = oCmd.CreateParameter("P_PH
oCmd.Parameters.Append pn1
var lo = oCmd.CreateParameter("P_LO
oCmd.Parameters.Append lo
var hi = oCmd.CreateParameter("P_HI
oCmd.Parameters.Append hi
Thanks
Mousemat24
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.