CREATE BUFFER generates an error 11884

Posted by wmurawski on 23-Sep-2011 04:57

Why following code, taken from dvpds.pdf, generates an error 11884?

/* OpenEdge Release 10.2B03 */

DEFINE TEMP-TABLE ttSalesRep
    FIELD RepCode AS CHARACTER FORMAT "x(4)"
    FIELD RepName AS CHARACTER FORMAT "x(20)"
    FIELD Region AS CHARACTER FORMAT "x(12)"
    FIELD AnnualQuota AS DECIMAL
    FIELD TotalBalance AS DECIMAL
    INDEX RepCode IS UNIQUE RepCode.

/*DEFINE TEMP-TABLE ttState LIKE State.*/
DEFINE TEMP-TABLE ttState
    FIELD State AS CHARACTER FORMAT "x(20)"
    FIELD StateName AS CHARACTER FORMAT "x(20)"
    FIELD Region AS CHARACTER FORMAT "x(8)"
    INDEX State IS UNIQUE State.

DEFINE VARIABLE hCodeSet AS HANDLE NO-UNDO.
RUN fetchCodeTables(INPUT "ttSalesRep,ttState",
                    OUTPUT DATASET-HANDLE hCodeSet).
  
/*--------------------------------------------------*/  
PROCEDURE fetchCodeTables:
DEFINE INPUT PARAMETER pcTables AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER DATASET-HANDLE phDynData.
DEFINE VARIABLE iTable AS INTEGER NO-UNDO.
DEFINE VARIABLE cTable AS CHARACTER NO-UNDO.
DEFINE VARIABLE hTableBuf AS HANDLE NO-UNDO.

CREATE DATASET phDynData.
DO iTable = 1 TO NUM-ENTRIES(pcTables):
    cTable = ENTRY(iTable,pcTables).
    CREATE BUFFER hTableBuf FOR TABLE cTable. /* error 11884 */
    phDynData:ADD-BUFFER(hTableBuf).
END.

END PROCEDURE.

All Replies

Posted by Admin on 23-Sep-2011 10:11

Why following code, taken from dvpds.pdf, generates an error 11884?

It doesn't raise any error for me on 10.2B04 - and I would be very surprised if there was any bug fixed only recently for this. I'm pretty much using ProDatasets since day one.

The error message say:

"Dataset buffer must be for a temp-table. (11884)

You may not add normal database tables to a dataset."

So you should make sure that you didn't become a victim of a typo when you ran into the issue and accidentially passed thre name of a DB table to your procedure.

I added a

MESSAGE hCodeSet:NUM-BUFFERS

VIEW-AS ALERT-BOX INFO BUTTONS OK.

After the RUN fetchCodeTables to verify that the code really completes.

Posted by wmurawski on 26-Sep-2011 05:35

Thanks Mike. It is my fault, of course. The dvpds.pdf manual suggests to use TEMP-DB Maintenance tool with database tables ttSalesRep and ttState.
After disconecting temp-db database CREATE BUFFER works fine. I wonder is it possible to force CREATE BUFFER to interpret cTable variable as a name of temp-table not a

database table or perhaps how to do it completely different but passing a list of tables in pcTables.

This thread is closed