Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting problem

Status
Not open for further replies.

mbrent

Programmer
Dec 18, 2001
20
US
I am having a problem inserting into my table. I know that all the data is there because I ran the form in debug and I can see all the data on the stack. I keep getting an ORA-00001 error. Could someone please help me figure out what I am doing wrong.

Thank you!
 
Sorry, I am not suggesting you don't understand your requirements.
I am saying that we may be having problem understanding your requirement which may be why everyone is coming up with conflicting solutions.
 
No offense taken, I just didn't really know how to answer. I am going to try to figure this out. Thanks to everyone for your help!
 
Maybe you all could give me some suggestions on some books I can buy to help me.

Thanks again!
 
Ok, I took the sequence off the field and was able to insert fine. Can someone tell me why the sequence was causing the problem?
 
Hello mbrent,

I've been out of the office and you have been having some fun. First, my favorite resource for forms is actually just the help reference that comes with forms. After seven years of working with forms, it has served me well, but the most important thing is to look at the flowcharts section. (Help Topics - type in flowchart) You can really mix yourself up by trying to avoid this. For example the On-insert trigger will replace the default form builder processing, so if you have any base table fields you think are populating and you haven't included them in your on-insert trigger (refer to insert_record built-in), they aren't.

After 14 years I still use my
"Oracle SQL*Plus Definitive Guide"/O'Reilly
ISBN 1-56592-578-5
and my Oracle PL/SQL Programming/Oracle Press
ISBN 0-07-882176-2
without shame in addition to the forms help.

As far as your sequence goes, you don't have to set the value to a variable anymore. Your insert statement can directly refer to seq.nextval. Even though it seems everything should work as you think sometimes, nothing beats some good troubleshooting, as in, did you ever try the insert from sqlplus? It usually really does give you a better clue and often when I try to skip this step I pay for it later. Especially as you try to write inserts for tables with a hundred or so fields.

Let me know if you want to write directly. I empathize with your situation as it can be very frustrating sometimes. There are many situations that make you scratch your head until you dig a little deeper.
Good Luck.
 
Thanks for the suggestions. I will take a look at the flowcharts, and I am also going to check into the books you mentioned.

I am definitely find out the true meaning of frustration.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top