Hi,
I want to concatenate the single quote character in a SQL select statement.
for eg...for
select
'select columnname, columntype from dbc.Columns where tablename = ''trim(TableName)'' and databasename = ''BI_STG'' and columntype <> ''TS'';' AS a
from dbc.tables
where DatabaseName = 'BI_STG';
I am getting the following result back
a
-----------
select columnname, columntype from dbc.Columns where tablename = 'trim(TableName)' and databasename = 'BI_STG' and columntype <> 'TS';
I need trim(TableName) to be replaced with the actual table name with single quote character placed at the front and at the end.
therefore I would like to see..
a
-----------
select columnname, columntype from dbc.Columns where tablename = 'BILL_STG' and databasename = 'BI_STG' and columntype <> 'TS';
Please help
Thanks
I want to concatenate the single quote character in a SQL select statement.
for eg...for
select
'select columnname, columntype from dbc.Columns where tablename = ''trim(TableName)'' and databasename = ''BI_STG'' and columntype <> ''TS'';' AS a
from dbc.tables
where DatabaseName = 'BI_STG';
I am getting the following result back
a
-----------
select columnname, columntype from dbc.Columns where tablename = 'trim(TableName)' and databasename = 'BI_STG' and columntype <> 'TS';
I need trim(TableName) to be replaced with the actual table name with single quote character placed at the front and at the end.
therefore I would like to see..
a
-----------
select columnname, columntype from dbc.Columns where tablename = 'BILL_STG' and databasename = 'BI_STG' and columntype <> 'TS';
Please help
Thanks