Re: OIP-04122: Bind variable not fully enabled
Date: Tue, 09 Sep 2003 18:17:51 -0400
Message-ID: <3350208.1063145871_at_dbforums.com>
El problema es por la declaracion de las variables ya que el formato es el siguiente:
Const OK = 0
Const ERROR = 32767
const ORATYPE_VARCHAR2=1
const ORATYPE_NUMBER=2
const ORATYPE_SINT=3
const ORATYPE_FLOAT=4
const ORATYPE_STRING=5
const ORATYPE_VARCHAR=9
const ORATYPE_DATE=12
const ORATYPE_UINT=68
const ORATYPE_CHAR=96
const ORATYPE_CHARZ=97
const ORAPARM_INPUT=1
const ORAPARM_OUTPUT=2
const ORAPARM_BOTH=3
primero las tienes que declarar y despues ya puedes usar la adicion de parametros de la siguiente forma:
Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")
Set EmpDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)
empDb.Parameters.Add "DEPTNO", 10, ORAPARM_INPUT
empDb.Parameters("DEPTNO").ServerType = ORATYPE_NUMBER
empDb.Parameters.Add "DNAME", 0, ORAPARM_OUTPUT
empDb.Parameters("DNAME").ServerType = ORATYPE_VARCHAR2
empDb.Parameters.Add "DLOC", 0, ORAPARM_OUTPUT
empDb.Parameters("DLOC").ServerType = ORATYPE_VARCHAR2
Set PlSqlStmt = empDb.CreateSQL("Begin Department.GetDeptname
(:DEPTNO, :DNAME, :DLOC); end;", 0&)
'Display Department name and location
MsgBox empDb.Parameters("DNAME").Value &
empDb.Parameters("DLOC").Value
Donde CreateSQL recibe los siguientes parametros
Set orasqlstmt = oradatabase.CreateSQL(sql_statement, options)
y options las puedes encontrar en el archivo ORACONST.txt en el directorio donde tengas instalado el OO40
y son las siguientes:
Constant Value
Description
ORASQL_NO_AUTOBIND &H1& Do not perform automatic binding of database parameters.
ORASQL_FAILEXEC &H2& Raise error and do not create SQL statement object.
ORASQL_NONBLK &H4& To execute SQL in nonblocking state
-- Posted via http://dbforums.comReceived on Wed Sep 10 2003 - 00:17:51 CEST