Dynamic 4GL & text blobs
Posted in 1998
I'm encountering some problems with text blobs when running Dynamic 4GL.
Has anyone found work-arounds? These problems don't occur with Classical
4GL.
1) I can't use 'LOAD FROM "filename.unl"' when the unload file includes
text blobs.
2) I can't use the syntax "WHERE CURRENT OF some_curs" to update a
text blobs.
Here's an unload file (text_tab.unl) and a small program (text.4gl)
that shows the Dynamic 4GL problems:
text_tab.unl:
TEST|THIS IS A TEXT BLOB|
text.4gl:
MAIN
DEFINE q_txt CHAR(512)
DEFINE w_rec RECORD
f1 CHAR(20),
f2 TEXT
END RECORD
#{ # uncomment out this line for 2nd problem
whenever error continue
drop database upd_text
whenever error stop
create database upd_text#} # uncomment out this line for 2nd problem
DATABASE upd_text
#{ # uncomment out this line for 2nd problem
create table text_tab (
f1 char(20),
f2 text
)
LOAD FROM "text_tab.unl"
INSERT INTO text_tab;#} # uncomment out this line for 2nd problem
LOCATE w_rec.f2 IN FILE
LET q_txt = "SELECT f1, ",
"f2 ",
"FROM text_tab ",
"WHERE f1 = 'TEST' ",
" FOR UPDATE"
PREPARE upd_stmt FROM q_txt
DECLARE upd_curs CURSOR FOR upd_stmt
OPEN upd_curs
FETCH upd_curs
INTO w_rec.*
display w_rec.f1
UPDATE text_tab
SET (f2 )
= ( w_rec.f2)
WHERE CURRENT OF upd_curs
END MAIN
The program first dies at the load statement with the error:
Program stopped at "text.4gl", line number 22.
SQL statement error number -608.
Illegal attempt to convert Text/Byte blob type.
If I compile with fglpc and run it with fglgo (to create the
the database and table and load the data outside of Dynamic 4gl),
then uncomment out the lines I've marked, and recompile the
program again with fgl2p, the 2nd error shows up:
Program stopped at "text.4gl", line number 41.
SQL statement error number -507.
Cursor (upd_curs) not found.
Running with the debugger on indicates the sqlca.sqlcode is 0 for all
previous lines. The display stmt reveals that the record was selected
since "TEST" is displayed.
--
______________________________________________________________________
| Colin McGrath cmm@trac3000.ueci.com |
| Raytheon Engineers & Constructors, Inc. (215) 422-4144 |
| Phila, PA, USA |
| Any opinions I state are my own and not necessarily of my employer |
|____________________________________________________________________|