prob while inserting [message #77712] |
Tue, 06 November 2001 21:38 |
chandrakanth
Messages: 16 Registered: October 2001
|
Junior Member |
|
|
table name = Ah_mast
Columns are :-
Ah_Date Date
Ac_code varchar2
Ac_desc Varchar2
Bal Number
Co_code Varchar2
F_year Varchar2
s_flg varchar2
about keys & variables:-
Unique-key :- (ah_date+ac_code+co_code+f_year)
Ac_code, Ac_Desc, Bal :- user inputs (forms)
ah_date, co_code, f_year :- Global.variables
s_flg is a check_box item and if selected "Y" if not then "N" and copied into blockitem s_flg (properties copy value from).
start_dt, end_dt :- Global.variables to calculate the number of records to be inserted while updating the ah_mast i e it start date is 01-04-2000 and end_dt is 31-dec-2001 then while BUTTON-PRESSED(SAVE) 365 records to be inserted into ah_mast inbetween the dates from start_dt and end_dt.
Example:
01-Apr-2000, 'ac_code1','desc1', 1234.00,'co_code1','8889','Y'
second record will be start_dt + 1
02-Apr-2000, 'ac_code1','desc1', 1234.00,'co_code1','8889','Y'
my coding for inserting is as below:
when-button-pressed trigger
declare
temp_start date;
temp_end date;
begin
temp_start := :global.start_dt;
temp_end := :global.end_dt;
while :temp_start <= :temp_end
loop
insert into ah_mast values(:temp_start,
blockname.ac_code,
blockname.ac_desc,
blockname.bal,
:global.co_code,
:global.f_year,
block.s_flg);
:temp_start = :temp_start+ 1
end loop;
end;
While running the form ERROR MESSAGE IS:- COMMA IS MISSING...
Pls help...
----------------------------------------------------------------------
|
|
|
Re: prob while inserting [message #77715 is a reply to message #77712] |
Wed, 07 November 2001 02:39 |
Shilpa
Messages: 59 Registered: November 2001
|
Member |
|
|
You missed a semicolon after this statement.
:temp_start = :temp_start+ 1
----------------------------------------------------------------------
|
|
|
Re: prob while inserting [message #77750 is a reply to message #77712] |
Mon, 12 November 2001 02:50 |
waris
Messages: 115 Registered: November 2001
|
Senior Member |
|
|
hi chandrakanth...
i think u have missed out semicoln...after incrementing temp_start
/*temp_start = :temp_start+ 1 */
i hope u r clear...
----------------------------------------------------------------------
|
|
|