Oct 11, 2003 #1 bilalch Programmer Sep 26, 2003 84 IR hi dear frends. i want to select the qyery dynamically on the basis of my parameter form. i heard that it can b done through srw.do_sql but i dont know how and where to use it . plz help me.
hi dear frends. i want to select the qyery dynamically on the basis of my parameter form. i heard that it can b done through srw.do_sql but i dont know how and where to use it . plz help me.
Oct 12, 2003 #2 lewisp Programmer Aug 5, 2001 1,238 GB Specify a lexical parameter and you can make a SQL statement as dynamic as you like, as long as the number and types of the columns remain static. For example, you could specify a SQL like this: [tt]SELECT something FROM a_table &where_clause[/tt] ...then you pass in the where clause to the where_clause parameter when you run the form. Upvote 0 Downvote
Specify a lexical parameter and you can make a SQL statement as dynamic as you like, as long as the number and types of the columns remain static. For example, you could specify a SQL like this: [tt]SELECT something FROM a_table &where_clause[/tt] ...then you pass in the where clause to the where_clause parameter when you run the form.
Oct 13, 2003 Thread starter #3 bilalch Programmer Sep 26, 2003 84 IR hi dear lewisp, that's alright but the thing abt which i'm worried is how to pass the query selected with this criterion into the data model in the reports. like if i hav a static LOV having the values Customer Construction Date now i write code like this begin if :LOV='Customer' then select something from customer,product where ..... order by customer.c_name else if :LOV='construction' then select something from customer,product where ..... order by product.construction end if; end; ** the point is , will it work besides the actual query given into the data model right in the start of the report. plz help thanx bye Upvote 0 Downvote
hi dear lewisp, that's alright but the thing abt which i'm worried is how to pass the query selected with this criterion into the data model in the reports. like if i hav a static LOV having the values Customer Construction Date now i write code like this begin if :LOV='Customer' then select something from customer,product where ..... order by customer.c_name else if :LOV='construction' then select something from customer,product where ..... order by product.construction end if; end; ** the point is , will it work besides the actual query given into the data model right in the start of the report. plz help thanx bye
Jun 29, 2005 #4 Posina Programmer Jun 29, 2005 2 US Friends, I want to use an if clause in a select statement. Any help is appreciated. Upvote 0 Downvote