Call Oracle procedure with variables (D5)

16 views
Skip to first unread message

jodleren

unread,
Dec 9, 2010, 5:21:24 AM12/9/10
to
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

Robert Klemme

unread,
Dec 9, 2010, 3:22:06 PM12/9/10
to

I dunno Delphy but are you sure you can use Add to add text to a single
SQL statement? Maybe it's the batch interface and the driver thinks
he's seeing a whole bunch of malformed statements. For the block to
work it must be seen as a single SQL statement by Oracle.

Cheers

robert

F'Up to comp.lang.pascal.delphi.databases

Mark D Powell

unread,
Dec 10, 2010, 9:47:57 AM12/10/10
to
> F'Up to comp.lang.pascal.delphi.databases- Hide quoted text -
>
> - Show quoted text -

I do not know Delpi either and my web search turned up a lot of hits
that I really cannot judge but here are two links that may help:


Using Stored Procedures with Delphi and InterBase

http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_using_sps


Delphi ADO - calling stored procedures with params

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20807225.html

HTH -- Mark D Powell --

Reply all
Reply to author
Forward
0 new messages