PDA

View Full Version : Text substitution in SQL script



heedh23
06-06-2004, 12:33 PM
I have an InstallScript project with embedded SQL files. I am trying to use the Text Replacement feature of InstallShield X and having difficulty.

What I want to do is substitute the contents of a property value into the SQL script. The property value is set by some custom InstallScript prior to SQL component installation. I have tried angle brackets <MyVariable>, square brackets [MyVariable], but nothing seems to work.

What is the appropriate syntax for making this kind of substitution?

Kind regards,
-Heed

Startup
06-06-2004, 07:13 PM
Hi Author,

I am also new to InstallSHield, and would be interested to know the "right" way of doing it, but that's what worked for me:

In the script i defined a global substitution:

// Define global substitution
TextSubSetValue ( "<String_Value>", szUserInput, TRUE );

and then in the SQL Server script I used <String_Value> as following:

INSERT MyTable( MyString ) VALUES( '<String_Value>')

Startup