Oracle database exception handling and views

Source: Internet
Author: User

PL/SQL Exception handling

Exception handling when the input number is not in the case

declare-- definition v_ename emp.ename%type;begin--Selectfromwhere Empno = &gno;dbms.output.put_line (' name:'| | v_ename); Exceptionwhen no_data_found thendbms_output.put_line (' no number! ' ); end;


--Custom exceptions

Create or Replace procedure Ex_test (spno number) is-- definition exception myexcep exception;begin--set,where empno =  Spno; --sql%NotFound This is to indicate no update--raise MYEXCEP trigger Myexcepif sql%if ; Exceptionwhen myexcep thendbms_output.put_line (' no update'); end ;

Oracle View
A view is a virtual table whose contents are defined by a query, as with a real table, and the view contains a series of column and row data with names, but the view is not
The database exists as a stored set of data values, and row and column data is derived from the tables referenced by the query that defines the view, and is generated dynamically when the view is referenced.

The table requires disk space, and the view does not require
View Cannot add index
Use views to simplify complex queries

 as Select  from where sal<; Use view selectfrom asSelect  fromwhere emp.deptno = Dept.deptno; Select  from Myview2;

Oracle database exception handling and views

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.