2001 JI Open Discussion Posted August 29, 2006 Share Posted August 29, 2006 By: den chong - den06boy Difference between $P!{var} and $P{var} 2003-09-30 02:58ANyone can explain to me what the diff between these 2 parameters : '$P!{var}' and '$P{var}' ? Whats the "!" stands for? By: Giulio Toffoli - gt78 RE: Difference between $P!{var} and $P{var} 2003-09-30 03:44 When you simply use $P{param}, jasperreports use a prepare statement, and then pass $P{param} as SQL parameter. When you use $P!{param}, the parameter is processed to generate the final SQL string to execute (for this reason using $P!{} syntax you can pass entire portions of SQL, or the entire query too!) Giulio Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted September 26, 2006 Share Posted September 26, 2006 What are the benefits of using either approach? It seem s to me that you would want to always use $P!{var} would you not? I have a situation where I have the WHERE clause being modified as WHERE name='$P!{PERS_NAME}' AND ID='$P!{PERS_ID}' But at some times I dont want the ID check used so I have that all extracte to an even bigger parameter... WHERE name='$P!{PERS_NAME}' $P!{ID_BIG_PARAM} Where I have ID_BIGPARAM = "" or..." AND ID='123' " So is it more efficient to use $P!{var} or $P{var} for the name parameter? Thx,Rob Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now