Subject | RE: [IBO] How getting Results from StoredProcedure |
---|---|
Author | Norman Dunbar |
Post date | 2002-01-18T14:36:58Z |
I think you have to :
unprepare prINVIN before setting the parameters
prepare ity after setting them
call ExecSQL as opposed to ExecProc
as in :
with prINVIN do
begin
StoredProcName := 'INV_IN';
if Prepared then Unprepare;
Params[0].AsString := edINVNR.Text;
Params[1].AsInteger := PSNR;
Prepare;
ExecSQL;
TEST := Fields[0].AsString;
end;
At least, that's what Helen told me way back when I was doing the Delphi to
C++ conversions for the GSG.
HTH
Regards,
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Gerhard J. Schober @ DEVCON.LI [mailto:gjschober@...]
Sent: Friday, January 18, 2002 2:37 PM
To: IBObjects@yahoogroups.com
Subject: AW: [IBO] How getting Results from StoredProcedure
Norman, thanks for your help.
... but my value of Fields[0] is blank, should be '1'.
See my code sample:
procedure TfrmINV.SpeedButton1Click(Sender: TObject);
var
TEST : String;
PSNR : Integer;
begin
PSNR := qrPS.FieldByName('PSNR').AsInteger;
with prINVIN do
begin
StoredProcName := 'INV_IN';
Prepared := True;
Params[0].AsString := edINVNR.Text;
Params[1].AsInteger := PSNR;
ExecProc;
TEST := prINVIN.Fields[0].AsString;
end;
// TEST := prINVIN.Fields[0].AsString;
StaticText1.Caption := TEST;
end;
... or need I an other way to read the Fields[0] value ?
Gerhard
-----Ursprungliche Nachricht-----
Von: Norman Dunbar [mailto:norman.dunbar@...]
Gesendet: Freitag, 18. Januar 2002 14:52
An: 'IBObjects@yahoogroups.com'
Betreff: RE: [IBO] How getting Results from StoredProcedure
Gerhard,
storedProc.Fields[0].AsString where stored proc is the name of your stored
proc (on the form) which will be an IB_StoredProc component.
Regards,
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Gerhard J. Schober @ DEVCON.LI [mailto:gjschober@...]
Sent: Friday, January 18, 2002 1:50 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] How getting Results from StoredProcedure
Hi,
I have a very simple question:
How can I get some results from a StoredProcedure ?
<SNIP>
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee
you
must not read it and must not use any information contained in it, nor
copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee you
must not read it and must not use any information contained in it, nor copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.
unprepare prINVIN before setting the parameters
prepare ity after setting them
call ExecSQL as opposed to ExecProc
as in :
with prINVIN do
begin
StoredProcName := 'INV_IN';
if Prepared then Unprepare;
Params[0].AsString := edINVNR.Text;
Params[1].AsInteger := PSNR;
Prepare;
ExecSQL;
TEST := Fields[0].AsString;
end;
At least, that's what Helen told me way back when I was doing the Delphi to
C++ conversions for the GSG.
HTH
Regards,
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Gerhard J. Schober @ DEVCON.LI [mailto:gjschober@...]
Sent: Friday, January 18, 2002 2:37 PM
To: IBObjects@yahoogroups.com
Subject: AW: [IBO] How getting Results from StoredProcedure
Norman, thanks for your help.
... but my value of Fields[0] is blank, should be '1'.
See my code sample:
procedure TfrmINV.SpeedButton1Click(Sender: TObject);
var
TEST : String;
PSNR : Integer;
begin
PSNR := qrPS.FieldByName('PSNR').AsInteger;
with prINVIN do
begin
StoredProcName := 'INV_IN';
Prepared := True;
Params[0].AsString := edINVNR.Text;
Params[1].AsInteger := PSNR;
ExecProc;
TEST := prINVIN.Fields[0].AsString;
end;
// TEST := prINVIN.Fields[0].AsString;
StaticText1.Caption := TEST;
end;
... or need I an other way to read the Fields[0] value ?
Gerhard
-----Ursprungliche Nachricht-----
Von: Norman Dunbar [mailto:norman.dunbar@...]
Gesendet: Freitag, 18. Januar 2002 14:52
An: 'IBObjects@yahoogroups.com'
Betreff: RE: [IBO] How getting Results from StoredProcedure
Gerhard,
storedProc.Fields[0].AsString where stored proc is the name of your stored
proc (on the form) which will be an IB_StoredProc component.
Regards,
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Gerhard J. Schober @ DEVCON.LI [mailto:gjschober@...]
Sent: Friday, January 18, 2002 1:50 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] How getting Results from StoredProcedure
Hi,
I have a very simple question:
How can I get some results from a StoredProcedure ?
<SNIP>
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee
you
must not read it and must not use any information contained in it, nor
copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee you
must not read it and must not use any information contained in it, nor copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.