Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Databases > Oracle   »   Oracle Forms 6i - Not able to show all records in block from table

 
Thread Tools Display Modes
Question
 
 
#1  
Old Nov 19, 2007, 03:25 PM
pbarnwal
New Member
pbarnwal is offline
 
Join Date: Nov 2007
Posts: 1
pbarnwal See this member's comment history on his/her Profile page.
Oracle Forms 6i - Not able to show all records in block from table

I have a question. I have to write a code to show all records from a table for one order number.

The code I have written for when button pressed of FIND button is like below:
declare
v_ORDER_NO number(20);
v_ORG_ID number;
v_LOC_CODE number(10) ;
v_YEAR_OF_CONTACT number(4) ;
v_CLAIM_NO varchar2(20) ;
v_CREATION_DATE date;
v_CREATED_BY varchar2(40) ;
v_HOMEOWNER varchar2(60);
v_ADDRESS varchar2(100);
v_CITY varchar2(40) ;
v_STATE varchar2(20) ;
v_COMPLAIN varchar2(240);
v_LAST_UPDATE_DATE date ;
v_LAST_UPDATED_BY varchar2(40) ;
v_RESPONSES varchar2(240) ;
v_SETTLEMENT varchar2(240) ;
v_OASIS_LEVEL number(1) ;
v_DAMAGE_AWARD number ;
v_RELEASED varchar2(1) ;
v_DATE_CLAIM_INITIATED date;
v_COMMENTS varchar2(2000);
v_COUNT number:=0;
v_CURRENT_DATE date ;
v_MAX_CLAIMNO number;
v_YEAR varchar2(20) ;
cursor c_LOCOASSIS is
Select ORDER_NO,
ORG_ID,
LOC_CODE,
YEAR_OF_CONTACT,
CLAIM_NO,
CREATION_DATE,
CREATED_BY,
HOMEOWNER,
ADDRESS,
CITY,
STATE,
COMPLAIN,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
RESPONSES,
SETTLEMENT,
OASIS_LEVEL,
DAMAGE_AWARD,
RELEASED,
DATE_CLAIM_INITIATED,
COMMENTS
from XX_LOCOASIS_INFO
where ORDER_NO=:BLOCKNAME.TXT_ORDERNO AND ORG_ID=82; -- Org_id should be from profile. Each Order Management reponsibility is assigned to an org_id.
begin
Select count(Claim_no) into v_COUNT from XX_LOCOASIS_INFO
where ORDER_NO=:BLOCKNAME.TXT_ORDERNO AND ORG_ID=82; -- Org_id should be populated from profile.

if v_COUNT > 0 then
for r_LOCOASSIS in c_LOCOASSIS loop
:XX_LOCOASIS_INFO.ORDER_NO:=r_LOCOASSIS.ORDER_NO;
:XX_LOCOASIS_INFO.LOC_CODE:=r_LOCOASSIS.LOC_CODE;
:XX_LOCOASIS_INFO.YEAR_OF_CONTACT:=r_LOCOASSIS.YEA R_OF_CONTACT;
:XX_LOCOASIS_INFO.CLAIM_NO:=r_LOCOASSIS.CLAIM_NO;
:XX_LOCOASIS_INFO.CREATION_DATE:=r_LOCOASSIS.CREAT ION_DATE;
:XX_LOCOASIS_INFO.CREATED_BY:=r_LOCOASSIS.CREATED_ BY;
:XX_LOCOASIS_INFO.HOMEOWNER:=r_LOCOASSIS.HOMEOWNER ;
:XX_LOCOASIS_INFO.ADDRESS:=r_LOCOASSIS.ADDRESS;
:XX_LOCOASIS_INFO.CITY:=r_LOCOASSIS.CITY;
:XX_LOCOASIS_INFO.STATE:=r_LOCOASSIS.STATE;
:XX_LOCOASIS_INFO.COMPLAIN:=r_LOCOASSIS.COMPLAIN;
:XX_LOCOASIS_INFO.LAST_UPDATE_DATE:=r_LOCOASSIS.LA ST_UPDATE_DATE;
:XX_LOCOASIS_INFO.LAST_UPDATED_BY:=r_LOCOASSIS.LAS T_UPDATED_BY;
:XX_LOCOASIS_INFO.RESPONSES:=r_LOCOASSIS.RESPONSES ;
:XX_LOCOASIS_INFO.SETTLEMENT:=r_LOCOASSIS.SETTLEME NT;
:XX_LOCOASIS_INFO.OASIS_LEVEL:=r_LOCOASSIS.OASIS_L EVEL;
:XX_LOCOASIS_INFO.DAMAGE_AWARD:=r_LOCOASSIS.DAMAGE _AWARD;
:XX_LOCOASIS_INFO.RELEASED:=r_LOCOASSIS.RELEASED;
:XX_LOCOASIS_INFO.DATE_CLAIM_INITIATED:=r_LOCOASSI S.DATE_CLAIM_INITIATED;
:XX_LOCOASIS_INFO.COMMENTS:=r_LOCOASSIS.COMMENTS;
end loop;
else

