I am investigating a problem that involves the use of abstract data
types specifically
the use of object_key which I have never come across before.
I have a table (table_a) that was created with a field cr_ingrs_key
defined as
object_key system maintained.
In an ABF program I have a field defined as tf.cr_ingrs_key defined as
char(16) NOT NULL.
The ABF program inserts the current value into the tf._cr_ingres_key
using the
statement
SELECT field_1 as :tf.field_1,
field_2 as :tf.field_2,
char(cr_ingrs_key) as :tf.cr_ingrs_key
FROM table_a
The program then performs some validation and on completion it attempts
to update
the status of the record via the following statement
UPDATE table_a
SET err_field='OK'
WHERE cr_ingrs_key = object_key(:tf.cr_ingrs_key);
and the program fails with the following message
"E_AD5080 The conversion from the datatype specified (length 15 bytes)
to
logical key type (ie. table_key or object_key with length 16 bytes)
failed because the lengths of the two datatypes were not the same.
(Tue Apr 8 12:57:01 2003)"
From reading the manual values assigned to object_keys must be 16
character strings.
Based on what i have seen in the program the field is defined as
char(16) so I don't see
where the system is getting a field length of 15 from. I also tried
changing the field
tf.cr_ingres_key from char(16) to c16 to see if this made a difference
- but got the same
error.
Does anyone have any ideas of what could be causing this problem.
(Ingres version 2.5)
--------------------------
Regards
Mike Evans
Vision Systems Software
Tel No# 431-0193
Fax No# 431-0192