(V_empnoinch Number, V_ename outvarchar2, v_sal out Number) 3 is 4 5 begin 6 7 SelectEname,sal intoV_ename,v_sal fromEmpwhereEmpno=V_empno; 8 9Dbms_output.put_line ('Employee name is:'||v_ename); Ten OneDbms_output.put_line ('Employee Salary is:'||v_sal); AException - whenNo_data_found Then -Dbms_output.put_line ('Employee ID is error!'); the whenOthers Then -Dbms_output.put_line ('Others Error!'); - End;running under the system:
; - Closecur_emp; +
- End; ② reading cursor data through a For loop: Sql> Declare
2 cursorCur_emp is
3 Select * fromEmpwhereDeptno=No; 4
5 begin
6 forEmp_recinchCur_emp Loop7Dbms_output.put_line (emp_rec.ename||' , '||Emp_rec.sal||' , '||Emp_rec.deptno); 8 EndLoop; 9
Ten End; ③ cursors with parameters: passing parameters to Cursors Sql> Declare
2
3
SQL is a very basic and important knowledge in a relational database, although the backend Development class library like Laravel provides an ORM abstract data class that encapsulates a subset of simple SQL queries, so many times we don't need to relate the specifics of SQL can develop their own backend applications very quickly, but when it comes to relatively c
SQL sever2000 Green Edition, saying goodbye to the troubles of installing SQL during Software Distribution
Have you ever encountered such a situation, software developers, that is, the software we have worked hard to develop, and the database is based on
2E_emp_remain exception; 3pragma exception_init (E_emp_remain,-2291); 4
5V_empno Emp.empno%Type:=N; 6V_deptno Emp.deptno%Type:=nn; 7
8 begin
9 UpdateEmpSetDeptno=V_deptnowhereEmpno=V_empno; Ten Commit; OneException A whenE_emp_remain Then
-Dbms_output.put_line ('Department is NOT exists!'); - whenOthers Then
theDbms_output.put_line ('Others Error!'); - End; Get error codes and error messages in others: Sqlcode:oracle error code sqlerrm:oracle er
Python routine practice (1) -- batch sorting of Snippets of SQL Prompt, pythonsnippets
IntroductionI usually use the SQL Prompt plug-in when writing SQL scripts. In addition to the powerful smart Prompt and formatting SQL statement functions, I also like to use the Snippets
build a simple student management system. Although this tutorial is a preliminary tutorial, it is not suitable for 0-based shoes and is suitable for confused shoes. Speak nonsense and start with the question.
1. Why should I select the SQL database.
As an international practice, we should first explain why SQL database should be selected. In fact, it is
Clerk 7698 March-December-81 950 30For special symbols in fuzzy queries you can use escape identifiers to escape lookups, such as to find information about employees whose names contain characters ' \ ', you can use the following statement:SELECT * from emp WHERE ename like '%\_% ' ESCAPE ' \ ';where escape ' \ ' specifies the character ' \ ' as an escape character, ' \_ ' in the pattern string '%\_% ' is escaped to, or is represented by the character ' _ ' itself, and is no longer used as a wi
Tags: style blog http color os using SP file dataOriginal: SQL Server Enterprise Platform Management Practice reading notes-what to do when our backups are corruptedAs a database administrator the most painful is that when the database is down to need to find a backup, but at this time suddenly found that the backup file is also bad, which means that the data will be lost, this may lose the position, the jo
processing is intended to return the result set, Besides, I've already got the table A. field A, the final correct data is based on this field A to obtain, as long as it is not with the other two tables do not match the data can be the equivalent of organizing the wardrobe, the useless clothes out of this process. And the field a,b,c,d is the primary key of each table, there is no concept of NULL value, there is no need for additional judgment. So the last not-in is 3 seconds faster than not ex
Tags: font SQL case CAS customer add code customers any1. Each customer returns one line of the order date from ~ to ~SELECTE.empid,DATEADD( Day, D.N- 1,'20090612') asDT fromHR. Employees asE Cross JOINNums asDWHERED.n DATEDIFF( Day,'20090612','20090616')+ 1ORDER byEmpid, DT;2. Return to US customer and return order quantity and total quantitySELECTC.custid,COUNT(DISTINCTO.orderid) asNumorders,SUM(Od.qty) asTotalqty fromSales.customers asCJOINSales.o
Taking advantage of the remainder of the previous article, we continue to study how to dispatch multiple packages in SSIS, does it require a package configuration scheduler? Obviously not, so let's talk about how to schedule all of the jobs in the SSIS application in bulk, this article only covers a basic logical process and simple testing.1: Publish SSIS PackageDispatch package, we need to first publish the SSIS package to SQL Server's Integration se
(v_empno,v_ename,v_sal);EndFunctionfunction to return specific datafunction is called as part of an expressionFunctions can simplify the development of client applicationsImprove the execution performance of your application.Functions without any argumentsCreate or Replace function fun1return numberIsV_sum_sal Emp.sal%type;BeginSelect sum (SAL) into V_sum_sal from EMP where deptno=10;return v_sum_sal;EndDeclareV_sumsal Emp.sal%type;BeginV_sumsal: = fun1;Dbms_output.put_line (v_sumsal);EndUpgrad
method is recommended, mainly low costThere are several advantages:1, compared with the physical image of such technology, this scheme is more economical. Backup service hardware requirements are not high, as long as the hard disk is large enough.2. Although SQL Server provides several backup verification mechanisms, the only way to ensure full reliability of backup is to actually recover it.3, early recovery backup, so that when a real disaster occu
, localhost indicates local;-u is the database user name , root is the MySQL default user name,-p is the password, if the password is set, can be directly after- p link input, such as:-p123456, the user does not set a password, display enter password, You can enter directly. Note that if your MySQL is not installed in the C drive, you will need to use the DOS command to go to the bin directory in the MySQL installation directory. Take My computer as an example, the method is as follows: Enter D:
status code, which is "and 1=2", the status code appears, and "and 1=1" is not a different status code.12.2.4.1.3. Verifying that the keyword is correctClick the keyword to verify that the keyword is configured correctly.12.2.4.2. Error display mode fetch number configurationWithout configuration, the program will automatically get the error message, it is important to note that the program can display error messages.12.2.4.3. Union injection-Fetch data configurationBecause the number of column
The Oracle tutorial you are looking at is the Oracle Pl/sql introductory case practice. We have already learned the basics of pl/sql programming, and this article will combine a case to deepen understanding of these knowledge points.
A Case Introduction
A database has two tables that are about a company's employee information, salary, and departmental informati
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.