1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Oip-04122 bind variable fully not enabled

Discussion in 'Oracle Forms and Reports' started by Ballingam, Oct 19, 2015.

  1. Ballingam

    Ballingam Starter

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    hyderabad
    i am facing issue (OIP-04122 Bind Variable not fully Enabled) in below code

    Public Function WriteGAMS(usrid As String _
    , transid As String _
    , path As String _
    , modeltype As String _
    , status As String _
    ) As String

    Dim OraSession As Object 'Declare variables as OLE Objects
    Dim OraDatabase As Object
    Dim OraDynaset As Object

    userid = ThisWorkbook.Sheets("Connection").Range("B3").value
    Pwd = ThisWorkbook.Sheets("Connection").Range("B4").value
    Server = ThisWorkbook.Sheets("Connection").Range("B5").value

    'create session
    Set OraSession = CreateObject("OracleInProcServer.XOraSession")
    Set OraDatabase = OraSession.OpenDatabase(Server, userid & "/" & Pwd, 0)


    OraDatabase.Parameters.Add "usrid", usrid, Oraparm_input
    OraDatabase.Parameters("usrid").ServerType = ORATYPE_VARCHAR2

    OraDatabase.Parameters.Add "transid", transid, Oraparm_input
    OraDatabase.Parameters("transid").ServerType = ORATYPE_VARCHAR2

    OraDatabase.Parameters.Add "path", path, Oraparm_input
    OraDatabase.Parameters("path").ServerType = ORATYPE_VARCHAR2

    OraDatabase.Parameters.Add "modeltype", modeltype, Oraparm_input
    OraDatabase.Parameters("modeltype").ServerType = ORATYPE_VARCHAR2

    OraDatabase.Parameters.Add "status", 0, Oraparm_output
    OraDatabase.Parameters("status").ServerType = ORATYPE_VARCHAR2


    Set OraSQLStmt = OraDatabase.CreateSql("begin mm_gams_pck.to_write_gams:)usrid,:transid,:path,:modeltype,:status); end;", ORASQL_FAILEXEC)

    WriteGAMS = OraDatabase.Parameters("status").value 'OrderDynaset(0) 'returns status output

    If WriteGAMS = 0 Then
    Call ClobReading(usrid, transid, path)
    Else
    MsgBox "GAMS File Not Created ", vbOKOnly
    End If

    Set OraDynaset = Nothing
    Set OraSession = Nothing
    OraDatabase.Close
    Set OraDatabase = Nothing

    End Function

    Enivironment:MS Office 2013,
    Oracle 11g
     
    Last edited: Oct 20, 2015
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    Why do you use the ORATYPE_VARCHAR2 type for variable STATUS , but the OraClob type?