Re: Load Command Quirks in 4gl.
Posted in 1994
From Ted RephT:
*
* Sample code:
* define file_name char(80)
* define foo char(160)
* let file_name = "a_file_name"
* load from file_name insert into a_table
* let foo = file_name, " TEST"
* display foo
*
* results from displaying foo:
* a_file_name
*
* I am running 4gl version 4.10UC4 on SCO Unix 3.2
*
* the load command places a null character in the variable file_name after the
* last non-blank character. :-( Not a nice trick.
When using the UNLOAD or LOAD command in the form of:
Ex. 1
DEFINE
var_name CHAR( 20 ),
select_buffer CHAR( 200 )
LET var_name = "out_file"
LET select_buffer = "select * from table_name"
UNLOAD TO var_name select_buffer
-- OR
UNLOAD TO var_name SELECT * FROM table_name
Ex. 2
DEFINE
var_name CHAR( 20 ),
insert_buffer CHAR( 200 )
LET var_name = "in_file"
LET insert_buffer = "insert into table_name"
LOAD FROM var_name insert_buffer
-- OR
LOAD FROM var_name INSERT INTO table_name
The variable 'var_name' will be unusable after the UNLOAD/LOAD statement due
to the INFORMIX internal function call to _ffunload()/_ffload(). It, for
some reason, truncates and embeds a trailing NULL after the last character
instead of position 21 like normal. For example:
Before the UNLOAD/LOAD call:
var_name = "out_file "
var_name = "in_file "
After the UNLOAD/LOAD call:
var_name = "out_file"
var_name = "in_file"
Hopefully, this is fixed in later versions of INFORMIX. This is occuring
in the SCO versions:
INFORMIX-4GL Version 4.10.UC3 ( C-Code )
INFORMIX-4GL Version 4.10.UC3 ( P-Code )
INFORMIX-SQL Version 4.10.UD2 ( SE )
Robert Minter |Data Systems Support| \\\\\\_///
Programmer, Software Development | Orange, CA | ( _ _ )
rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |)
De Colores - Emmaus OC-13 | Fax: 714.771.3028 | \\`-'/
#include <disclaimer.h> SURF'S UP \\_/