Software Environment Windows 2000 + Oracle9iHardware environment CPU 1.8G + RAM 512 M Now we have two tables:T1 -- large table 10000 T1_FK_IDT2 -- small table 5000 T2_PK_IDT1 is associated with the primary key ID of T2. The simulation data is as
[Oracle Study Notes], oracle Study Notes
The content mainly includes:
(1) three cycles and their simplification
(2) Use of cursors
(3) Exception Handling
(4) Stored Procedure
(5) storage functions
(6) triggers
(7) Other pl/SQL operations
-----------
Variable declaration in PL/SQL programmingCreate the first program hello worldbegindbms_output.put_line ('Hello World'); end;/set serveroutput on; (output statement to dos window command) begindbms_output.put_line ('Hello World'); end; /You can see
Use JDBC to operate stored procedures and jdbc to operate stored procedures
You can use CallableStatement to perform JDBC operations on stored procedures.
The SQL statement for calling the stored procedure is: {call procedure_name [(arg1), (arg2)]}
Create and use packages for oracle Database SQL statements, oraclesql
-- Create a package
Create or replace package pkg_emp
As
Name emp. ename % type;
Procedure pro_emp (id emp. deptno % type, num out number );
Function fun_deptno (p_empno
Create a stored procedure for MySQL
Mysql stored procedure details
1. Introduction to stored procedures
The commonly used operating database language SQL statements must be compiled and then executed before execution. The Stored Procedure
Comparison between four methods for batch ORACLE update and four methods for oracle update
Software Environment Windows 2000 + ORACLE9i
Hardware environment CPU 1.8G + RAM 512 M
Now we have two tables:
T1 -- large table 10000 T1_FK_ID
T2 -- small
The instance parses the MySQL stored procedure and the calling method of the stored procedure, and the mysql Stored Procedure
Mysql added the stored procedure function after 5.1. The stored procedure runs inside mysql and the statements have been
After MYSQL exports an SQL statement:
DELIMITER $
Drop trigger if exists 'updateegopriceondelete' $
CREATE
TRIGGER 'updateegopriceondelete' after delete on 'mermerinfo'
FOR EACH ROW BEGIN
Delete from egoprice WHERE customerId = OLD. customerId;
END $
Mysql subversion Practice Notes (5) -- product system design (2): Regularly update the total clicks of products, and regularly update the total clicks
Continue to go back to instructor Shen's MYSQL subversion practice. First, let's review the
1. Introduction to stored procedures
The commonly used operating database language SQL statements must be compiled and then executed before execution. The Stored Procedure (Stored Procedure) is a set of SQL statements for specific functions, after
Example:
create or replace procedure test is v_count number(4); cursor v_c is select * from "t2VoucherHandNo"; begin select count(*) into v_count from "t2VoucherHandNo"; if v_count>1 then raise too_many_rows; else for
In ------ Traversal
Exists ------- exit when a condition is found
Not exists -------- exit if a condition is not met
Essential differences:
Exists because exist is an external driver, it uses indexes to retrieve data.
Because in is an internal
ORACLE-006: Remove and stop jobs, oracle006 remove jobs
Generally, you can use SQL to delete or stop a job.
Remove JOB: remove
Stop JOB: broken
First pass
Select * from user_jobs;
Find the job id, and then call
Dbms_job.broken or
Address: http://warehouse.itpub.net/post/777/488171
Call cannot be used in PLSQL and can only be used in sqlplus.
SQL> Create or replace procedure proc_test2 is3 v_count number;4 begin5 select count (*) into v_count from TT;6
Technorati label: before creating a table in PL/SQL, determine whether the table exists.
Delete the execution statement of the table if any.
Since PL/SQL is used for Oracle client operations, since SQL 2005 was used to execute "before creating a
1. PL/SQL recordsIntroduction: similar to the structure in advanced languages, you can use custom record types, record variables, and % rowtype to define record variables for processing a single row of data.
Benefit: You can regard this record set
Oracle stored procedure-getting started and debugging
Example:
Create or replace procedure pro_one (p_one in number, p_two out varchar2, p_three in out varchar2) is -- as -- variable declaration part v_str1 varchar2 (32): = 'initial Value Method 1 '
1.Select into from statement
Statement format:Select vale1, value2 into Table2 from Table1
The target table Table2 does not exist,Because table 2 is automatically created during insertion and the specified field data in table 1 is copied to
Title: rownum cannot be greater than> in Oracle
Switch from the network and make slight changes:
1. Description of rownum
For the rownum problem of Oracle, many documents say that ">,> =, =, between..." in SQL statements are not supported...
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