Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> SQL*PLUS problem!!!

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: SQL*PLUS problem!!!
 shahin  Posted: May 08, 2007 10:21:58 AM

 Total Post: 2
 Joined: May, 2007






 Hi,
I'm larner of Oracle DBA? I created some tables, views and indexes in my schema and they created successfully. But when I tried to create a type or a database trigger, it nither created or send me any error message.
They looked like
SQL> CREATE TYPE cust_address_typ
2 AS OBJECT
3 ( street_address VARCHAR2(40)
4 , postal_code VARCHAR2(10)
5 , city VARCHAR2(30)
6 , state_province VARCHAR2(10)
7 , country_id CHAR(2)
8 );
9


SQL> CREATE OR REPLACE TRIGGER insert_ord_line
2 BEFORE INSERT ON order_items
3 FOR EACH ROW
4 DECLARE
5 new_line number;
6 BEGIN
7 SELECT (NVL(MAX(line_item_id),0)+1) INTO new_line
8 FROM order_items
9 WHERE order_id = :new.order_id;
10 :new.line_item_id := new_line;
11 END;
12

Could anybody help me to solve the problem? Thanks

 Srimayee
Posted: May 09, 2007 01:17:51 AM  

 Total Post: 7
 Joined: Dec, 2005






 
Hi Shahin,

Looks like your SQL statements have not been executed. Just put a / at the end of the statement and get it executed.

Somewhat like this :
SQL> CREATE OR REPLACE TRIGGER insert_ord_line
2 BEFORE INSERT ON order_items
3 FOR EACH ROW
4 DECLARE
5 new_line number;
6 BEGIN
7 SELECT (NVL(MAX(line_item_id),0)+1) INTO new_line
8 FROM order_items
9 WHERE order_id = :new.order_id;
10 :new.line_item_id := new_line;
11 END;
12 /

Hope this helps you.

Regards,
Srimayee.

 shahin
Posted: May 09, 2007 09:02:32 AM  

 Total Post: 2
 Joined: May, 2007






 
Hi,
I solved the problem. Thank you very much anyway.

Shahin

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik387
  Vinoth Kumar379
  Gopu Gopi350
  Gitesh Trivedi322
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software