BusinessObjects Board

Prompt for Wildcard

I need to create a prompt that allows me to select, one value, multiple values from a list of values, or select all the values.

I found the following entry here on BOB that should be exactly what I need to do.

Is there anyone who can explain the following code to me in steps so I can try and recreate it using my own database? I am using a DB2 database if that is any help. The following is the code listed in the Entry here on BOB.

(@Select(Sales Geography\Country Group) IN @Prompt('Select Country Group or 
enter * for all groups','a','Sales Geography\Country Group',multi,free) ) OR 
('*' in @Prompt('Select Country Group or enter * for all groups','a','Sales 
Geography\Country Group',multi,free))

The following is how I took the code above and set it up. I did something wrong becuase everytime I click run, it takes me right back to the data provider. Can someone help me understand what I did wrong:

@Select (D_ACCOUNT.I_ACCT (THIS IS MY FIELD NAME) ) in @prompt(‘Select CODE or Enter * for all CODES’,‘D_ACCOUNT.I_ACCT’ (THIS IS MY FIELD NAME) ,multi,free)) or(’*’ in @Prompt(‘Select CODE or Enter * for all CODES’,‘a’,‘D_ACCOUNT.I_ACCT’ (THIS IS MY FIELD NAME),multi,free))

Can someone help me understand what I did wrong?

thanks in advance!


khansen97 (BOB member since 2003-12-05)

You shouldn’t be using @Select. You are referencing an actual database column. @Select is used when you want to refer to an exising object.

You syntax for your first @Prompt is wrong. It does not contain a type. And it uses a database field for the LOV. LOVs have to use objects. Also be very careful with the case of your paramters. I’ve found @Prompt to be very sensitive. UPPER case always works.


Steve Krandel :us: (BOB member since 2002-06-25)

Ok. So I changed my syntax to look like this:

 D_ACCOUNT.I_ACCT in @PROMPT('Select CODE or Enter * for all CODEs,'Code\Code',multi,free)) or('*' in @PROMPT('Select CODE or Enter * for all CODES,'a','Code/Code',multi,free))

I changed it to take out the @select as well as changed the @prompt to reference the Object I need it to grab data from.

It still is not working. Everytime I click run, it brings me right back to the data provider.

Any other suggestions?

thanks!


khansen97 (BOB member since 2003-12-05)

Try this

 D_ACCOUNT.I_ACCT in @PROMPT('Select CODE or Enter * for all CODES,'A','Code\Code',MULTI, FREE)) or ('*' in @PROMPT('Select CODE or Enter * for all CODES,'A','Code/Code',MULTI, FREE))

Please don’t be insulted by this: You need to be MUCH more careful with your syntax. You left out parameters and spaces. Did you even parse your object in Designer?

You should try to get the @prompt to work by itself before adding in all the complexity. You’d have gotten much farther, much faster.


Steve Krandel :us: (BOB member since 2002-06-25)

No Insult at all. I have never done this before so to be honest I am taking others code and trying to manipulate it to what I need it to do. I am doing this all as a trial and error, and learning only when I don’t have something right.

The code you gave me is still not working, so I took your suggestion to get the @prompt to work first. I am close, it seems with the first @prompt. This is what I have:

D_ACCOUNT.I_ACCT in @prompt('Enter CODE','A','CODE\CODE',multi, free) 

When I run this, it finally seems to run YEAH!! However when I enter a value, I get an Error during SQL run error (hopefully I am allowed to show my error):

I have disected your code over and over along with other examples of @Prompt that I have been able to find, but I cannot figure this out. The “(” that it is talking about is a part of my @Prompt. I also tried to make everything all upper case and it still doesn’t work.

Could this have something to do with the database I am running this against?


khansen97 (BOB member since 2003-12-05)

Page 283 of the Designer’s Guide explains the @Prompt well.


Paul Carletta (BOB member since 2003-12-18)

OK, I’m not clear on this. In your code above, you use in but your error message says the problem is a parenthesis following a like operator. Is one of those quotes incorrect?


EHurst (BOB member since 2004-10-08)

Actually I got it. I played with my @prompts all night and finally got it to work.

I am still looking at the first code I did to see what the difference is, but the following is the code that worked.

I hope this helps someone else out!

(@Select(Code\Code) in @Prompt('Please Select Code','A','Code\Code',Multi,Free)) or('*' in @Prompt('Please Select Code','A','Code\Code',Multi,Free))

Thanks to all that tried to help me out!


khansen97 (BOB member since 2003-12-05)