oracle11g - Wildcard Parameter CR SQL Query -


the following code have written works find. outputs expect.

select distinct      mi_tm.st_event_time,      mi_tm.st_location,      mi_tm.st_log_class,      mi_tm.st_qty,      mi_tm.st_reason,      mi_tm.st_reason_data,      mi_tm.st_sku_code,      mi_tm.st_ulid,      mi_tm.st_user_id,      x_prod.description,      x_supplier.supplier_name      mi_tm, x_prod,      x_igd, x_supplier      mi_tm.st_date >= {?start} ,      mi_tm.st_date <= {?end} ,      mi_tm.st_sku_code = x_prod.prod_code (+) ,      mi_tm.st_sku_code = x_igd.prod_code (+) ,      x_igd.supplier_no = x_supplier.supplier_no (+) ,      mi_tm.st_sku_code  '{?sku}' ,      mi_tm.st_log_class in ('tm_adjust_qty', 'tm_create', 'tm_delete') 

however line

   mi_tm.st_sku_code  '{?sku}' , 

i able expect wildcard parameter, return values run between dates. querying % seems crash report. , have tried adding '%' around parameter. either invalid number error, or sql not ended properly. grateful on issue.

edit: place @ bottom

if {?sku} = '*' mi_tm.st_sku_code '*' else mi_tm.st_sku_code  '{?sku}'  


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -