Home » Developer & Programmer » Forms » cudnt able to insert data from text box in forms (oracle 9.2.0.1.0 forms 6i. winxp)
icon5.gif  cudnt able to insert data from text box in forms [message #332251] Tue, 08 July 2008 00:58 Go to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

hey all,

i was trying to insert the datas into table online_reg but cudnt .can u advice me where is the exact problem located ?? .
everything done well except inserting,. .

declare
   		v_pass_word varchar2(10);
  		v_conf_paswd varchar2(10);
  		a number;
	
begin
		v_pass_word := :online_reg.pass_word;
		v_conf_paswd:= :online_reg.confirm_password;
 	
        		if 			
         	  		:online_reg.student_name  is null 
					 			 then
				   			message('enter the student name');
		    		elsif
          
          		:online_reg.user_name  is null 
		     			then
		     			message('enter the User name');
          	
        	elsif 
        				:online_reg.pass_word	is null 
					 		 	then
				   			message('enter the password');
        		
        		elsif 	
        			 :online_reg.confirm_password	is null 
					  		then
				   			message('confirm password');
        	 	elsif 
        	 		:online_reg.dob  is null 
		    			then
		    			message('enter the DOB');
						elsif
			   	 		 :online_reg.email_id is null 
		    				then
		    				message('enter the Email Id');
	 					elsif
			    	
			    		 :online_reg.phone is null 
			   	  	then
		    			message('enter the Phone No');
	 					end if;
	 					if  v_pass_word != v_conf_paswd then
        				a := show_alert('ALERT_INVALID');
        				go_item('confirm_password');
        		END if;	
        insert into online_reg(student_name,user_name,pass_word,dob,email_id,phone)
        values(:online_reg.student_name,:online_reg.user_name,:online_reg.pass_word,:online_reg.dob,:online_reg.email_id,:online_reg.phone);
        
exception
when others then
a := show_alert('ALERT_ERROR');
end;





thanks in advance.
Re: cudnt able to insert data from text box in forms [message #332254 is a reply to message #332251] Tue, 08 July 2008 01:01 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

formatted code
/* Formatted on 2008/07/08 11:31 (Formatter Plus v4.8.8) */
DECLARE
   v_pass_word    VARCHAR2 (10);
   v_conf_paswd   VARCHAR2 (10);
   a              NUMBER;
BEGIN
   v_pass_word := :online_reg.pass_word;
   v_conf_paswd := :online_reg.confirm_password;

   IF :online_reg.student_name IS NULL
   THEN
      MESSAGE ('enter the student name');
   ELSIF :online_reg.user_name IS NULL
   THEN
      MESSAGE ('enter the User name');
   ELSIF :online_reg.pass_word IS NULL
   THEN
      MESSAGE ('enter the password');
   ELSIF :online_reg.confirm_password IS NULL
   THEN
      MESSAGE ('confirm password');
   ELSIF :online_reg.dob IS NULL
   THEN
      MESSAGE ('enter the DOB');
   ELSIF :online_reg.email_id IS NULL
   THEN
      MESSAGE ('enter the Email Id');
   ELSIF :online_reg.phone IS NULL
   THEN
      MESSAGE ('enter the Phone No');
   END IF;

   IF v_pass_word != v_conf_paswd
   THEN
      a := SHOW_ALERT ('ALERT_INVALID');
      GO_ITEM ('confirm_password');
   END IF;

   INSERT INTO online_reg
               (student_name, user_name,
                pass_word, dob, email_id,
                phone
               )
        VALUES (:online_reg.student_name, :online_reg.user_name,
                :online_reg.pass_word, :online_reg.dob, :online_reg.email_id,
                :online_reg.phone
               );
EXCEPTION
   WHEN OTHERS
   THEN
      a := SHOW_ALERT ('ALERT_ERROR');
END;


Re: cudnt able to insert data from text box in forms [message #332258 is a reply to message #332251] Tue, 08 July 2008 01:04 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

online_reg table script
CREATE TABLE online_reg(student_name VARCHAR2(10),user_name VARCHAR2(10)
 NOT NULL CONSTRAINT check_user_name CHECK (LENGTH(user_name) BETWEEN 5 AND 12),
pass_word VARCHAR2(10) NOT NULL,dob DATE ,email_id VARCHAR2(20),phone VARCHAR2(10),
CONSTRAINT uni_cols UNIQUE (user_name,email_id))
Re: cudnt able to insert data from text box in forms [message #332275 is a reply to message #332258] Tue, 08 July 2008 01:30 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Remove the exception handler and try again.
Never use when others exceptions without a re-raise, and especially not while debugging.
Also, does the expected message from the if-elsif branch pop-up?
Re: cudnt able to insert data from text box in forms [message #332280 is a reply to message #332251] Tue, 08 July 2008 01:42 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

thanks frank for your reply..
but i dint get this
Quote:
Also, does the expected message from the if-elsif branch pop-up?
..
Re: cudnt able to insert data from text box in forms [message #332282 is a reply to message #332251] Tue, 08 July 2008 01:47 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

when i removed the exception handler it returns me an error:
frm-40735 : when button pressed trigger raised unhandled exception ora-02290 ..

for more details find the attachment ,.

  • Attachment: form.JPG
    (Size: 33.05KB, Downloaded 129 times)
Re: cudnt able to insert data from text box in forms [message #332288 is a reply to message #332282] Tue, 08 July 2008 02:04 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
And I am sure you searched to find out what ORA-02290 means?
icon9.gif  Re: cudnt able to insert data from text box in forms [message #332295 is a reply to message #332251] Tue, 08 July 2008 02:18 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

i entered the data with confirming check and unique constraints .despite still its showing me an error frm-40508..

pls help me frank
  • Attachment: form1.JPG
    (Size: 42.59KB, Downloaded 102 times)
Re: cudnt able to insert data from text box in forms [message #332367 is a reply to message #332295] Tue, 08 July 2008 06:18 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Sorry, but in all these years I've been working with Oracle, I never ever caught it lying..

Better check the values you try to insert, check if it really IS this insert that fails and check if there are triggers on the table you insert into.
Previous Topic: How can i create a form?
Next Topic: Cursor
Goto Forum:
  


Current Time: Sat Dec 03 18:21:30 CST 2016

Total time taken to generate the page: 0.27389 seconds