Board index » delphi » Huge problem with Delphi 2.0 and SQL 6.5 Stored procedures

Huge problem with Delphi 2.0 and SQL 6.5 Stored procedures

Hi

I'm having a huge problem with Delphi 2.0 C/S and SQL 6.5 Stored
procedures called via TQuery.

I have a stored procedure for testing called bah.
Here's the source:

CREATE PROCEDURE bah
AS
declare @res int, @key int
select @res = 1
select @key = 2
select @res 'result', @key 'key'

If I call the stored procedure from Explorer (in the Enter SQL window)
there's no problem at all.

But when I try to call the stored procedure like this:

    qerTransferWork.SQL.Add('Parser..bah');
    try
      qerTransferWork.ExecSQL;
      if qerTransferWork.ParamByName('result').AsInteger = 0 then
        Key := qerTransferWork.ParamByName('key').AsInteger
      else begin
        // an error occured
        Key := -1;
      end; // if
    finally
      qerTransferWork.Close;
      qerTransferWork.SQL.Clear;
    end; // try

I get an error claiming there's no such field as result. I've tried to
use Open instead of ExecSQL and tried FieldByName instead of
ParamByName (and the combinations of those) without any luck.
And it have to be done with a TQuery.

I could really need some help on this...

Stay tuned
Anders Gregersen / CD-Danmark

 

Re:Huge problem with Delphi 2.0 and SQL 6.5 Stored procedures


Anders,

try linking the storedproc component to a datasource and the datasource to
a dbgrid and look at
exactly what it is returning to you

Vic Ambruso
vict...@guard.com

Anders Gregersen <a...@cddk.dk> wrote in article
<3288ca0c.1173...@news.uni-c.dk>...

Quote
> Hi

> I'm having a huge problem with Delphi 2.0 C/S and SQL 6.5 Stored
> procedures called via TQuery.

(rest deleted)

Other Threads