Board index » delphi » How can retrieving a result set with TIBStoredProc

How can retrieving a result set with TIBStoredProc

I want to retrieve all of data in one (or more)column. But when I use
TIBQuery, I don't knew how I can store the returned vule to a text property
such as ComboBox .
that code is :

 with DataModule1.IBQuery2 do Begin
        close;
        with SQL do begin
           clear;
           Add('SELECT * FROM INPUT_COMBO' );
        end;
        unprepare;
//        CItems := ParamByName('pname').AsString;
//        combobox1.Items.Add(CItems);
        prepare;
        open;

and my INPUT_COMBO StoredProc is :

for select pname
from prog
into :pname
do
  suspend;

And when I use this code :

  with datamodule1.IBStoredProc1 do begin
      StoredProcName := 'INPUT_COMBO';
      ExecProc;
      CItems := ParamByName('pname').AsString;
      combobox1.Items.Add(CItems);

I can only see the first record, what should I do that I can see all records
?

Thanks
Babak

 

Re:How can retrieving a result set with TIBStoredProc


IBStoredProc is not for result sets, but for single results.

To access the fields of a result set you should use FieldByName, not
ParamByName.

IBX has its own newsgroup that should be used for IBX questions -
borland.public.delphi.database.interbaseexpress.

Quote
Babak wrote:

> I want to retrieve all of data in one (or more)column. But when I use
> TIBQuery, I don't knew how I can store the returned vule to a text property
> such as ComboBox .
> that code is :

>  with DataModule1.IBQuery2 do Begin
>         close;
>         with SQL do begin
>            clear;
>            Add('SELECT * FROM INPUT_COMBO' );
>         end;
>         unprepare;
> //        CItems := ParamByName('pname').AsString;
> //        combobox1.Items.Add(CItems);
>         prepare;
>         open;

> and my INPUT_COMBO StoredProc is :

> for select pname
> from prog
> into :pname
> do
>   suspend;

> And when I use this code :

>   with datamodule1.IBStoredProc1 do begin
>       StoredProcName := 'INPUT_COMBO';
>       ExecProc;
>       CItems := ParamByName('pname').AsString;
>       combobox1.Items.Add(CItems);

> I can only see the first record, what should I do that I can see all records
> ?

> Thanks
> Babak

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
This sad little lizard told me that he was a brontosaurus on his mother's
side.  I did not laugh; people who boast of ancestry often have little else
to sustain them.  Humoring them costs nothing and adds to happiness in
a world in which happiness is in short supply.   (RAH)

Other Threads