- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to use variable inside SQL Query?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello,
I would like to use SQL Query with using the variable. I have mentioned below my query and expectations
1. Replace EMPLOYEE to my variable:-
String nameEmp = "ourEmployee";
Actual query : szSQL="select name from sys.sysdatabases where name='EMPLOYEE'";
Expected : szSQL="select name from sys.sysdatabases where name= ??????? ";
How to assign nameEmp variable to where name ?
2. Replace EMPLOYEE to my variable:-
String nameEmp = "ourEmployee";
Actual query : "SELECT * FROM EMPLOYEE.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME ='MetaDataTable'" ;
Expected Query: "SELECT * FROM ???????????.INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME ='MetaDataTable'" ;
How to assign nameEmp variable to EMPLOYEE ?
3. Replace EMPLOYEE to my variable:-
String nameEmp = "ourEmployee";
Actual query : "SELECT * FROM [EMPLOYEE].[dbo].[MetaDataTable]";
Expected query : "SELECT * FROM [???????].[dbo].[MetaDataTable]";
How to assign nameEmp variable to EMPLOYEE ?
Regards,
Vasanth
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content