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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing a procedure

Status
Not open for further replies.

mbames

Programmer
Jun 5, 2003
29
GB
I seem to be failing to write a proper procedure and I am not sure why. Initially I tried using the oracle manager gui wizard thing to create a procedure, but it seems to require two lots of names (and then told me my query was invalid at line 1, col 7).

I then tried writing via SQL*Plus, but that did not seem to realise I had got to end of the string (either when I wrote it on one line, or over multiple lines), either way I had a matching set of brackets and a ; at the end.

I then tried the SQL scratch pad and that accepted what I was typing in, but did not seem to generate the producte anywhere. I have spent a good part of the day, and seem to be no closer than when I started!

I shall re-type my code below:

Code:
CREATE OR REPLACE PROCEDURE mba_insert AS
BEGIN
  INSERT INTO mbames.mba (id, name) values (2, "fred");
END;

Any help is greatly appreciated. I am begining to wonder if I need to go on a basic oracle course!

Cheers,
Matt
 
Replace your double quotes " around fred with single quotes 'fred'. Other wise your procedure looks fine, so long as you have a tbl mbanmes.mba in your database.

 
I did not take an Oracle class and I have been using Oracle for 3 years now. I learn something new with Oracle, sql plus, and stored procedures almost everytime I use it. I also have the luxury of working with numerous people who have been trained in Oracle. I would love to go back and take an Oracle class at this time. I also feel that an Oracle class could have speed up my productivity levels greatly, as I was learning basic Oracle stuff early on.

If you can afford it and you have the time, I would recommend taking an Oracle class. You learn so much more by being hands on. And the best place/way to get hands on exposure is with people who are already experienced, ie in a classroom setting.

Good Luck!!!

 
All sorted.. I was getting confused by the GUI! Now I just need to figure out how to call the procedure from MS Access (queryDef I think?!)!

Thanks,
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top