Home » Other » General » ORA-01036
ORA-01036 [message #103254] Wed, 26 March 2003 08:30 Go to next message
Kenneth Mora Flores
Messages: 5
Registered: January 2003
Junior Member
I have the next type definition:

PACKAGE Guias_Aereas IS
type guia_aerea is record (
LII_ID_DOC_AR varchar2(10),
LII_BULTOS_VIG number(10),
LII_PESO_VIG number(10,2),
DII_FECHA_ING date,
LII_CONDICION varchar2(2),
DII_SOBRANTE varchar2(2),
DII_BULTOSSOBRANTE number(10),
DII_PESOSOBRANTE number(10,2),
CAMARA varchar2(1),
LII_NUMLINEADII number(4));
type guia_aerea_ref is ref cursor return guia_aerea;
type guia_aerea_tab is table of guia_aerea index by binary_integer;

procedure query (resultset out guia_aerea_ref, guia_a in out varchar2, resultado out number);
--procedure query (resultset in out guia_aerea_ref);
END;

and I have this store procedure:

PACKAGE BODY Guias_Aereas IS
procedure query (resultset out guia_aerea_ref, guia_a in out varchar2, resultado out number) is
--procedure query (resultset in out guia_aerea_ref ) is
begin
open resultset for
select l.lii_id_doc_ar, l.lii_bultos_vig, l.lii_peso_vig,
d.dii_fecha_ing, l.lii_condicion, '' DII_SOBRANTE,
9999 DII_BULTOSSOBRANTE, 9999.99 DII_PESOSOBRANTE,
decode(l.lii_bultos_refr+l.lii_bultos_cong, 0,'2','1') camara,
l.lii_numlineadii
from inveleste.ia_lii l, inveleste.ia_dii d
where l.lii_id_doc = guia_a and
d.dii_id_doc = guia_a and
l.lii_id_doc = d.dii_id_doc;
resultado := 1;
exception
when no_data_found then
resultado := 0;
--null;
end;
END;

I try to execute the store procedure using visual basic, I'm not sure if I'm doing it right. The code is:

Option Explicit
Dim con As ADODB.Connection
Public HileraConexion As String

Private Sub Form_Load()
HileraConexion = "FILE NAME=" & App.Path & "..DLLDLL MAIVRMA.udl"
Set con = New ADODB.Connection
con.CursorLocation = adUseClient
con.Open HileraConexion
End Sub

Private Sub Command1_Click()
Dim param1 As ADODB.Parameter
Set param1 = New ADODB.Parameter

Dim param2 As ADODB.Parameter
Set param2 = New ADODB.Parameter

Dim param3 As ADODB.Parameter
Set param3 = New ADODB.Parameter

Dim cmd As ADODB.Command
Set cmd = New ADODB.Command

Dim i As ADODB.Recordset
Set i = New ADODB.Recordset

cmd.CommandType = adCmdStoredProc
cmd.CommandText = "INVELESTE.GUIAS_AEREAS.QUERY"
cmd.ActiveConnection = con

Set param1 = cmd.CreateParameter("resultset", adIUnknown, adParamOutput, 0)
cmd.Parameters.Append param1

Set param2 = cmd.CreateParameter("guia_a", adVarChar, adParamInputOutput, 10, Text1.Text)
cmd.Parameters.Append param2

Set param3 = cmd.CreateParameter("resultado", adVarChar, adParamOutput, 2)
cmd.Parameters.Append param3

Set i = cmd.Execute
MsgBox i.Fields(0).Value
End Sub

Anyway, when I execute the command I get this oracle error:

Run-time error '-2147467259 (80004005)':

ORA-01036: número/nombre de variable no válido

Can anybody tell me what I'm doing wrong?

Thanks
Kenneth Mora Flores
Costa Rica
Re: ORA-01036 [message #152851 is a reply to message #103254] Tue, 27 December 2005 04:33 Go to previous message
byoliver
Messages: 1
Registered: December 2005
Location: Austria
Junior Member
Hi

It's not necessary to add the parameter for the recordset!

byoliver
Previous Topic: Calculations troubles in Oracle 8
Next Topic: difference between 8i and 9i
Goto Forum:
  


Current Time: Sat Nov 23 02:39:30 CST 2024