Home » Developer & Programmer » Forms » matched query issue (11g db , form 6i)
matched query issue [message #666557] Mon, 13 November 2017 06:00 Go to next message
Amjad_1975
Messages: 49
Registered: January 2017
Member
Sir my question is I want to pick data from 3 tables and call into main form example
1. Item table ...... Want to pick stock_code,unit price, level2 price
2. Client_option..... customer_code and 3 radio buttons regular price, level2 price
3. History ...stock_code
And main form containing
Stock_code, customer_code, price

I want to pick data from item table stock_code, unit price, level price and want to match with history.stock if item.stock_code=:history. Stock_code and clnt_option.customer_code=master.customer_no and if price level2 then 20 dollar else normal price until_PRC
If clnt_option .customer not equal master.customer despite this if item.stock.code =history. Stock_code matched than normal unt_PRC should bring. Sorry about English
May be I could not explained properly but hope experts peoples can understand my problems because English is not my mother tongue.
Example query will be highly appreciated.

Thanks in advance


Re: matched query issue [message #666559 is a reply to message #666557] Mon, 13 November 2017 06:49 Go to previous messageGo to next message
Littlefoot
Messages: 21225
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It looks like an ordinary list of values based on a record group query which selects data from 3 tables; use CASE (or DECODE) to deal with the "IF" part of your question.

Basically, you should write a query which returns required data set, test it in SQL*Plus (or any tool you use) and - once you're done - copy it to your form.

[Updated on: Mon, 13 November 2017 06:49]

Report message to a moderator

Re: matched query issue [message #666566 is a reply to message #666559] Mon, 13 November 2017 22:59 Go to previous messageGo to next message
Amjad_1975
Messages: 49
Registered: January 2017
Member
Select add_item.stk_code,description, qty,unt_PRC, ad_level2,op_typ,cust_no,history. Stk_code into
 :itrn_bar.item_code,
:itrn_bar.item_name,
:itrn_bar.qty,
Aa,
Bb,
Cc,
Dd,ff from add_item,clnt_option,history where add_item.STK_code=:control.a and
History. STK_code=:add_item.stk_code and
Clnt_option.cust_no=:imaster_bar.p_code;
If cc='level' then 
    :itrn_bar=:bb;
Else
:itrn_bar=:aa;
End if;
Above code is not working properly Sir kindly guide me what's wrong with this code not giving correct result.
Example query shall be highly appreciated

[Updated on: Mon, 13 November 2017 23:01]

Report message to a moderator

Re: matched query issue [message #666570 is a reply to message #666566] Tue, 14 November 2017 01:24 Go to previous message
Littlefoot
Messages: 21225
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What's wrong with it, apart from the fact that it is difficult to read as it is not formatted? Please, read and follow instructions described in How to use code tags and make your code easier to read.

Unless Aa, Bb etc. are local variables, that code won't even compile. Furthermore, those names ("Aa", "Bb") doesn't seem to be real names so - it might be a good idea to post your actual code, not imaginary one.

There are syntax errors ("History." and "STK_code" are separated by a space).

So, yes - I agree, that code isn't working properly. You should fix it.

Furthermore, it is not a record group query (i.e. you didn't accept my suggestion) so I have no idea what you are doing. Where did you put that code? What do you mean by saying that "it is not working properly"? Is there any error? If so, which one?
Previous Topic: FRM-13008:Cannot find javabean with name 'oracle.forms.webutil.ole.OleFunctions'
Next Topic: Oracle Developer 10g - webconfig issue
Goto Forum:
  


Current Time: Fri Nov 17 18:59:09 CST 2017

Total time taken to generate the page: 0.01951 seconds