mysql - Error when writing a conditional query (ternary) -


i have 2 parameters $p{param1} , $p{param2}. $p{param1} 1 prompts when query being executed. $p{param2} contains conditional query when $p{param1} null, show records, else choose id matches parameter.

here conditional query $p{param2}:

$p{param1}.equals(" ") ? "select * tablerecords" : $p{param2}.equals($p{param1}) 

the problem when try execute query , ask parameter1 , example put 2 (which id), query says "the document has no pages" , when try put 1,2,3 query returns records.

this sql query in main report way:

select c.id, p.lastname, p.firstname person_tbl p,code_tbl c $p!{param2} , p.id=c.id order 1; 

the $p{param1} value id


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -