dbTalk Databases Forums  

Call Oracle procedure with variables (D5)

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Call Oracle procedure with variables (D5) in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jodleren
 
Posts: n/a

Default Call Oracle procedure with variables (D5) - 12-09-2010 , 04:21 AM






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

Reply With Quote
  #2  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Call Oracle procedure with variables (D5) - 12-09-2010 , 02:22 PM






On 12/09/2010 11:21 AM, jodleren wrote:
Quote:
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?
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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.