Oracle Parameter bound problem: ORA-01008: not all variables bound

G

Guest

my sql is below :
=================================================
DECLARE
TEMP_VAR1 VARCHAR2(32767);
TEMP_VAR2 VARCHAR2(32767);
BEGIN "
/*P1,P2 are input param ,P3,P4 are out param*/"
PackageName.Storeprocedurename(P1=>:p1,P2=>P2,P3=>:p3,P4=>:p4);
/* I do some other calc for TEMP_VAR1 and TEMP_VAR2; */
:p3:=TEMP_VAR1 -- set P4
:p4:=TEMP_VAR2 -- set P4
END;
===================================================

Dim cmd1 As OleDbCommand = New OleDbCommand(sql, conn1)
cmd1.CommandType = CommandType.Text

Dim p1 As OleDbParameter = New OleDbParameter("P1", OleDbType.VarChar, 100,
ParameterDirection.Input)
Dim p2 As OleDbParameter = New OleDbParameter("P2", OleDbType.VarChar, 100,
ParameterDirection.Input)
Dim p1 As OleDbParameter = New OleDbParameter("P3", OleDbType.VarChar, 100,
ParameterDirection.Output)
Dim p2 As OleDbParameter = New OleDbParameter("P4", OleDbType.VarChar, 100,
ParameterDirection.Output)

cmd1.ExecuteNonQuery

i got this error
**ORA-01008: not all variables bound**

'cause I have no right to change the store procedure
so I try to use PL/SQL to Change my output param values with
TEMP_VAR1,TEMP_VAR2,
the TEMP_VAR1,TEMP_VAR2 are the real values I want!!

anybody can help me ?
 
G

Guest

After I change to use
1.System.Data.OracleClient and
replace the statement
PackageName.Storeprocedurename:)P1,:p2,:p3,:p4);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top