statement or PL/SQL block.
Set colsep [separator | Off]
Determines the column separator (default = "").
Set CON [Cat] [character | on | Off]
Determines the character that terminates a substitution variable reference (default = .)
Set def [ine] [character | on | Off]
Determines the character that starts a substitution variable reference (default = )
Set echo [ON
. Improve program running speed
1.1 Use stored procedures
A stored procedure is an object of the Oracle database. It is a named PL/SQL process block. After being created, it is analyzed by the database server for syntax and syntax, stored in the database in compiled form, and can be called by the authorized user wherever needed. When a client application is called, the database server only needs to send a
One, the packageA package is a combination of a set of related procedures, functions, constants, variables, cursors, exceptions, and other PL/SQL programming elements. It is similar to classes in C + + and Java where variables are equivalent to member variables in a class, and procedures and functions are equivalent to methods in a class. By using packages, developers can use the object-oriented approach to
the "," number.3. Using a process with parametersIn the main program in the actual parameters and the process of the transfer of formal parameters there are many ways, the reader is recommended to use the one by one corresponding method, the corresponding position to pass parameters. The actual and formal parameters are required to be exactly the same in the data type and position arrangement.Execute the following
1. Cursor Concept
A swimming cursor is a handle or pointer to a context area.
When you perform a crud operation in a pl/sql block, Oracle assigns the context area to it in memory. Using the database language to describe a cursor is a position entity that maps on a row of data in the context area result set.
A user can use a cursor to access any row of data in the result set, and the row data is manipulat
an initial value to a variablev_sortname Es_sort. Sortname%type: = ' category '; --Specify the variable type and assign the initial valueV_fatherid Es_sort. Fatherid%type: = 0;BEGINLOOPINSERT into Es_sort VALUES (v_id, V_sortname | | v_id, V_fatherid);v_id: = v_id + 1;--Exit conditionsEXIT when v_id = 9;END LOOP;COMMIT;Dbms_output.put_line (' insert Success ');END;--use for loop to complete, know the number of cycles with the forDECLAREv_id Es_sort.i
-width space instead of tab to indent.5, after the comma and before and after the operator should be preceded by a space.Iii. comments on PL/SQL--Single line comment/* Multiline Comment */Iv. Declaration of variablesThe syntax structure is as follows:variable_name datatype [[not NULL] {: = | DEFAULT} expression];There are two of the most common combinations of syntax structures:The first is to declare varia
Today encountered an error prompt: ORA-06502: PL/SQL: numberic or value error: character string buffer too small, the general corresponding Chinese information is: ORA-06502: PL/SQL: incorrect number or value: the string buffer is too small. During the debugging process, we
. It processes data in a single column and multiple rows. It contains index tables (PL/SQL tables), nested tables (nested tables), and variable-length arrays (varry; -- index table description: Index processing PL/SQL array type. The number of elements is not limited, and th
calling statement by this parameter ; in out : .NBSP; if the tag is omitted , the parameter is implied in "Example 1" without the parameter functionRequirement: HelloWorld of function: Returns a string of "HelloWorld"Create or Replace function Hello_func return varchar2 is begin return ' HelloWorld ' ; End;View CodeExecute functionbegin Dbms_output.put_line (Hello_func ()); End;View Code"Example 2" with the parameter functionRequired: Returns a "Helloworld:atguigu"
values are: '| X );End loop;Dbms_output.put_line (the value of 'external X is '| X );End;/
3. For LoopFor counter in [reverse] start_value... end_value Loop...End loop;
Example:BeginFor I in 1 .. 5 LoopDbms_output.put_line ('body I values are: '| I );End loop;Dbms_output.put_line ('end ');End;/
For I in reverse 1 .. 5 loop indicates an ascending
Use of the GOTO statementDeclareX number;BeginX: = 0;X: = x + 1;Dbms_output.put_line (X)If x Goto
assigned to boolean variables. When Relational operators are used in an expression, the returned results are also boolean values, as shown in the following example: v_flag: = (count> 200 ); 2. How to output the Boolean Type -- the following example shows a case where the put_line function is used to output SQL> declare 2 v_bool Boolean; 3 begin 4 v_bool: = true; 5 dbms_output.put_line ('the value if v_bool is '| v_bool); 6 end; 7/dbms_output.put_line
If an online e-commerce system, we now need to be based on the order form reflected in the consumption of the customer simply divided into three categories of large and small and inserted into three tables.
Order Form orders (order_id number, cust_id number, amount number);
Small Customer table Small_cust (cust_id number
The source of this article, in order to facilitate direct copy over. If there is infringement, please inform, thank youhttp://blog.csdn.net/chiclewu/article/details/14646687An Oracle 11g 64-bit version was installed in the virtual machine today, and when connected with PL/SQL developer, it was found that there was no database connection to TNS.It is considered that the
Oracle BASICS (5) Advanced pl/SQL (paging process)Compile the paging process to implement the paging process through pl/SQL, and then step by step from simple to difficult. The purpose is to familiarize yourself with the various stored procedures, packages, and cursors of pl
what is PL/SQLPL/SQL is a process-procedural language (LANGUAGE/SQL). PL/SQL is an extension of the Oracle database to the statement. In the use of ordinary SQL statements to add the characteristics of programming languages, so
Tags: PNG integrated user create unified end logs style capitalizationIntroduction to PL/sql: Plsql is a process language that Oracle expands on the basis of SQL. Plsql provides typical high-level language features, including encapsulation, exception handling mechanisms, information hiding, object-oriented, etc., and brings the latest programming ideas to the dat
Oracle 11g PL/SQL function result cache, oracle11g
Two experiments have been conducted to simulate the Oracle Performance Diagnosis art. The book says that if you don't need RELIES_ON, then the changes to the objects on which the function depends will not result in the invalid result cache operation (result_cache RELIES_ON (test1, test2). The test proves that this operation is incorrect. The function f1 ()
Solve PL/SQL Dev connection to Oracle a blank prompt box appears, ploracle
The first time Oracle was installed, it was installed in a virtual machine. When PL/SQL Dev was used to connect to a remote database, a blank prompt box pops up. After a long time of searching online, there were many solutions, but it cannot sol
Possible problems: 1. windows Firewall. 2. The environment variable PATH does not contain % ORACLE_HOME % \ bin, which leads to many ORACLE connection setting methods. Four methods are provided here, however, it is mainly about the remote connection method. First case: If the oracle server is installed on the local machine, it will not be said. The connection is just a problem with the user name and password. However, check whether the environment variable % ORACLE_HOME %/network/admin/is set. W
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.