Problem with coltype in syscolumns
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello everyone,
I am having problems in trying to find out if a column allows NULL values for a particular table. I am using ESQL/C
for Windows (5.01) and the backend database is Online v7.01. The problem is stated below:
- There is a table called "col_not_null" in the stores7 database and the Create SQL statement is
CREATE TABLE COL_NOT_NULL (field1 char(10) not null, field2 integer)
- To obtain the column information for this particular table, I use the following query:
SELECT C.colname, C.coltype, C.collength FROM syscolumns C, systables T
WHERE (C.tabid = T.tabid) and (T.tabname = 'col_not_null')
This query performed on db-access returns the correct results as:
colname coltype collength
field1 256 10
field2 2 4
A value greater than 256 indicates it does not allow nulls.
- The same query when performed from a client using ESQL/C yields:
colname coltype collength
field1 0 10
field2 2 4
As a result, I cannot figure out if the column allows null values.
I have lodged a complaint with Informix Tech Support (one and half months ago) and haven't had any solutions to this problem.I was wondering if anyone faced the same problem and if so, would like to hear from you.
Thanks.
Puru Balakrishnan
pbalakrishnan@symantec.com