2014-07-10 108 views
0

我试图使用LSXLC(ODBC连接器)连接到Oracle RDB数据库。 但是,当涉及到存储过程时,我很难让它正常工作。 下面的代码总是会导致“错误:未提供参数名称:fnl_date,连接器'odbc2',Method -Call-”。 “count = connection.Call(输入,1,结果)”触发错误“ 任何人都可以告诉我我做错了什么?LSXLC ODBC存储过程

Public Function testLsxlcProc() 
    On Error GoTo handleError 

    Dim connection As LCConnection("odbc2") 
    connection.Server = "source"         
    connection.Userid = "userid"          
    connection.Password = "password" 
    connection.procedure = "proc_name" 
    connection.Connect 

    If connection.IsConnected Then 
     Dim input As New LCFieldList() 
     Dim result As New LCFieldList() 

     Dim break As LCField 
     Set break = input.Append("fnl_date", LCTYPE_TEXT) 
     break.Text = "2014-07-01" 
     Dim agrNo As LCField 
     Set agrNo = input.Append("fnl_agreement_no", LCTYPE_TEXT) 
     agrNo.Text = "123456" 
     Dim curr As LCField 
     Set curr = input.Append("fnl_currency_code", LCTYPE_TEXT) 
     curr.Text = "SEK" 
     Dim stock As LCField 
     Set stock = input.Append("fnl_stock_id", LCTYPE_TEXT) 
     stock.Text = "01" 

     connection.Fieldnames = "status, value" 
     Dim count As Integer 
     count = connection.Call(input, 1, result) 
     Call logger.debug("Count: " & count) 
    Else 
     Error 2000, "Unable to connect to database." 
    End If 

handleExit: 
    connection.Disconnect 
Exit Function 
handleError: 
    On Error Resume Next 
    Call logger.error(Nothing) 
    Resume handleExit 
End Function 

在此先感谢!

回答

0

我犯了一个愚蠢的错误,并且在Domino中输入参数的名称与存储过程中输入参数的名称不匹配。 确保所有名称匹配,并且应该没有问题。

0

存储过程 “mylib.MyStoredProc” wird aufgerufen ... LcSession.Status = 12325:LC-错误:errCallStoredProc 12325(错误:参数名称没有提供:P_S651_AC,连接器 'odbc2',方法-Call-)

解决方案:将“mylib”改为“MYLIB”,一切正常。

不仅检查参数名称,还检查搜索路径。