Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

passing parameter value for like

palkodiAug 22 2018 — edited Aug 22 2018

create table ter (ID number, category varchar2(250 byte), name varchar2(250 byte) ); 

insert into ter values (1, 'amd-visual theraphy','john'); 

 

 

insert into ter values (1, 'amd-visual theraphy','mike'); 

 

 

insert into ter values (2, 'amd-autmatic theraphy','mike'); 

 

 

insert into ter values (3, 'amd-autmatic theraphy','drane'); 

 

 

insert into ter values (3, 'cmd autmatic theraphy', 'traverse'); 

--------------

so if i select this

select id, category, name from where category like '%visual%'

select id, category, name from where category like '%autmatic %'  i get the result

but if i want to pass a parameter how to obtain that

select id, category, name from where category like '%visual%'  = &catogeory or category like '%autmatic %' =&category (wrong method but want similar like this)

If i enter &category = visual then i need to get this result select id, category, name from where category like '%visual%'

If i enter &category = autmatic  then i need to get this result select id, category, name from where category like '%autmatic %'

so what should be done?

This post has been answered by Frank Kulash on Aug 22 2018
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 19 2018
Added on Aug 22 2018
8 comments
259 views