Ralf Hackmann
2017-06-07 08:12:00 UTC
Hello,
I have to check all fields on NULL for several tables in an Informix SE database.
I am doing the following:
Determine the table columns:
select_column.sql:
SELECT colname FROM syscolumns
WHERE tabid = (SELECT tabid FROM) WHERE tabname = "fyar1sta")
dbaccess myDB select_column.sql >> ar1_spalte.txt
select_ar1_NULL.awk:
#! / Bin / awk -f
{printf "SELECT article,% s FROM fyar1sta WHERE% s is null; \ n", $ 1, $ 1}
./select_ar1_NULL.awk ar1_spalte.txt> select_ar1_NULL.sql
The select_ar1_NULL.sql file now contains for each Field from fyar1sta a row with a select query that checks for NULL.
My approach works basically, but I would be interested in how to do this with a stored procedure in Informix SE, where I have no experience with SPL.
Greeting
Ralf
I have to check all fields on NULL for several tables in an Informix SE database.
I am doing the following:
Determine the table columns:
select_column.sql:
SELECT colname FROM syscolumns
WHERE tabid = (SELECT tabid FROM) WHERE tabname = "fyar1sta")
dbaccess myDB select_column.sql >> ar1_spalte.txt
select_ar1_NULL.awk:
#! / Bin / awk -f
{printf "SELECT article,% s FROM fyar1sta WHERE% s is null; \ n", $ 1, $ 1}
./select_ar1_NULL.awk ar1_spalte.txt> select_ar1_NULL.sql
The select_ar1_NULL.sql file now contains for each Field from fyar1sta a row with a select query that checks for NULL.
My approach works basically, but I would be interested in how to do this with a stored procedure in Informix SE, where I have no experience with SPL.
Greeting
Ralf