PDA

View Full Version : Special Characters



NewsArchive
07-31-2008, 02:09 AM
Hi all,

How do I handle special characters? Example:
Set Variable %yada% to:
-Q "BACKUP DATABASE [%DBSELECTED%] TO DISK =
'PATCH_[TCS_VERSION]_backup_%DBSELECTED%.bak'"

This fails, because it thinks [%DBSELECTED%] is a compiler var. In fact, it
is the SQL bracket around the db name.

How do I tell my string that I need the actual [ and ] characters?

Thanks,
-Glenn.

NewsArchive
07-31-2008, 02:10 AM
Hi Glenn,

> -Q "BACKUP DATABASE [%DBSELECTED%] TO DISK =
> 'PATCH_[TCS_VERSION]_backup_%DBSELECTED%.bak'"
>
> This fails, because it thinks [%DBSELECTED%] is a compiler var. In fact, it
> is the SQL bracket around the db name.

I believe you need to double up the % in this case %%DBSELECTED%%

--
ArnĂ³r Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-01-2008, 12:42 PM
Glenn,

> How do I handle special characters? Example:
> Set Variable %yada% to:
> -Q "BACKUP DATABASE [%DBSELECTED%] TO DISK =
> 'PATCH_[TCS_VERSION]_backup_%DBSELECTED%.bak'"
>
> This fails, because it thinks [%DBSELECTED%] is a compiler var. In fact,
> it is the SQL bracket around the db name.
>
> How do I tell my string that I need the actual [ and ] characters?

There are two improvements in the latest SetupBuilder 6.9:

---

IMPROVEMENT: IDE: To include a file name that contains brackets [] (e.g.
Test[1].txt) use double-brackets (e.g. Test[[1]].html) in
the "Install File(s)..." function.

IMPROVEMENT: IDE: To set a runtime variable to a value that contains
brackets [] (e.g. [Test]) use double-brackets (e.g. [[Test]]).

---

Update to the latest version and use:

-Q "BACKUP DATABASE [[%DBSELECTED%]] TO DISK =
'PATCH_[TCS_VERSION]_backup_%DBSELECTED%.bak'"

If %DBSELECTED% is not a runtime variable, use %%DBSELECTED%%

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-01-2008, 12:43 PM
Fredrich, what can I say...
you rock!

Thanks,
-Glenn.

NewsArchive
08-01-2008, 12:43 PM
> Fredrich, what can I say...
> you rock!

:-)

Friedrich