Call Oracle procedure with variables (D5)

From: jodleren <sonnich_at_hot.ee>
Date: Thu, 9 Dec 2010 02:21:24 -0800 (PST)
Message-ID: <22396c80-754c-4fb7-b6d7-e7d87ea87a42_at_c13g2000prc.googlegroups.com>



Hi all

I have tried this, but it fails. I need to call a procedure (it works we do it all the time) with parameters.
The Oracle code works in an SQL editor, now we need to have it in Delphi.
This does not work. Any suggestions?

Sonnich

    ora := TQuery.Create(nil);

    ora.DatabaseName := OraSession1.DatabaseName;
ora.SQL.Text := '';
ora.SQL.Add('declare');
ora.SQL.Add(' inv wise.Vararasto_pack.vctable;');
ora.SQL.Add(' jnumero wise.Vararasto_pack.intTable;');
ora.SQL.Add(' qty wise.Vararasto_pack.floatTable; ');
ora.SQL.Add('begin        ');
ora.SQL.Add(' inv(1) := ''inv'';             ');
ora.SQL.Add(' jnumero(1) := 123546;         ');
ora.SQL.Add(' qty(1) := -2;          ');
ora.SQL.Add(' begin wise.VarastopaikkaSiirrot(inv,jnumero,qty,''I'');
end;');
ora.SQL.Add('end; ');

Field '=' is of unknown type

So I tried:

Using a ora2 := TStoredProc.Create(nil);   ora2.DatabaseName := OraSession1.DatabaseName;

I get : General SQL Error: Syntax Error or access violation

Better, but how do I do this?

Sonnich Received on Thu Dec 09 2010 - 04:21:24 CST

Original text of this message