evesely
1st February 2002, 22:09
Is there a simple function call to test whether a table field has a legitimate value when there is a mandatory or mandatory unless empty reference to another field (i.e., a value that won't cause a 606 error)? I suppose I could dynamically create SQL to do this, but I'd rather use an existing function if one exists. Baan does this for you when you enter data into a field on a form. I'd like to be able to make such a call myself.

NPRao
1st February 2002, 22:39
maybe this function might help you -

long rdi.reference( string column_name(18), ref string ref_column(18), ref long ref_mode, ref string ref_mess() [, long ignore_by_db] )

Description

If a database column references a column in another table, use this function to retrieve information about the referenced column.

Arguments

column_name The name of the column which references the column about which you want to retrieve information.
ref_column This returns the name of the column to which the column specified in column_name refers.
ref_mode This returns the relation type. Possible values are:1 compulsory
2 compulsory unless empty
3 not compulsory
ref_mess This returns the error message of the referenced column.
ignore_by_db This indicates whether or not a referential integrity check is performed by the database driver. Possible values are:1 check ignored
0 check performed by database driver
Return values

0 success
-1 error

evesely
1st February 2002, 22:42
I considered that, but I would still have to write a dynamic SQL statement to make a generic check. If I have to, I will. I was just hoping for some "canned" function.