abenitez77
Registered User.
- Local time
- Today, 15:23
- Joined
- Apr 29, 2010
- Messages
- 141
I have a string in a variable that has a sql string. I need to pull out the table name and replace it with another name.
These are 2 examples of the string that I get:
"Select * from mytable;"
"Select field1, field2, field3 From table2 Where Field2 = 123 Order by field1"
I want to replace the table name in the string with the name of a table I am holding in a variable. How can i do this? I cannot build out the string with the table name I want, I know how to do this, I need to replace the string I get.
These are 2 examples of the string that I get:
"Select * from mytable;"
"Select field1, field2, field3 From table2 Where Field2 = 123 Order by field1"
I want to replace the table name in the string with the name of a table I am holding in a variable. How can i do this? I cannot build out the string with the table name I want, I know how to do this, I need to replace the string I get.