Static temp-tables and create buffer statement

greuceanu

New Member
If have an external procedure with a temp-table, and, inside an internal procedure, I create a buffer for this temp-table using the create buffer statement. It crashes with the error:
Could not create buffer object for table TT. (7334)

However, the same piece of code runs perfectly in the external procedure's block.

Does anyone have an explanation for this strange behavior?
Thanks...

The code...

def temp-table tt no-undo
field f1 as int
field f2 as char

index idxF1 is Primary Unique
f1.

def var h as handle no-undo.

create buffer h for table 'tt':U.

message valid-handle(h).

run p.

procedure p:

def var h as handle no-undo.

create buffer h for table 'tt':U.

message valid-handle(h).

end procedure.
 

greuceanu

New Member
It looks like I'm talking to myself here...

I just spoke to a guy from Progress. Apparently, this is not a bug! It is a normal behavior: the internal procedure doesn't have access to the default-buffer-handle of the static temp-table. At least, this is what the guy said.

To me this is still a striking inconsistency in the way Progress handles the create buffer statement in regard with static temp-tables. If I would define a buffer variable for the temp-table inside an internal procedure, then that should fail too?!?


P.S.
I'm sorry for my displeasing English...
 

Serj HAMMER

Junior Racer
SOME TIMES create buffer worked ok

Hello greuceanu and everybody.

No. If You would define a buffer variable for the temp-table inside an internal procedure, then it should work ok. But tell me please, why do not work CREATE BUFFER? if You see table at DEFINE statement then You must see it at CREATE statement. Is it not?

I have the same situation in persistent procedure:

<TT>RUN p PERSISTENT SET pHdl.
DEFINE TEMP-TABLE tt...
RUN p-proc IN pHdl.</TT>

file p:
--------------------------------------------------------------
<TT>RETURN.

procedure p-proc:
def var lHdl as handle.
def var lQry as handle.
def var lFlag as logical.

CREATE QUERY lQry.
CREATE BUFFER lHdl FOR TABLE 'tt' NO-ERROR.
IF ERROR-STATUS:ERROR THEN lFlag = lQry:SET-BUFFERS('tt') NO-ERROR.
ELSE lFlag = lQry:SET-BUFFERS(lHdl) NO-ERROR.

end procedure.</TT>
--------------------------------------------------------------

Inside p-proc I never have valid handle <TT>lHdl</TT>. Because
from p-proc I shold not see static temp-table 'tt' and I don't see it. But SET-BUFFERS worked when I use temp-table name. BUT ONLY SOME TIMES.

Did You or anybody know, why it is worked and WHY ONLY SOME TIMES?
 
Top