Hi, is there a way to create an empty table from it's schema definition? i.e., i'd like to be able to load in a text file that defines the table:
CREATE TABLE Geography(
Id int not null
,Country char(50) not null
,Province char(50) not null
...
rather than say, read it in from a db.
thanks,
steph
Solved! Go to Solution.
Yes it is. But there is no (public) tool out there that reads the DDL and can create an empty data stream.
In looking at the example data what you would really be focused on is what's inside of the outer parenthesis. Each row contains a field name, data type and rule. With or without regular expressions, I could find ID, Country, Province. I could setup a row for each field name and based upon the data type, put a value into a field. This is the result:
NAME|VALUE
ID|64000
Country|ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Province|ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
That data would be sent into a CROSS TAB tool and I would now have:
ID|Country|Province
64000|ZZZ...ZZZ|ZZZ...ZZZ
I now have the construct of the empty table (after I sample and skip the first 1 row).
Cheers,
Mark
Thanks Mark. this should work.
steph.