If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I have a 250 tables and i want to query for every field that contains values >0 and not null. I then want to take those results and create a new table with 250 rows and two columns and populate it with the table name and populate the second with a Y if it is =0 or null and a N if it isn't. anyone have a idea how to do this recursively, without using the script for each indiv field?
Iteratively this would be relatively easy, recursively I can't think of any way to do it. Which database engine are you using (DB2, Microsoft, MySQL, Oracle, other)?
which should insert all fields into the field FIELD1 in TABLE2 ???
then i need to write a script that will loop through each field
name and adds:
INSERT INTO Table2 (FIELD2)
([Field Name] = 0) Or ([Field Name] IS NULL)
to a string, and then run a query on
"SELECT count(*) FROM Table1 WHERE " + [the constructed string]