Home » Developer & Programmer » Forms » matched query issue (11g db , form 6i)
|
Re: matched query issue [message #666559 is a reply to message #666557] |
Mon, 13 November 2017 06:49   |
 |
Littlefoot
Messages: 21823 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   |
 |
Amjad_1975
Messages: 82 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   |
 |
Littlefoot
Messages: 21823 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?
|
|
|
Re: matched query issue [message #666638 is a reply to message #666570] |
Sat, 18 November 2017 03:13   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
scenario is something like this i have added two codes in add_item table
1001----containing both prices (a).Regular price (b).level 2 price
1002----containing only regular price
and added twi clients in client table .
c013----which has radio button selected "level2" price.
c014----regular price.
problem is when i am entering "1001" which has both prices working 100% fine with both clients c013,c014
but when i am entering code "1002" which has only regular price and client table radio button selected "regular price"
working with only code "c014" when i entered "c013" bringing blank data code as follo below.
declare
aa varchar2(20);
bb number(8);
cc number(10);
dd varchar2(8);
ee varchar2(15);
ff varchar2(20);
begin
select stk_code,
ad_level2,
unt_prc
into aa,
bb,
cc
from add_item
where
add_item.stk_code=:block3.stk ;
message(cc);
message(cc);
select op_typ,cust_no into dd,ee
from clnt_option
where
cust_no=:block3.clnt;
if dd='level2' then
:block3.prc:=bb;
else
:block3.prc:=cc;
end if;
end;
Thanks
[Updated on: Sat, 18 November 2017 03:14] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 02 10:52:41 CDT 2025
|