To simplify the process, I have created a unified database check account on multiple ORACLE data, and my account can only access several specific views (the SQL statements to be queried have generated views ), the procedure is as follows:
Root>
1 The syntax of the SQL statement is verified.
SQL syntax check
2 The data dictionary is searched to verify table and column definitions.
Checklist name and field name from data dictionary
3 The data dictionary is searched to verify security
First, write a batch processing file and give an example.
CopyCodeThe Code is as follows: Set RQ = % Date :~ 0, 10%
Exp system/system's password @ local service name file = D: \ backup \ Bak % RQ % full = Yes log = D: \ backup \ Bak % RQ % buffer =
However, using stored procedures has at least two obvious advantages: speed and efficiency. It is faster to use stored procedures. In terms of efficiency, if the application needs to perform a series of SQL operations at a time, it needs to migrate
1. Su-Oracle is not required. It is suitable for use without a DBA password. You do not need a password to enter the sqlplus interface.
2. sqlplus/nolog, sqlplus system/manager, or./sqlplus system/manager @ ora9i;
3. SQL> connect/As sysdba;
Once the Oracle database is successfully installed, the related database information is displayed:
Global Database Name: Oracle
System identifier (SID): Oracle
Server parameter file name: C: \ oracle \ product \ 10.2.0 \ db_1/dbs/spfileoracle. ora
The first case is that the returned cursor is the data of a specific table or view, for example:
SQL-code:
CopyCode The Code is as follows: Create or replace procedure p_testa (
Presult out sys_refcursor
)
As
Begin
Open presult for select * from
Software environment:
1. Operating System: Windows 2000 Server
2. Data Base: Oracle 8i R2 (8.1.7) for NT Enterprise Edition
3. installation path: C: Oracle
Implementation Method:
1,
D:> set nls_lang = american_america.usacii7
Or
D:> set nls_lang =
Add a user (a schema with the same name as the user is automatically generated as the user is created)
Create user "tester" Profile "default" identified by "tester" default tablespace "testdata" temporary tablespace "testtemp" account unlock;
(To
The idea of Oracle paging stored procedures is the same as that of SQL Server, but I have made some changes here because of the differences in Oracle syntax and rules, the Oracle paging Stored Procedure looks a little different. Smile!
Cursor
What is a multiline string (connection string), for example:
SQL> DESC test;
Name type nullable default comments
------------------------------------------
Country varchar2 (20) y
City varchar2 (20) y
SQL> select * from test;
country city ----
The original statement is as follows:
Select sum (sl0000) from xstfxps2 whereDhao00 in (Select dhao00 from xstfxps1 where trunc (ywrq00) = trunc (sysdate)And khdm00 = '000000 ');Time in use: 00: 02: 49.04Execution Plan-----------------------------
I. Creation and use of stored procedures
1. Create a package and create a stored procedure in the program
Create or replacePACKAGE NCS_ICP_TJ/* Lfx@ncs-cyber.com.cn *//* TODO enter the package Declaration (type, Exception error, method, etc.) here )
The following describes the hard-working processes in the background. System Monitor (SMON), Process Monitor (PMON), Database Writer (DBWn), Log Writer (LGWR) checkpoint Process (CKPT)
1. SMON: Install and open the database. Install the database by
1. ASCII
Returns the decimal number corresponding to the specified character;
SQL> select ascii (A) A, ascii (a) a, ascii (0) zero, ascii () space from dual;
A ZERO SPACE
------------------------------------
65 97 48 32
2. CHRReturns the
Raise a code segment and ask for help.
The code snippet is as follows:
Copy codeThe Code is as follows: declare
Type t_indexby is table of number
Index by binary_integer;
Type t_nesteed is table of number;
Type t_varray is varray (10) of
This is written for oracle and can be used on different computers, because it will automatically read the environment variables of the current computer to obtain the oracle installation path, the only drawback is that an intermediate text file will
Duplicate data may be in the following two cases: the first is that only some fields in the table are the same, and the second is that the records in the two rows are the same.
1. Deletion of duplicated data in some fields
1. query duplicate
/*
The younger brother just came into contact with the ORACLE stored procedure and asked me a question. The younger brother wrote a stored procedure to receive a parameter as the table name, then, you can query the content of one field of all
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