So I was wondering why I can't use a LONGCHAR in a TEMP-TABLE.
I have a temp table that has a log value as a field. There is an independent log for each record. Naturally, I would like to use a LONGCHAR here, but I just found out I can't do it. I'll use a CHAR in its place with its 32k limit, but I was just trying to avoid potential future overflow errors.
Hi Ken,
LONGCHAR is a data-type that can only be used for program variables, class members, return types and parameters.
CLOB was provided to store the same data in a DATABASE tables and TEMP-TABLEs.
Cheers,
Ken
instead of longchar , use CLOB
Hi Ken,
LONGCHAR is a data-type that can only be used for program variables, class members, return types and parameters.
CLOB was provided to store the same data in a DATABASE tables and TEMP-TABLEs.
Cheers,
Ken
The question that remains is then: why are there two seemingly identical terms for what - in essence - is the same? Why not let the compiler handle it, allow LONGCHAR as type and convert it behind the scenes to a CLOB.
After all, what is the difference between a LONGCHAR and a CLOB anyway?
Don't know the answer to Patrick's question.
But as a word of warning: LONGCHAR's are passed by value, temp-tables may be passed by reference. So with large Text values this may make a difference in Performance. Unless you pass you own LONGCHAR holder objects around.
or simply use memptr and have fun with malloc (unmanaged resources for .net aficionados)
We don't pass temp-tables as parameters in our system, so that shouldn't be an issue.
According to the documentation, a LONGCHAR is an actual string whereas a CLOB is a pointer to a string.
I suppose its the difference between char[100] and char*
and thanks, but I'll bass on the MEMPTR, lol
Thanks for all your responses