Feedback
Did this article resolve your question/issue?

   

Article

Runtime error 12378 when using the BIND option with a temp table

« Go Back

Information

 
TitleRuntime error 12378 when using the BIND option with a temp table
URL Name000041372
Article Number000188142
EnvironmentProduct: OpenEdge
Version: 11.x
OS: All Supported Operating Systems
Other:
Question/Problem Description
Error 12378 and error 91 when using a temp table with the BIND option and calling a procedure multiple times.

The temp table is bound to a remote called procedure with the BIND option, but when the procedure is called multiple times the run time error 12378 is displayed.

The temp table seems to be unbound from the BIND parameter.  For example:
 
/* custom.p */
DEFINE TEMP-TABLE ttTest NO-UNDO REFERENCE-ONLY    
    FIELD test AS CHARACTER    
    INDEX Main IS PRIMARY UNIQUE test.
  
DEFINE DATASET dsTest REFERENCE-ONLY FOR ttTest.

RUN Test.
RUN Test.

PROCEDURE Test:
    DEFINE BUFFER bttTest FOR TEMP-TABLE ttTest.

    Service:Instance:binddsTest(OUTPUT dataset dsTest BIND).
    Service:Instance:fillDataset().
  
    FIND bttTest.
  
    MESSAGE bttTest.test SKIP
    VIEW-AS ALERT-BOX
    TITLE PROGRAM-NAME(1).
END.

 
Steps to Reproduce
Clarifying Information
Error MessageAttempt to reference uninitialized temp-table. (12378)
** No <file-name> record is available. (91)
Defect/Enhancement NumberDefect PSC00260304 / OE00239469
Cause
This problem happens because the local buffer in the sub-procedure does not get re-bound to the BIND parameter on subsequent calls.   The re-binding is needed because the local buffer goes out of scope when the Test procedure ends. 
Resolution
Upgrade to OpenEdge 11.4 or later.
Workaround
There are two ways to work around this problem:

1.  Replace the usage of the local buffer (scoped to the internal procedure) with the temp table default buffer that is scoped to the main procedure block.  For example:
PROCEDURE Test:
    Service:Instance:binddsTest(OUTPUT dataset dsTest BIND).
    Service:Instance:fillDataset().

    FIND ttTest.
  
    MESSAGE ttTest.test SKIP
    VIEW-AS ALERT-BOX
    TITLE PROGRAM-NAME(1).
END.

2.  Move the local buffer definition out of the local procedure to the main block to raise its scope.
Notes
Last Modified Date8/9/2016 3:31 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.