Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Select-options filter in sql search.

f_cemunal
Participant
0 Kudos

Hello masters,

i am giving parameters to filter my search in sql statement but i want to change it to select-options.

i have searched the web but i couldnt find anything.

here is my code:

EXEC SQL.

     OPEN C FOR

       SELECT MAGAZAKOD, STOKKOD, ADET, BRUTTUTAR,

       INDIRIM, NETTUTAR, PROMOTIP, PROMOKOD

     from [dbMAROFIS_POS].[dbo].[PromoSorgu]

WHERE MAGAZAKOD = :P_WERKS AND

     TARIH = :p_budat

     ENDEXEC.


i want to change p_budat and p_werks.


thanks in advance.

3 REPLIES 3

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

See here

See FORM run_statment

I am using there:

cl_sql_connection

cl_sql_statement

cl_sql_result_set

cx_sql_exception

ob_sql_result_set = ob_sql_statement->execute_query( sql_statment ).

sql_statment is a string.

You can convert the select-options to the equivalent SQL syntax (you have to do the programing).

Regards.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,


Done some testing.


Found released function FREE_SELECTIONS_RANGE_2_WHERE


Sample program included please test.


Check the content of where_string at the BREAK-POINT .


Mind you this is still OPEN SQL dialect but it reduce some work .


Regards.

0 Kudos

Hi,

i solved my problem like this :

  my select option was werks.I have assigned werks-low and werks-high to global datas and used these datas as sql_werks<werks-high and sql_werks > werks-low in sql selection.

thanks for your reply.

regards.

cem.