Home » Developer & Programmer » Forms » SQL command concat with block name problems..
SQL command concat with block name problems.. [message #218724] Fri, 09 February 2007 10:03 Go to next message
Smith_X
Messages: 56
Registered: January 2007
Member
Hello, could anybody plase help me...~~

SELECT :CONTROL.DOCTYPE||'NO'
FROM :CONTROL.DOCTYPE
WHERE :CONTROL.DOCTYPE||'.STSID' = 'sts06'


assume that my :CONTROL.DOCTYPE = 'PO'

then, I expect the result should look like below,

SELECT PONO
FROM PO
WHERE PO.STSID = 'sts06'


well, what I get is syntax error.. Invalid SQL Query and ORA-000903 or maybe what I really want to do is not work at all..

I want to create a dynamic LOV that interact with the value of drop down list. what I want is below,

1. user choose a doctype from drop down list
2. user use LOV and lov windows show only document number of selected doctype.

Those document are from six different tables (SO, SR, GR, RR, MO and PO)

My desperated idea is just use UNION and use alias to rename document number column to a same name column.. this method do not require doctype drop down list but I think it'll lead user to get confuse and somehow this LOV will represent many hundred of results.. which may lead to poor performance when query something. Are there any way to use "WHERE" condition after I use UNION please? or could anybody give me an alternative method, please?


Re: SQL command concat with block name problems.. [message #218853 is a reply to message #218724] Sun, 11 February 2007 10:04 Go to previous messageGo to next message
Smith_X
Messages: 56
Registered: January 2007
Member
Sad
Time is up..

I have to finish my project very soon.. So, I will think another possible logic instead of this one.

However, if anybody could point out how do I resolve this problem, it would help any other people who may face the same problem as me.

Razz
Re: SQL command concat with block name problems.. [message #219151 is a reply to message #218853] Tue, 13 February 2007 03:07 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Either use dynamic record_group or have 6 record_groups defined (one for each table) and then use a set_lov_property depending on the value of :CONTROL.DOCTYPE

David
Re: SQL command concat with block name problems.. [message #219241 is a reply to message #219151] Tue, 13 February 2007 12:05 Go to previous message
Smith_X
Messages: 56
Registered: January 2007
Member
Wow.. Thank you very much for your reply. You are very very genius, David.

Even though I do not use this logic anymore but I still try to understand what I should to do and I think I'm understand now..

create 6 record sets and 6 lov.

then change lov by use set_item_property and call lov by do-key 'listvalue'

Thank you very much again.

Previous Topic: Usage of Reports/Forms
Next Topic: Max length at runtime
Goto Forum:
  


Current Time: Fri Dec 09 13:47:27 CST 2016

Total time taken to generate the page: 0.04935 seconds