Your Answer is really helpful, But I am facing one issue. I have an existing application which earlier uses syntax like
CREATE TABLE <TABLE NAME> as <TABLE NAME> now we have introduced a view layer in it so now the query generated as
CREATE TABLE <TABLE NAME> as <VIEW NAME> which is giving me an error that <VIEW NAME> is not a table.
Is it possible that the above query can run just by some modification is DB instead of changing the query so that I do not need to change the existing system.
The above queries are generated to create the work table and stage table.
No it is not possible.
You could change you script to look at the tablekind in dbc tables and substitute the select * format whenever you run into a view.
Dieter - I used the SQL you proved (have used before Successfully) but this time I am getting the following error:
CREATE TABLE Failed. 5325:Lenth 0 is not allowed for a CHAR. CARCHAR, BYT, VARBYTE column - any ideas as to why?
someof my fields have null values but that seems normal
any help you could provide would be appreciated
Can't be the NULLs, they got a default data type INTEGER.
I would expect that error when the Select includes an empty string: '' as col