Subject | Re: [IBO] Executing a procedure |
---|---|
Author | yaedos2000 |
Post date | 2004-12-08T18:02:30Z |
One more thing...
I've now got the SQL statement SELECT ID_NUM FROM TEST in a
TIB_Cursor. I'm using the following code to extract the variable:
procedure read_id();
var hacid: string;
begin
IB_Cursor1.APIFirst;
while not IB_Cursor1.EOF do
begin
// Get ID_NUM and store in hacid
IB_Cursor1.Next;
end;
end;
What code should go in the line '// Get ID_NUM...' in order to store
ID_NUM in the string hacid?
I've now got the SQL statement SELECT ID_NUM FROM TEST in a
TIB_Cursor. I'm using the following code to extract the variable:
procedure read_id();
var hacid: string;
begin
IB_Cursor1.APIFirst;
while not IB_Cursor1.EOF do
begin
// Get ID_NUM and store in hacid
IB_Cursor1.Next;
end;
end;
What code should go in the line '// Get ID_NUM...' in order to store
ID_NUM in the string hacid?
> OK thanks
>
> > Hi,
> >
> > At December 8, 2004, 13:03, yaedos2000 wrote:
> >
> >
> >
> > > Hi, I'm using a selectable stored procedure to obtain a list of
> ID
> > > numbers as follows:
> >
> > > SET TERM ^ ;
> >
> > > CREATE PROCEDURE TEST
> > > RETURNS (
> > > ID_NUM VARCHAR(15))
> > > AS
> > > begin
> > > /* Procedure Text */
> > > SELECT HACID FROM TBL_HACS INTO :id_num;
> > > suspend;
> > > end
> > > ^
> >
> > > SET TERM ; ^
> >
> > > Which IB component should I use to execute this procedure, and
> how do
> > > I store the returned results into variables in Delphi 7?
> >
> > First, your stored procedure should look like:
> >
> > SET TERM ^ ;
> >
> > CREATE PROCEDURE TEST
> > RETURNS (
> > ID_NUM VARCHAR(15))
> > AS
> > begin
> > /* Procedure Text */
> > FOR SELECT HACID FROM TBL_HACS INTO :id_num DO
> > suspend;
> > end
> > ^
> >
> > SET TERM ; ^
> >
> >
> > And, then you can use any IBO query component and enter the
> following
> > as the query:
> >
> > SELECT ID_NUM FROM TEST
> >
> > That's all you have to do.
> >
> > --
> > Best regards,
> > Daniel Rail
> > Senior System Engineer
> > ACCRA Group Inc. (www.accra.ca)
> > ACCRA Med Software Inc. (www.filopto.com)