Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
neerajthakur
Creator III
Creator III

Data Extraction from postgres

SELECT table_name As TableName,
table_schema as TableSchema,
table_type
FROM information_schema.tables where table_schema in ('x','y','z')
and table_name in
(
'complaint_details'
);

for i=0 to NoOfRows ('ListofTable')-1

let vTableName=Peek('TableName',$(i),'ListofTable');
let vSchemaName=Peek('TableSchema',$(i),'ListofTable');


$(vTableName):
SQL SELECT * from foscos.$(vSchemaName).$(vTableName);

next
Exit Script;

 

 

In above script I am trying to extract tables  from postgres, I want to input table name and let it select schema name itself as there are many tables and specifying and making extraction for each one separately would be a big time consuming task. I was trying to implement $(vSchemaName) but it is not getting recognised/working properly.

I don't want to specify schema and then giving table name related to it separately. There can be some cases where schema name is different but table name can be same for that either create new folder for add schemaname_tablename 

Please highlight issue and solutions or any alternative approach to this.

Thanks & Regards,
Please Accepts as Solution if it solves your query.
Labels (3)
0 Replies