Home » Developer & Programmer » Forms » Problem on Form Builder? help me
Problem on Form Builder? help me [message #87344] Mon, 20 December 2004 16:49
Dhalan
Messages: 15
Registered: August 2004
Junior Member
Hai guys

I want to ask your help to solve my problem…..

 



Table name = attendance 

-

Icno
-
-

Name
-
-

Date1
-
-

Start_am
-
-

End_pm
-

-

078667
-
-

Mike
-
-

21-12-2004
-
-

07:45:10
-
-

12:15:30
-

-

078667
-
-

Mike
-
-

21-12-2004
-
-

13:20:00
-
-

14:20:00
-

-

078667
-
-

Mike
-
-

21-12-2004
-
-

15:00:00
-
-

16:00:30
-

 



The above data, I insert it through SQL by using insert statement for testing.

 



Here is my question

On form builder, on attendance form, there is a button and I insert in it with select statement like below

 



Begin 



select login_id, name into :attendance.icno, : attendance.name



from jhd.staff



where login_id = :login2.ic;



GO_BLOCK(attendance);



:attendance.date1 := to_char(SYSDATE,'DD-MON-YYYY');



 end;

 



Declare

no_data_found1 exception;

 



Begin 



select start_am, end_pm into :attendance.start_am, : attendance. end_pm



from attendance



where icno = :attendance..icno and Date1 = TO_CHAR(SYSDATE, 'dd-MON-yyyy');



 



if  :attendance. end_pm is null then



    raise no_data_found1;



end if;



 



Exception



 



When no_data_found then



select to_char(sysdate, 'hh24:mi:ss') into :attendance.start_am



from sys.dual;



RAISE Form_Trigger_Failure;



 



When no_data_found1 then



select to_char(sysdate, 'hh24:mi:ss') into :attendance. end_pm



from sys.dual;



RAISE Form_Trigger_Failure;



 



end;

 



Assume there is no record inside table attendance, the above statement can create record with no problem but when the same person want to go out again on the same date1, he must key-in his ICNO and the form with automatically generate by itself. My problem is the above statement cannot create a second record for the same person.

How to create a second record with same person and date but different in time only on form builder. Can u give me with coding example. Thanks guys

Any ideas guys?
Previous Topic: Upgrade exam from 6i to 9i (forms)
Next Topic: form on web
Goto Forum:
  


Current Time: Sun Nov 03 05:11:29 CST 2024