Oracle Cursor Summary

1. Declaring cursorsDeclareteacher_id Number(5); Teacher_namevarchar2(5); Teacher_titlevarchar2( -); Teacher_sexChar(1);cursorTeacher_cur is SelectTid,tiname,title,sex fromTeacherswhereTid117;2. Open the cursorOpen cursor name;Declareteacher_id

Oracle Learning Article 12: Indexing

Index:Query user_indexes can get more information about the indexes that the user has created.Query user_ind_partitions can get detailed information about the partition index that the user has created.Query User_ind_columns can get detailed

Oracle Related Knowledge

1. Data typeVARCHAR2 ()Number ()DATEClobBlob2. Copy table: CREATE TABLE TableName as SELECT * from emp3. New column: ALTER table name Add (field Name field type default defaults);4. Modify columns: ALTER table name MODIFY (field Name field type

Verify that the table name exists and is deleted before Oracle deletes the table

DECLARE num number; Beginselect COUNT (1) into NUM from user_tables WHERE table_name = UPPER (' TableName '), IF num > 0 Then EXECUTE immed Iate ' DROP TABLE tableName '; END IF; END;  Multi-table casedeclare num number; NUM1 number;num2

Oracle self-Increment ID implementation

First, create a table: CREATE TABLE Example ( ID Number (4) Not NULL PRIMARY KEY, NAME VARCHAR (25)); Then, customize a sequence (sequence): CREATE SEQUENCE example_sequence INCREMENT by 1--add a few each time

Oracle View Parameters

To create a package:Create or Replace package P_view_param isfunction Set_param (num number) return number;function Get_param return number;End P_view_param;To implement the package body:Create or Replace package body P_view_param isParamvalue

Oracle in If/else

1. Standard SQL specificationOne, single IF1, if A= ... Then.........end if;2, if a= ... then......else....end if; two, more IfIf a=. Then......elsif a=. Then....end if; The middle here is "elsif", not else IF. Special attention is needed

Data types in Oracle

Data types in Oracle/*data types in ORACLE; char length fixed range: 1-2000 VARCHAR2 length variable range: 1-4000 long length variable maximum range 2gb longer character type numb ER numeric number (p,s) date type, accurate to seconds TIMESTAMP

Oracle timers, call stored procedures, and periodically add values from n tables to a local table

--Creating a stored procedure for adding a local database Create or replaceprocedure Pro_electric_record as begin insert into Electric_meter_record (Id,basestati On_id,name,meter_number,createtime) Select Sys_guid (), substr (s.sname,0,36),

Linux Oracle Database overall migration or backup

The Expdp:sql command executes only once and does not need to be executed again.Mkdir/home/oracle/backupchmod 777/home/oracle/backupSql> Create directory Expdir as '/home/oracle/backup ';Sql> Grant Read,write on the directory Expdir to Deepradar;Sql>

Oracle Learning Chapter Four: Multi-table Query

-----------------Produce Cartesian product------------------------------------SELECT * from Emp,dept; --with no conditions, the number of records is 14*4 = 56 recordsSELECT * from the EMP Cross join dept;--crossover connection, IBID.Select COUNT (*)

Oracle Query Exercise 24-28

24. The name of the teacher who has more than 5 students who have enrolled in a courseSelect from where t.tno= and C.cno=and =( Selectfromgroupby hasCount(CNO)> 5 Group by T.tname25. Check the records of all students in class 95033 and

Data Paging in Oracle

--Data paging scripts--Create a header structure that contains the data pagination code element declarationCreate or Replace package Data_controlIsType type_cursor_data is REF CURSOR;V_totalline int; --Total number of data rowsV_totalpage int;

[ORACLE DATAGUARD] Switchover process

1. Check the status of the main library:Sql> SELECT switchover_status from V$database;Switchover_status--------------------To STANDBY2. Set the main library to standby roleALTER DATABASE commit to switchover to physical standby;Shutdown

Oracle multiple import and export data methods

DMP Format:Export in 1.dmp format can be done through client-side tool (PL/SQL) operations, through the menu bar---->tools---->export Tables, then set to tick the appropriate parameters, rows represent whether to export with the data2. The export

SQL accumulation for Oracle: &, .... The Decode function uses

SELECT A.areaname AS Level two place name from houses h,houses H2,Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 andH.houseslevel=2 and H2.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2;SELECT *

Oracle Queries 12 Questions, etc.

12. Check the average score of the course with at least 5 students enrolled in the score table and begin with 3.Select cno,Count(CNO),avgfromgroup by has Count(CNO)>=5 and substr (CNO,0,1)=' 3'13, the query score is greater than 70, less than 90 of

Introduction to Oracle Memory Architecture

Oracle database is the world's most powerful database management software, the functional system is particularly large. It is necessary for us to learn about every part of it, and then to effectively grasp it from a global perspective. We will focus

Oracle Time function

additionSelect Sysdate,add_months (sysdate,12) from dual; --plus 1 yearsSelect Sysdate,add_months (sysdate,1) from dual; --Add JanuarySelect Sysdate,to_char (sysdate+7, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 weeksSelect Sysdate,to_char

Oracle Database-Database security management

I. Related content1. Verify system Rights Management.2. Verify role management.3. Verify profile Management.Second, the specific operationA1. Grant and recycle the system permissions according to the following requirements:(1) Create a user User1

Total Pages: 2147 1 .... 1287 1288 1289 1290 1291 .... 2147 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.