Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2009, 07:25 AM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem Inserting a Row

Hello all.

I'm slowly learning SQL and how to use form builder 6. The situation is I have a simple table named 'players' within the table I have three columns:
  • player_no (primary key)
  • position
  • goals
Within form builder 6 I have created a very simple form using these three fields. The form is named 'TEAM'. At at the foot of the form I have a button labelled 'Add'. The goal is for the user to enter a player_no, position and goals and then to click 'Add'. This information is then to go into my table.

All attempts so far have failed miserably. I have set up a trigger on the button (WHEN_MOUSE_CLICK). I have then entered the following code:

Code:
BEGIN
  INSERT INTO players ( player_no )
  VALUES ( :TEAM.player_no )
END
For the purpose of testing it out I have only been using the one (player_no) field. This then compiles with no errors yet when I run the form and enter a player_no and hit the button I get the following error in the status bar:

frm-40735: WHEN-MOUSE-CLICK trigger raised unhandled exception ORA-01400

Am I doing something horribly wrong? I am very much new to SQL and Form Builder so any help would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old March 2nd, 2009, 07:30 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. This forum is for generic SQL question. Your question relates more to ORACLE forms, which I don't remember is there a forum here. Anyway, We can try to solve it (at least is there any problem with the trigger). Can you show us the trigger code?
Did you google the error to have any description about it?

Thanks.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
Reply With Quote
  #3 (permalink)  
Old March 2nd, 2009, 07:49 AM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello gbianchi,

Sorry if this is in the wrong place. Here is the most recent trigger code I have written:

Code:
BEGIN
 INSERT INTO PLAYERS ( PLAYER_NO, POSITION, GOALS  )
 VALUES ( :TEAM.PLAYER_NO, :TEAM.POSITION, :TEAM.GOALS);
END;
From what I understand the colon : in the trigger means refer to the value in the corressponding form field, I may be wrong though as I am only begginning to learn this stuff.

I also googled the error and I cannot find what it specifically refers too.

EDIT: I have just saved the form and re loaded it and when I compile the trigger I now get this error "Identifier STUDENT must be declared".

Could this be the problem?

Any sort of help would be great.

Last edited by Ronnie TRFC; March 2nd, 2009 at 07:52 AM..
Reply With Quote
  #4 (permalink)  
Old March 2nd, 2009, 07:54 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Ok, I'm not an expert in this matter. Here are some ideas:

Catch the error in the trigger and see his description.
Are you maybe trying to insert null values into not null column?
if you just run the sql outside the trigger, do it work?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
Reply With Quote
  #5 (permalink)  
Old March 2nd, 2009, 08:04 AM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help so far.

I have ran the code in SQL plus 8 and the row is added successfully so I do not think it is a problem with Null values.

When I complie the trigger alone in form builder I get this error message:

identifier STUDENT must be declared

Does this help?

Thanks again gbianchi.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem when inserting dates jhansib4u SQL Server DTS 1 January 28th, 2008 11:06 AM
Problem in inserting a new row in MS Access yzlin04 VB.NET 2002/2003 Basics 2 July 18th, 2007 11:11 PM
Problem with inserting a new row in MS Access yzlin04 VB Databases Basics 0 July 15th, 2007 11:23 PM
Problem while inserting rows!! raman1 PHP Databases 0 April 16th, 2005 12:03 AM
Inserting a new row in Cross Tab.... safecoder Crystal Reports 0 October 20th, 2004 10:08 AM



All times are GMT -4. The time now is 06:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.