Rajat Sharma
Member
Hello Everyone, hope you all are doing well.
For understanding LONGCHAR and CLOB datatype i am trying one scenario where i want
to store large text file(more then 50kb) into a CLOB field of database table and
later retrieve that field and display in EDITOR.
If LONGCHAR is used to manipulate the values of CLOB field then isn't it work as a pointer or something then why would we directly assign values to it(I am confused).
Thanks & Regards !!!!
For understanding LONGCHAR and CLOB datatype i am trying one scenario where i want
to store large text file(more then 50kb) into a CLOB field of database table and
later retrieve that field and display in EDITOR.
Code:
/*Code that I am trying to fill CLOB field:*/
DEF VAR l-val AS CHAR NO-UNDO . /* Either we should take char or longchar here */
INPUT FROM VALUE("c:\rajat\dynq.txt"). /* FILE SIZE 40 KB */
REPEAT :
IMPORT UNFORMATTED l-val.
CREATE temp. /*DB Table With big as CLOB FIELD*/
DISPLAY l-val.
temp.big = l-val.
END.
INPUT CLOSE.
--------------------------------------------------------------------------------------------------------------------------------
/* Code that I am trying to display values of CLOB field */
DEF VAR l-val1 AS LONGCHAR NO-UNDO.
FOR EACH temp NO-LOCK:
l-val1 = temp.big.
DISPLAY l-val1 VIEW-AS EDITOR LARGE INNER-LINES 300 INNER-CHARS 300
WITH FRAME x1 WIDTH 320.
END.
--------------------------------------------------------------------------------------------------------------------------------
Thanks & Regards !!!!
Last edited by a moderator: