PostgreSQL cursor example (create a cursor and traverse it in the function)
-- Drop function top100cur (refcursor );
Create FunctionTop100cur (refcursor)ReturnsRefcursorAs$
Begin
Open$1For Select*FromPersons limit 100;
Return$1;
End
$
/****
Generate air ticket database Test Data
@ Author zdw
*****/
ALTERProc [dbo]. [init_all]
As
-- City Data
ExecDbo. init_city
-- Airport data
ExecDbo. init_airport
-- Airline
ExecDbo. init_airline
-- Other basic data
ExecDbo.
We can directly modify it through the SQLPLUS client, or in linux, but the commands are the same.
Next we will focus on the introduction in linux:
Su-Oracle
Sqlplus/nolog
Connect/as sysdba
Alter system set processes = value scope =
For more information about rownum and rowid, see:
For details about how to use rownum paging, refer to the following SQL
Select*From (
SelectT1.*, RownumRnFrom (
Select*FromScott.EmpOrder BySalDesc --Here is the sorted table
)T1Where Rownum 8
Create test table
Create table base_users
(
Userid varchar2 (16 ),
Username varchar2 (32 ),
Passwd varchar2 (16)
) Tablespace cat_data;
Insert one by one
Create or replace procedure insert_data_one_by_one (n in number)
As
CurrentId number (16): = 0;
-- I am a beginner in Oracle. I don't know if there is any better way.
Create table PASSWD_CHANGED(USER_NAME VARCHAR2 (20 ),OLD_PASSWD VARCHAR2 (100 ),NEW_PASSWD VARCHAR2 (100))
Create or replace function my_password_verify (username
Restore with RMAN
1. Use the restore command
Read the data blocks in the backup file, and store the data blocks in the corresponding data files according to the data files to which the data blocks belong, so as to restore the data.
2. Use the
1. Prepare the system environment before installing Oracle 11g R2 database
1. view the system version, kernel version, number of operating system digits, memory and swap partition size, file system space, host name, IP address, and so on.
[Root @
DBMS (Data Base Management System) database Management System, as its name implies, is a Data Management System. Data must first be available and then managed through instances, an instance is a memory structure and background process. In short, it
Statement for inserting database data:Insert into testtab (FIELD1) VALUES ('test ')If the string to be inserted to the database contains single quotation marks, escape is required. For example, to insert "It's a tree.", the SQL statement is as
After installing Oracle10g, everything works properly. However, when the preferred language of the client browser is Chinese (Chinese/China [zh-cn, the EM button may contain garbled characters (EM will automatically select the Display language based
MongoDB is a scalable and high-performance open-source NoSQL document database. It is mainly developed using C ++. For document storage, full index support, replicable and high availability, automatic sharding, and other features. Among
First, let's look at the table we want to query:
SQL>SELECT*FROMEMP;
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
------------------------------------------------------------
7369 smith clerk 7902 800.00 20
7499 allen salesman 7698 1600.00 30
-- Log on to Oracle
Sqlplus/as sysdba
-- Query lock Information
Select t2.username, t2.sid, t2.serial # from v $ locked_object t1, v $ session t2 where t1.session _ id = t2.sid and rownum
Result:
Username sid serial #---------------------------
We use hibernate (hereinafter referred to as h) to manage the association between database tables. The basic principle is actually very simple, that is, to transfer the association between tables in the database to the class of the Entity bean,
This error occurs when you use RMAN to back up database archive logs, "RMAN-8137: WARNING: archived log not deleted as it is still needed ".
This is a prompt that the archive file operation failed after the archive log is backed up.
The script for
Sys @ TARGETAD> select * from v $ version where rownum
BANNER--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
This error occurs when the foreign
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