Same options in i4gl, dbaccess & upscol?
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
I'm learning about implementing data validation rules using the
Informix-supplied utilities i4gl, dbaccess and upscol.
Most specifically I'm trying to create date and time stamps in
a table via a form. How do I make the date show up in one
field and time in another? I'd like to implement these default
values at the table level, not the form level if possible.
dbaccess has option Constraints, then Defaults;
upscol has option Validate, then Default.
Are these two features the same? I have similar questions
relating to implementation of constraints at the field level.
Being a code minimalist/lazy worker(/newbie?), I'd like to
make full use of these utilities *before* validating data at the
form/module level.
Anywhere I can go to read up on setting constraints thru
the utilities? Manuals don't seem to comment much on
INCLUDE, DEFAULT and CHECK. (I guess default isn't
really a "constraint," is it?)
Thanks.
Additional, less important comments/questions:
upscol and dbaccess don't seem to communicate constraint
information to each other: a default value of "Pissed Off"
for the "name" field implemented thru dbaccess doesn't
show up as a default value thru upscol.
Our app contains lots of routines to load ascii flat file data
into the tables. I expect some validation code is used.
Because of this batch processing, should I be more inclined
to use upscol or dbaccess? I haven' t explored the
VALIDATE statement yet.
The error checking seems so crude..."Syntax error." when
using using dbaccess. Gee, thanks for the tip. Guess I just
had to figure out that I couldn't implement a deault value on
a primary key.
On the other hand, upscol gave no errors when I
set up UPSHIFT on a field with INCLUDE constraint of
"Mktg, Mgmt, Oper, PMgr." Not until I tried to enter data
did I have confirmation of the constraint error.
As ususal, I appreciate the comments. :)
Nelson Fredsell
Cornerstone Capital
Atlanta, GA
nfredsel@cornercap.com