Prodataset: Add-buffer method.

Posted by Admin on 19-May-2009 09:14

HI  All,

   I am trying to create an dynamic prodataset program in client/server mode.

   I pass dataset as input-output dataset-handle, at server side

   I just use ADD-BUFFER method of prodataset.code is

---------------------------------------

some code here

-----------------

  CREATE DATASET hdataset.
CREATE TEMP-TABLE hTemptable.
hTempTable:CREATE-LIKE("customer").
CREATE DATA-SOURCE hDataSource.
CREATE BUFFER hbuffer FOR TABLE ictable.

htemptable:ADD-FIELDS-FROM(hbuffer).

hDataset:ADD-BUFFER(htemptable).
CREATE QUERY hquery.
  hquery:ADD-BUFFER(hbuffer).
   hquery:QUERY-PREPARE("for each " + icTable).
   hDatasource:QUERY = hquery.
   hDataSource:ADD-SOURCE-BUFFER(hbuffer,"").
   hdataset:GET-BUFFER-HANDLE(1):Attach-data-source(hDataSource).
   BUFFER ttcust:BATCH-SIZE = 20.
   IF inrowid <> ? THEN
       hdatasource:RESTART-ROWID = inrowid.
   hdataset:FILL().

-----------------------

some code

-----------------------

when I try to  run this program

ADD/SET-BUFFERS argument 1 was invalid or not found. (7319).

but it works proper when I use

hDataset:ADD-BUFFER(buffer ttcust:handle).

where ttcust is static temptable.

Please suggest.

Thanks

vishwdeep

All Replies

Posted by Tim Kuehn on 19-May-2009 11:28

"add-buffer" is looking for a buffer reference, not a table handle reference - so change your current call to

hDataset:ADD-BUFFER(htemptable:DEFAULT-BUFFER-HANDLE).

and you should be good to go.

Posted by Admin on 20-May-2009 06:44

Thanks Tim.

  Now, Its working.

This thread is closed