Executing SQL - CREATE TABLE
Posted: Fri Apr 25, 2025 7:51 pm
Hi,
I have a need to dynamically create a database table based on a CSV file being imported. I am clear with reading the CSV file, processing the header for column names, etc., but I am unsure how to create the table in this scenario.
Clearly, SQL like 'CREATE TABLE XXXDTALIB.TestTable ( Data1 nvarchar(1000), Data2 nvarchar(1000), Data3 nvarchar(1000) );' would work as SQL, but I am wondering how would I execute this from within a LANSA once I've built the string in question?
Thanks.
I have a need to dynamically create a database table based on a CSV file being imported. I am clear with reading the CSV file, processing the header for column names, etc., but I am unsure how to create the table in this scenario.
Clearly, SQL like 'CREATE TABLE XXXDTALIB.TestTable ( Data1 nvarchar(1000), Data2 nvarchar(1000), Data3 nvarchar(1000) );' would work as SQL, but I am wondering how would I execute this from within a LANSA once I've built the string in question?
Thanks.