Input output dataset - before table

Posted by gdb390 on 01-Feb-2010 08:45

Hello,

I will try to explain my problem

I have a .p running on appserver (let's call it A.p), two input parameters (dataset handle 1, dataset-handle 2).

A.p runs another procedure (B.p) that takes two datasets (no handles !)

So A.p looks like :


  define input-output parameter dataset-handle hdsContext.                      
  define input-output parameter dataset-handle hdsData.                         


/* some code here */

 

  run B.p (input-output dataset-handle hdsContext, input-output dataset-handle hdsData).

B.p looks like

{common/dos/tt/ettTDOS.i private} 
{common/dos/ds/dstDOS.i private}
{common/gen/tt/ttContext.i    protected}
{common/gen/ds/dsContext.i    protected}
 
define input-output parameter dataset for dsContext.
define input-output parameter dataset for dstDOS.

If I run my code I get the following error :

[10/02/01@14:41:21.541+0100] P-014700 T-015040 1 AS -- (Procedure: 'B.p' Line:0) If INPUT-OUTPUT caller or called temp-table parameter ttTDOS has a BEFORE-TABLE, then both must. (12306)
[10/02/01@14:41:21.541+0100] P-014700 T-015040 1 AS -- (Procedure: 'B.p' Line:0) The caller's temp-table parameter ttTDOS does not match to the target temp-table ttTDOS. (5363)
[10/02/01@14:41:21.541+0100] P-014700 T-015040 1 AS -- (Procedure: 'B.p' Line:0) Parameters for procedure B.p (table ttTDOS and table ttTDOS) do not match. (12311)

The temp-table ttTDOS is defined as following :

define {&1} TEMP-TABLE ttTDOS no-undo before-table ttTDOSBefore

If I suppress the before-table sentence, I don't get an error.  If I make it input parameter, it all works.

Does somebody know what I can do about it ?

kind regards

Gerd


All Replies

Posted by Admin on 01-Feb-2010 15:19

a.p receives the dataset itself and I assume that where it is defined the before-table is not defined.  Ignoring the context dataset the following example works ok where I defined the dataset in a.p.

a.p

define {&1} TEMP-TABLE ttTDOS no-undo before-table ttTDOSBefore

    field field1 as char.

define dataset dstDOS for ttTDOS.

def var hdsData as handle no-undo.

hdsData = dataset dstDOS:handle.

run B.p (input-output dataset-handle hdsData).

b.p
define {&1} TEMP-TABLE ttTDOS no-undo before-table ttTDOSBefore
    field field1 as char.
define dataset dstDOS for ttTDOS.
define input-output parameter dataset for dstDOS.
message 'ok' view-as alert-box.

Posted by gdb390 on 03-Feb-2010 07:13

But I don't want to include the temp-table definition in the procedure A.p.

For the complete understanding : the front-end is ASP.Net, the back-end progress, so the dataset is coming from a ASP.Net Client.

A.p is supposed to be a dispatching procedure : it only takes handles and gives it to a receiving procedure.

The receiving procedure have the complete definitions.

Posted by gdb390 on 04-Feb-2010 04:32

I needed the following in ASP.Net :

Progress.Open4GL.ProDataTable.SetBImageFlag(dsDossier.Tables["ttTDOS"], true);

This thread is closed