Stored Procedures - Oracle

Hi ,i have a very problem for running a stored procedures with lsxlc, it’s a program which I found in documents IBM and which I modified according to my needs, i’m in diffuclty, please HELP !!

Dim sess As New LCSession

Dim s As notessession

Dim db As NotesDataBase

Dim conn As New LCConnection (“oracle8”)

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

Dim input_fieldlist As New LCFieldList

Dim output_parms As New LCFieldlist

Dim out As Double

'set the connection parameters…

conn.Server = "MySERVER"

conn.UserId = "MySERVER"

conn.Password = "MyPW"

'connect to the database…

conn.Connect

’ name of stoerd procedure (PL/SQL),

conn.Procedure = “SP_AVEC_PARAMS”

%rem

there are 2 param output and one param input (select …where…)

stored procedures param’s are the same name as here

p_date : type = date

p_statut : type = TEXT

p_num_ano : type = Integer

%endrem

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

Dim p_num_ano As New LCField (1, LCTYPE_INT)

Dim p_statut As New LCField (1, LCTYPE_TEXT)

Dim p_date As New LCField (1, LCTYPE_DATETIME)

'Dim p_statut As LCField

'Dim p_date As LCField

'set the input parameters of the stored procedure…

’ “NUMERO_ANO” is the name of field input in my dabase

Set p_num_ano = input_fieldlist.Append (“NUM_ANO”, LCTYPE_INT)

p_num_ano.Value = 100

'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 p_statut = output_parms.GetField (2)

Set p_date = output_parms.GetField (1)



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

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

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



conn.Disconnect

end sub

I have an error : type mismatch

HELP

Subject: Stored Procedures - Oracle

I’ve this error :"[ Execute Statement]ORA-06550: Line 1, column 7: Pls-00306: number or types of erroneous arguments in call to ’ SP_AVEC_PARAMS’ Ora-06550: Line 1, column 7: PL/SQL: Statement ignored "

I need that one helps me on the way with which i must call a stored procedure

Any mone can help me ?

Subject: RE: Stored Procedures - Oracle

Check out this tech document:

http://www-1.ibm.com/support/docview.wss?rs=0&q1=odbc+Class&uid=swg21099070&loc=en_US&cs=utf-8&cc=us&lang=en

Subject: RE: Stored Procedures - Oracle

great !! but i’ve this error :

Error: Invalid data type for field ‘P_LISTE_STATUT’, Connector ‘oracle’, Method -Call-

‘P_LISTE_STATUT’ it’s defined in an Oracle package’s like as :

TYPE TYP_TAB_COLLECT IS TABLE OF anomalies%Rowtype ;

And my procedure is defined also :

PROCEDURE SP_COLLECTION_1 (p_num_ano IN ANOMALIES.numero_anomalie%TYPE,

                       p_liste_statut OUT TYP_STATUT_COLLECT,

                       p_nb           OUT Number) 

Help PLEEEZ !!

Subject: RE: Stored Procedures - Oracle

Apologies, I’m not entirely versed in Oracle…but it would seem from the error: Invalid Data Type for Field: ‘P_LISTE_STATUT’

is being collected or instantiated as a type other than what it is in the Oracle table.

Without seeing the Stored Procedure, I would GUESS you need to look at the actual code and see how the second parameter is defined, i.e. p_liste_statut OUT TYP_STATUT_COLLECT, and make sure the p_liste_statut is of the same type as TYP_STATUT_COLLECT (? again totally guessing here)

Stupid question, is the parameter case sensitive?