Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Scripting with custom tokens

Updated: 21 May 2010 | 3 comments
Jason_Webster's picture
0 0 Votes
Login to vote

I am trying to set a custom token as a variable in a vbscript.

I set up the custom data source in the tools menu.

The line is:

strVariable = %#DB-Alias*"Select Field1 from Table where Field2 = whatever"%

I've also tried:

strVariable = "%#DB-Alias*"Select Field1 from Table where Field2 = whatever"%"

DB-Alias is the name I set up in custom data sources.

Either way it sets strVariable to null.

I'm not sure what I'm missing, any help would be appreciatted.

Thanks.

Comments

eorme's picture
01
Jul
2009
1 Vote +1
Login to vote

Custom tokens

Try this format.  I use custom tokens all the time and haven't had any trouble.

%#*"select data from dbo.myCustomTable where id='123'"%

meson3902's picture
06
Jul
2009
0 Votes 0
Login to vote

Custom tokens

Your solution unfortunately doesn't cover the two issues:

  1. A custom database
  2. Looking up a value based on a dynamic parameter.

I am encountering the same issue when I try to look up information based on a computer's serial number.

ssilvest's picture
21
Sep
2009
0 Votes 0
Login to vote

Does your token work if you

Does your token work if you use it in a DOS task? You can do it direct from DS instead of a batch file.
i.e. echo %#DB-Alias*"Select Field1 from Table where Field2 = whatever"%

Also, you may need to put inverted commas around 'whatever', in your query.