• stored procedures - Oracle

    By toome bady 2 decades ago

    I made an agent which help me to be connected to an Oracle base by Lotus Connectors’s Class, I must call some stored procedures, I found a code on the help of IBM, but I don’t understood it, especially the bond between a stored procedure and objects LCField and LCFieldList, I do not see how managing that?? which field is necessary to put in LCField? is this the fields parameters of stocred procedures? or a fields of a table? short if some one can help me they is sympathetic.



    this is the code : **

    [Options]

    Option Public

    Option Explicit

    Uselsx "
    lsxlc"



    [Initialize]

    Sub Initialize

    Dim sess As New LCSession

    Dim conn As New LCConnection ("oracle8")



    'set the connection parameters…

    conn.Server = "servername"

    conn.UserId = "userid"

    conn.Password = "password"



    'connect to the database…

    conn.Connect



    'set the stored procedure owner and stored procedure name…

    conn.Owner = "OWNER"

    conn.Procedure = "PARM_PROC"



    'set Fieldnames property with any output parameters declared in

    the stored procedure…

    conn.Fieldnames = "OUT1, OUT2"



    'declare any fields and fieldlists for input/output data…

    Dim input_fieldlist As New LCFieldList

    Dim output_parms As New LCFieldlist

    Dim in_field_int As New LCField (1, LCTYPE_INT)

    Dim in_field_text As New LCField (1, LCTYPE_TEXT)

    Dim out1 As New LCField (1, LCTYPE_INT)

    Dim out2 As New LCField (1, LCTYPE_TEXT)

    Dim out As Double



    'set the input parameters of the stored procedure…

    Set in_field_int = input_fieldlist.Append ("IN1", LCTYPE_INT)

    in_field_int.Value = 123



    Set in_field_text = input_fieldlist.Append ("IN2", LCTYPE_TEXT)

    in_field_text.Text = "input"



    'with the input parameters set, call the stored procedure…

    'the declared output_parms fieldlist will hold the output parameters

    of the stored procedure…

    out = conn.Call (input_fieldlist, 1, output_parms)

    'fetch parameter(s) into the output_parms fieldlist…

    out = conn.Fetch (output_parms)



    'retrieve the parameter(s) from the output_parms fieldlist…

    Set out1 = output_parms.GetField (1)

    Set out2 = output_parms.GetField (2)



    'use the output parameter value(s) in your script…

    Print "Output parameter 1 is " & out1.Value(0)

    Print "Output parameter 2 is " & out2.Text(0)



    conn.Disconnect



    End Sub

    • Wrong place to post

      By Marko Bonaci 2 decades ago

      You posted your question in my project's workspace which only I have seen (probably).

      The right place to post your question is

      http://www.openntf.org/mainbar.nsf/



      or better if you're in a hurry:

      http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/



      or Newsgroup: comp.groupware.lotus-notes.programmer.



      I would like to help you but have no experience with Oracle nor with coding LC connections.

      Please notify me (by empty response) that you have read this, so that I can delete your question and this answer.



      Regards,

      Marko Bonaci

      PCLP Application developer