i am trying to create table in talend using below code i see no error but in database this table is not getting created
do $$ declare begin execute 'DROP TABLE IF EXISTS tname'; execute 'CREATE TABLE IF NOT EXISTS tname (ACTIVITY VARCHAR(32))'; end $$ ;
Please help me i am new in Talend
CodePudding user response:
You will have to just use this component tDBRow
And a very important thing is to to use tDBCommit after the tDBRow if not the table would not be created in your Postgres Database
or just tick the commit (in advanced settings if you are using tDBConnection component)
CodePudding user response:
Should be something like this
DO
$$
DECLARE BEGIN
EXECUTE 'DROP TABLE IF EXISTS tname';
EXECUTE 'CREATE TABLE IF NOT EXISTS tname (ACTIVITY VARCHAR(32))';
END;
$$