What pl/SQL must understand:1. process, function, trigger is pl/SQL programming2. process, function, and trigger are in Oracle3. pl/SQL is a very powerful database process Language4. process. functions can be called in java progra
I found a
This book starts with some of the most basic knowledge and works with easy-to-understand examples to help you get started with simple knowledge points at and then go deeper step by step, each step will be used in concert with the example to explain to you. One small step at a time is the foundation of the next step, until the usage is relatively advanced.
Oracle10g PL/SQL
Oracle Database Programming: Change Data and management items in PL/SQL change data and manage items in PL/SQL: returning clause of DML statements: to obtain the information after the insert, update, and delete statements are exec
Pl/SQL block that only contains the execution part
Set serveroutput on -- enable output options
Begin
Dbms_output.put_line ('hello ');
End;
Instructions:
Dbms_output is a package provided by Oracle locks (similar to java). This package contains some processes. put_line is a process in the dbms_output package.
The set serveroutput on Clause indicates that t
%rowtype; --Define variables that can store an EMP table row of data begin SELECT * into Rowvar_emp from EMP where empno=7369; /* Output Employee information */ dbms_output.put_line (' Employees ' | | rowvar_emp.var_ename| | ' The position is ' | | rowvar_emp.var_job| | ' wages are ' | | Rowvar_emp.var_sal); end; /Output Result:Employee Smith's job is clerk, salary is 2712.5-----------------------------------define variables and constants-----------------------------------1. Defining variablesC
The main content of this article is as follows:
6.1 Introduction
6.2 create a function
6.3 stored procedures
6.3.1 creation process
6.3.2 call a stored procedure
6.3.3 AUTHID
6.3.4 PRAGMA AUTONOMOUS_TRANSACTION
6.3.5 procedure
6.3.6 deletion process and Function
6.3.7 comparison of processes and functions
6.1 IntroductionProcedures and functions (In addition, packages and triggers) are named PL/SQL blocks (
Oracle Database Programming: PL/SQL program control structure: condition control: if statement: if condition 1 then if condition 1 is true execute the statement here ...... Elsif condition 2 then if condition 2 is true, execute the statement here ...... If both conditions 1 and 2 of else are not true, execute the state
taxV_tax_sal:=v_sal*v_tax_rate;--OutputDbms_output.put_line (' Name: ' | | v_ename| | ' Wages ' | | V_sal | | ' Tax: ' | | V_tax_sal);End--Composite Type composite----PL/SQL records a struct similar to a high-level language--Define a plsql record type Emp_record_typeDeclareType Emp_record_type is record (Aname emp.ename%type,salary emp.sal%type,title emp.job%type);--Defines a variable sp_record the type of
= ' sql ';--DeleteDelete from table (select Ss.score from Stuinfo ss where Stuid = 3) twhere t.subname= ' SQL ';The similarities and differences between----variable arrays and nested tables----------------Same point:1, are abstract types2. Can be used as a data type for a column in a table (record and fast table are not data types for columns)Different points:1. The mutable array itself is stored in the or
cascadeINSERT into Person3 values (3, ' Yuan ', ' Weixiang ', Varray_phone (' 12345 ', ' 34567 ', ' 56789 ', ' 34567 ', ' 56789 '));4. Cursors? Description: In PL/SQL programming, it is sometimes necessary to do a row-by-line processing of the query return result set, which requires that the query return the result set to a memory area, in order to be able to pe
the number of elements in the variable-length array.
Alter type varray_phonemodify limit 2 cascade -- an error is reported. The varray limit can only be increased.
Alter type varray_phonemodify limit 5 cascade
Insert into person3 values (3, 'yuanyuan ', 'weixiang', varray_phone ('000000', '000000', '000000', '000000', '000000 '));
4. cursor
Introduction: In the PL/SQL program design, you sometimes need to
Label:The seventh chapter is also quite miscellaneous, see not very clear. Although I finished it, I felt that I had not got too many things and had to go back to see them.
See this CHR function,
The original is to turn the number into ASCII code, such as Chr (10) is the carriage return.BEGIN Dbms_output.Put_Line (' Gogo ' | |CHR (10) | | ' Tot '); end;/Use here | | To connect characters, or you can use Concat to connect. However, Concat has only two parameters, that is, connecting two s
Tags: Oracle for whileSELECT statement1. If...then statementsGrammar:If Condition_expression: Represents a conditional expression whose value is true when the program executes the PL/SQL statement below if;If the value is False, the program skips the statement following the IF statement and executes the statements immediately after the end If.The statement to exe
ondeclare vnum number;begin vnum:=1/0; --handling Exception exception when zero_divide then Dbms_output.put_line (' exception: by 0 '); end;/Operation Result:10. Custom ExceptionsSet Serveroutput on;--Custom Exception declare -declares an exception type my_exception exception; begin -Throws an exception raise My_ Exception; Exception --Exception handling when My_exception and then Dbms_output.put_line (' Custom exception '); end;Operation Result: Copyright NOTICE: This arti
PL/SQL Basic structurePL/SQL data type Numeric type: Number (p,s), Pls_integer, Binary_integerCharacter types: CHAR, NCHAR, VARCHAR2, NVARCHAR2, LONGDay Type: DateBoolean Type: BooleanDefine data type: typeType Data type: Oracle allows you to define Recode, TABLEPL/SQL Const
=spno;End-----3. How to call in Java---1. Create CallableStatement CS =ct.preparecall ([Call Sp_pro9 (?,?)]);----Cs.setint (1,10);----Cs.registeroutparameter (2,oracle.jdbc.oracletypes.cursor);--run--cs.execute ();--Get the result set/*resultset rs= (ResultSet) Cs.getobject (2);while (Rs.next ()) {....}*/---------------------Exception Handling---------Case_not_foundData_not_foundCursor_already_openDup_val_on_index Unique index repeatedInvaild_cursor run operation on an illegal cursor for example
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.