PLEASE PLEASE PLEASE Help Me!!!
Posted in 1994
This one has got me baffled - can anybody please help me ...
I am using Informix v4.00 RDS, I4GL and ISQL.
Is there any way of assigning a NULL value to part of a column value ?
For example, I have a column in a database table which is 28 characters
long. I need to insert a value into the first 4 characters whilst
leaving the remaining 24 characters as NULL. If I use a command similar
to:
let recordname.keyfield = "1234"
and insert the row, the remaining part of the field is written as spaces.
I have tried assigning a program variable to null and building up the
field value as follows:
initialize null_field to null
let recordname.keyfield = "1234", null_field
but this makes no difference. I have also tried adding a NULL record
to the database and using SQLCA.SQLERRD[6] to obtain the rowid of the
new record. Then update the table setting keyfield[1,4] to "1234"
where rowid equals the rowid of the newly inserted row. Unfortunately,
this doesn't make any difference either.
The reason I need to do this is because I am writing some software which
integrates with another 3rd party package. This 'other' package recognises
record locks by assigning the last 24 characters of the keyfield to NULL.
Although I can check for this using SQL similar to:
select keyfield from table
where keyfield[1,4] = "1234"
and keyfield[5,28] is null
I cannot seem to use 4GL code to make similar locks which would be
recognised by the 'other' package.
Any sugestions would be greatfully received !!
Regards,
Keith.
*************** tech@compsys.demon.co.uk ***************
Tel: 044 (0)1482 803961 Fax: 044 (0)1482 804333
********************************************************