Home » Developer & Programmer » Forms » To get list values starting with a particular alphabet
To get list values starting with a particular alphabet [message #525235] Fri, 30 September 2011 04:21 Go to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Hello Sir,

I have made one LOV for vendor_names. On form level i want that when the user will enter a particular alphabet in a textbox assigned with LOV, the list should popup with only those elements starting with that particular alphabet. I have written the following code in the query of LOV wizard

query:

select distinct(bpt_ven_nm),bpt_ven_cd from bill_hdr1_tab
where bpt_ven_nm like ('enter.vendr_nm'||'%')
order by bpt_ven_nm

Wherin 'Enter' is the name of block and 'vendr_nm' is field name.
But its getting unsuccesfull. Please correct me if i am making any mistake in this query or is there any alternate way to get this result.
Re: To get list values starting with a particular alphabet [message #525239 is a reply to message #525235] Fri, 30 September 2011 05:35 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
DISTINCT applies to the whole column list, not only BPT_VEN_NM.
When referencing a block and an item, you must not enclose them into single quotes (because they are treated as an ordinary string), but precede their name with a colon (:) sign.

Something like this:
select distinct bpt_ven_nm, bpt_ven_cd
from bill_hdr1_tab
where bpt_ven_nm like :enter.vendr_nm || '%'
order by bpt_ven_nm

I don't know whether it will do what you are after, but you may try.
Re: To get list values starting with a particular alphabet [message #525272 is a reply to message #525235] Fri, 30 September 2011 08:09 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
poojamunj wrote on Fri, 30 September 2011 05:21
Hello Sir,

I have made one LOV for vendor_names. On form level i want that when the user will enter a particular alphabet in a textbox assigned with LOV, the list should popup with only those elements starting with that particular alphabet. I have written the following code in the query of LOV wizard

query:

select distinct(bpt_ven_nm),bpt_ven_cd from bill_hdr1_tab
where bpt_ven_nm like ('enter.vendr_nm'||'%')
order by bpt_ven_nm

Wherin 'Enter' is the name of block and 'vendr_nm' is field name.
But its getting unsuccesfull. Please correct me if i am making any mistake in this query or is there any alternate way to get this result.


I am easily confused. I do not know what you mean by "alphabet," so I am going to assume you want to show an LOV of entries starting with a single letter identified in another field.

I would use this in the where clause:

where substr(bpt_ven_nm,1,1)=:enter.vendr_nm
Previous Topic: FRM-40202 Field must be entered dialogue not closing
Next Topic: How to pass table name by reference to Function?
Goto Forum:
  


Current Time: Sat Sep 07 13:01:17 CDT 2024