v_ORDER_NO:=:BLOCKNAME.TXT_ORDERNO;

v_ORG_ID:=82;--FIND FROM PROFILE

select to_char(trunc(sysdate, 'yyyy'), 'yyyy') into v_YEAR_OF_CONTACT from dual;

select substr(nvl(max(claim_no),1000),4) + 1 into v_MAX_CLAIMNO from XX_LOCOASIS_INFO
where org_id=82; -- org_id from profile. (bLOCK=$PROFILES$, FIELD=ORG_ID, vALUE=82)

select to_char(trunc(sysdate, 'yyyy'), 'yy') into v_YEAR from dual;

v_CLAIM_NO:=v_YEAR || '-' || v_MAX_CLAIMNO;

select sysdate into v_CURRENT_DATE from dual;

v_CREATION_DATE:=v_CURRENT_DATE;

v_CREATED_BY:='PBARNWAL'; -- (BLOCK=$PROFILES$, FIELD=USERNAME, VALUE=PBARNWAL)


select hpp.party_name,
initcap(acv.title || decode(acv.title,Null,'',' ') || acv.first_name || ' ' || acv.last_name),
hpp.city,
hpp.state
into
v_ADDRESS,
v_HOMEOWNER,
v_CITY,
v_STATE
from oe_order_headers_all oh
,hz_cust_site_uses_all csu
,hz_cust_acct_sites_all cas
,hz_cust_accounts cac
,hz_parties hpp
,ar_contacts_v acv
where oh.ship_to_org_id=csu.site_use_id
and csu.site_use_code = 'SHIP_TO'
and csu.status = 'A'
and csu.cust_acct_site_id=cas.cust_acct_site_id
and cas.status = 'A'
and cas.cust_account_id=cac.cust_account_id
and cac.status='A'
and cac.party_id=hpp.party_id
and hpp.status='A'
and oh.sold_to_contact_id=acv.contact_id(+)
and oh.order_number=:BLOCKNAME.TXT_ORDERNO
and oh.org_id=82 -- from profile
and rownum < 2;

v_LAST_UPDATE_DATE:=v_CURRENT_DATE;

v_LAST_UPDATED_BY:='PBARNWAL'; -- (BLOCK=$PROFILES$, FIELD=USERNAME, VALUE=PBARNWAL)

:XX_LOCOASIS_INFO.ORDER_NO:=v_ORDER_NO;
:XX_LOCOASIS_INFO.YEAR_OF_CONTACT:=v_YEAR_OF_CONTA CT;
:XX_LOCOASIS_INFO.CLAIM_NO:=v_CLAIM_NO;
:XX_LOCOASIS_INFO.CREATION_DATE:=v_CREATION_DATE;
:XX_LOCOASIS_INFO.CREATED_BY:=v_CREATED_BY;
:XX_LOCOASIS_INFO.HOMEOWNER:=v_HOMEOWNER;
:XX_LOCOASIS_INFO.ADDRESS:=v_ADDRESS;
:XX_LOCOASIS_INFO.CITY:=v_CITY;
:XX_LOCOASIS_INFO.STATE:=v_STATE;
:XX_LOCOASIS_INFO.LAST_UPDATE_DATE:=v_LAST_UPDATE_ DATE;
:XX_LOCOASIS_INFO.LAST_UPDATED_BY:=v_LAST_UPDATED_ BY;
end if;
end;


THE PROBLEM is when I click on find button and suppose more than one records exist in table corresponding one order number and org_id, it shows only last one record. I really appreciate if you could help me to figure out what is the issue. Thanks Buddy. God Bless you.

Reply With Quote
 
     



Thread Tools
Display Modes

 
Similar Sponsors

Similar Threads
Question Asker Forum Answers Last Post
send mail from oracle forms hiswapna Internet & the Web 2 Dec 11, 2007 07:51 PM
how i can send ane email through oracle 6i forms ? sunilkjose Other Compiled Languages 0 Aug 16, 2007 11:19 PM
80's or 90's kids show with dancing records Jack D Television 0 May 26, 2007 08:32 AM
sending email thrrough oracle forms cheenu Oracle 1 Apr 3, 2007 03:40 AM
Self-referenced table in Oracle 9i database for huge amounts of data VladimirD Oracle 5 Mar 27, 2007 07:05 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 02:29 PM.