Home » Developer & Programmer » Forms » Problem with a form in insert statement (Forms builder10g vista)
Problem with a form in insert statement [message #430953] Fri, 13 November 2009 06:59 Go to next message
@M.salah@
Messages: 4
Registered: November 2009
Location: Saudi arbia
Junior Member
Hi,
i make a form on 10g to import from excel sheet to forms using OLE2 , it works fine , but the problem is with a date field, the OlE2 don't support date so i make the field as char and at the insert i will convert it to date using to_date function.

this my code for the OLE2:
name_var5 := ole2.get_CHAR_property(cell,'TEXT'); --cell value of the argument



it works fine and import the value of date as a text at the form
but when i make insert statement from this code it doesn't work
BEGIN
	GO_BLOCK('EMPLOYEES');
	FIRST_RECORD;
	LOOP
	INSERT INTO EMPLOYEES(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,HIRE_DATE,JOB_ID, SALARY) 
VALUES (:EMPLOYEE_ID,:FIRST_NAME,:LAST_NAME,TO_DATE(:HIRE_DATE,'DD/MM/YY'),:JOB_ID, :SALARY);
		COMMIT;
		EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
		CLEAR_RECORD;
		NEXT_RECORD;
	END LOOP;
	FIRST_RECORD;
	END;

and the form itself is attached.

Regards
Re: Problem with a form in insert statement [message #430954 is a reply to message #430953] Fri, 13 November 2009 07:00 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What does "it does not work" mean? Any error? If so, which one?
Re: Problem with a form in insert statement [message #430956 is a reply to message #430953] Fri, 13 November 2009 07:06 Go to previous messageGo to next message
@M.salah@
Messages: 4
Registered: November 2009
Location: Saudi arbia
Junior Member
This erro:
FRM-40735: WHEN BUTTON PRESSED trigger raised unhandled exception ORA-01400.

AND when i try to save from the form it give
FRM-40508:ORACLE ERROR UNABEL TO INSERT RECORD.

REGARDS
Re: Problem with a form in insert statement [message #430959 is a reply to message #430953] Fri, 13 November 2009 07:23 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
> oerr ora 1400
01400, 00000, "cannot insert NULL into (%s)"
// *Cause:
// *Action:


You're supplying a null value for a not null column. Work out which one and supply a value.
Re: Problem with a form in insert statement [message #430962 is a reply to message #430959] Fri, 13 November 2009 07:34 Go to previous messageGo to next message
@M.salah@
Messages: 4
Registered: November 2009
Location: Saudi arbia
Junior Member
let me tell you the story is that import from excel sheet all the data is imported good except the hire date because ole2 don't support date , so i make the hire date as a char in the form and when insert the record i use to_date method.
the value is already exist but can't be inserted
if you check the attached form you will find what i tell you

Regards
Re: Problem with a form in insert statement [message #430965 is a reply to message #430953] Fri, 13 November 2009 07:48 Go to previous message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
If :hire_date has a value then it's not the cause of this problem - you'd get a different error if it was.
So assuming it has a value it's a different column that is causing the problem.
Post a desc of the employees table.
Previous Topic: How to use SImplified Chinese and traditional chinese
Next Topic: email from form6i
Goto Forum:
  


Current Time: Sat Dec 03 08:16:13 CST 2016

Total time taken to generate the page: 0.09462 seconds