Oracle
1. Create an oracle Stored Procedure
Create or replace procedure proce_test (paramin in varchar2, paramout out varchar2, paraminout in out varchar2)
As
Varparam varchar2 (28 );
Begin
Varparam: = paramin;
Paramout: = varparam | paraminout;
End;
Batch insertion is required in the Project. To prevent duplicate data insertion, you must first determine whether the inserted data already exists. If yes, ignore this insertion; otherwise, insert this data, at the beginning, we first use an SQL
1. Connect to the database
C: \ Documents ents and Settings \ Administrator> sqlplus/nolog
SQL * Plus: Release 10.1.0.2.0-Production on Saturday May 14 11:14
Copyright (c) 1982,200 4, Oracle. All rights reserved.
SQL> Conn/Sysdba
Connected.
Common sqlplus commands
SQL> Help Index
Enter help [Topic]Help.
@Copy pause Shutdown
@@Define print Spool
/Del prompt sqlplus
AcceptDescribe quit start
AppendDisconnect recover startup
Archive logEdit remark store
AttributeExecute
I encountered a problem in the group today. I think it's a bit interesting. Let's take a look at it.
BelowCodeIf the test passes in MySQL, MSSQL should be able to run without testing.
# Create a table as follows Create Temporary
Navicat for XXX is an excellent database management client with MySQL, Oracle, and other versions. We recommend that you use the Enterprise version with comprehensive functions. However, compared with the Free Lite version, the enterprise version
First define a cursor:
Procedure p_myproc (
Pi_param varchar2
) Is
Vi_a varchar2 (10): = '';
Vi_ B varchar2 (20): = '';
Vi_c varchar2 (30): = '';
-- Definition
Cursor mycur is
Selece T. A, T. B, t.c
From tbl_mytable T;
There are three ways to start the Oracle service:1 slave control panel2 Use MS-DOS commands3. Use Oracle administration assistant for WindowsNT
-Start the Oracle service through the control panel1) choose Start> Control Panel> Management Tools>
The following are SQL statements automatically generated by Oracle export backup and import recovery.Source codeEach variable has the following meanings:Exp_back_dir: directory where the DMP file of the Oracle database is exportedScript_file:
1. Oracle startup and Shutdown
1. In a single-host environment
To start or shut down the Oracle system, you must first switch to the Oracle user, as shown below:
Su-Oracle
A. Start the Oracle System
Oracle> svrmgrl
Svrmgr> connect internal
Svrmgr>
Many parameters are required to optimize the Oracle database. Some of these parameters have a great impact on the system performance. These parameters are variable parameters.Variable parameters can be divided into two categories based on their
Nvl (string1, replace_with)
Function: If string1 is null, The nvl function returns the value of replace_with; otherwise, the value of string1 is returned.
This nvl serves the same purpose as isnull (string1, replace_with) in sqlserver.
Note:
-- Create a scheduling taskDeclareJobno number;BeginDbms_job.submit (jobno, -- timer ID, automatically obtained by the SystemWhat => 'P _ update_t_bs; ', -- p_update_t_bs indicates the name of the stored procedure.Next_date => to_date ('20170101',
Not supported: 24:00:00 formatApril 22 0:00:01 is (a bit depressing)
1. date to character:
Select sysdate, to_char (sysdate, 'yyyy-mm-dd hh24: MI: ss') from dual
2. character to date:
Select to_date ('2017-03-13 21:15:37 ', 'yyyy-mm-dd hh24:
Optimization rules:
1. In CBO mode, the table is queried from right to left, and the first on the right is the base table.Select a small number of rows as the base table,For three or more tables, You must select a crosstab chart (Table connected
Implicit cursor
Begin
Update try set score = 60 Where course No. = 'c008 'and score
If SQL % notfound then
Dbms_output.put_line ('there is no score below 60! ');
End if;
End;
/
-- Use of cursor Variables
Declare
Type cursor_type
1. Create a table in PLSQL:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Create
Table
Hwqy. Test (carno
Varchar2
(
30
), Carinfoid
Number
)
2. Create a stored
It is much more difficult to perform associated updates in Oracle than in SQL Server,Join two table updates, so this is not necessary. It is a bit depressing...
Update
T_gd_warebase
Set
Wareqty
=
(
Select
Sum
(B. qtyky)
From
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