Solved! StringReplace not working for me

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Solved! StringReplace not working for me

Post by mightycpa » Fri Mar 27, 2015 3:31 pm

This was too easy... I must be tired.

StringReplace>sourcestring,find,replace,newstring

====================================================================================


Gurus, why won't this work? I'm stumped.

Code: Select all

Let>v_where=in ('TBL1','TBL2','TBL3')
Let>v_wci=in ('COL1','COL2','COL3)
Let>r1=x1x
Let>r2=xx-columnclause-xx

Let>v_extract_sql=select 'DBNAME.' + s.name + '.' + tbl.name as mytable, c.name
ConCat>v_extract_sql, from sys.columns c
ConCat>v_extract_sql, inner join sys.tables tbl on tbl.object_id = c.object_id
ConCat>v_extract_sql, inner join sys.types t on c.user_type_id = t.user_type_id
ConCat>v_extract_sql, inner join sys.schemas s on tbl.schema_id = s.schema_id
ConCat>v_extract_sql, left outer join sys.index_columns ic on ic.object_id = c.object_id and ic.column_id = c.column_id
ConCat>v_extract_sql, left outer join sys.indexes i on ic.object_id=i.object_id and ic.index_id = i.index_id
ConCat>v_extract_sql, WHERE tbl.name x1x
ConCat>v_extract_sql, and c.name in xx-columnclause-xx
ConCat>v_extract_sql, group by 'DBNAME.' + s.name + '.' + tbl.name, c.name
ConCat>v_extract_sql, order by 'DBNAME.' + s.name + '.' + tbl.name, c.name

StringReplace>%v_extract_sql%,%r1%,%v_where%,v_extract_result1
StringReplace>%v_extract_sql%,%r2%,%v_wci%,v_extract_result1
MessageModal>v_extract_sql
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts