Page 1 of 1

Executing SQL - CREATE TABLE

Posted: Fri Apr 25, 2025 7:51 pm
by mark.civ
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.

Re: Executing SQL - CREATE TABLE

Posted: Sat Apr 26, 2025 10:05 pm
by Dino
You could use the create table in a select_sql command , like these:

viewtopic.php?f=3&t=2595&p=7678&hilit=S ... _dql#p7803