Clarification required reg TEMP-TABLE

Hi Everybody,
Why is that a TEMP-TABLE can't be created in an Internal Procedure??? Is there any specific reason? Can anyone please explain on this issue...

Error:
-----
You cannot define a TEMP-TABLE inside an internal procedure. (3355)
Can anyone please help me out in this regard? Thanks in advance.
 
Saravankumar,
Thanks for the posting.Could you please tell me why you need to define an temp-table with in an internal procedure.

Simple answer is Progress architecure is like that

If you follow the structural guidelines for a procedure file, you place all your internal procedures at the end of the file.
The Progress compiler needs to understand how to treat your Temp-table when it encounters it in the executable code. In particular, it needs to know the data type of the fields.

Btw for the last 10 years I never ever thought of defining a temp-table in an internal procedure . All the requirements are fulfilled with as it is strucutred at Definition Block
icon7.gif


Regards
Philip P Oommen
 
This is in addition to Philip's reply.

The R-Code structure is designed to have only one "initial Value" segment per r-code file and this segment contains information required to initialize an r-code file for execution, including database and table references, variable definitions, TEMP-TABLE and WORK-TABLE definitions, a list of defined frames, CRCs, and time stamps.

Each internal procedure gets only an "action code" segment which cannot provide for TEMP-TABLE definition.

Hope this helps.
 
Thanks a lot for your valuable information. I still need more stuffs regarding this. I am not fully satisfied with this explanation. I need some clarifications regarding your post. Correct me if i am wrong at any instance.

Hi philippoommen1,
If you follow the structural guidelines for a procedure file, you place all your internal procedures at the end of the file.
The Progress compiler needs to understand how to treat your Temp-table when it encounters it in the executable code. In particular, it needs to know the data type of the fields.

Agreed. If this is the case then the same should prevail for variable definition as well. Am i right??? But i don't get the same error for variable definitions within an Internal Procedure. Even if it is a Procedure oriented still Internal Procedures are not dynamic. Then why is this case persists???


Hi Joel W Winston,
Nice to see such answers. Hope u mean to say that R-Code features are so. Am i right???

Each internal procedure gets only an "action code" segment which cannot provide for TEMP-TABLE definition.

Fine . Then can you please provide more stuffs on this point. I don't get u exactly. What does this action code segment has. Is it that it has configurations such that only variables can be defined. Do u mean to convey this msg? Correct me if i am wrong.

Thanks in advance...
 
In one sense the "why" is fairly simple - Progress has decided that that is the way that it is.

I seriously doubt that it will be changed but you could try submitting an enhancement request.

If you really need to do this (as opposed to this just being idle curiosity about syntax with no actual requirement behind it) then you might want to explore the use of CREATE TEMP-TABLE rather than DEFINE TEMP-TABLE.
 
Actually here we are fully dynamic. I am using CREATE statement for couple of years. I know it can be done using CREATE statement or by passing the same as an input parameter (..lot of other ways too).

But to my curiosity, i couldn't ping point the exact reason for this error (Error No:3355). So i was curious to know the actual reason behind this.


Ya Thanks for ur valuable information Mr.TomBascom.
 
Back
Top