Oracle dishes (2)

zhaozj2021-02-16  42

First article:

11. Users of PL / SQL to see below:

Create a non-parameter procedure: create or replace procedure proc_name as I number; begin ... End proc_name, created a parameter: Create or Replace Procedure Proc_name (arg1, ...) as I number; begin .. End proc_name; Are you getting used to declaration with declare? No, here you can't, you must listen to me, create a trigger with AS: Create Or Replace Trigger Tri_Name Before In TNAME for Each Row Declare I Number; begin .. End; Because this is a trigger, it is necessary to declare the variable with declare, although the trigger is also the syntax of PL / SQL. But we are distinguished from other types of stored procedures, in order to make users feel that Oracle is unpredictable. How to be an end; not end tri_name? Yes, procedure and function are designed so that this can make users feel more difficult to use! (SQLPLUS) You call a non-parametric procedure: call proc_name () (SQLPLUS) You call a non-parameter procedure: call proc_name (arg1, arg2); yes, it is not optional, it must be the case, define a procedure without parameters is not empty (), but When you call it, it is necessary to define a parameter procedure. Of course. Function is the same as this. You call a function: return_val: = func_name (); what? You don't need Ret_Val, no, this is strong Buy strong sale, don't do it. Otherwise I don't work! And,, I will give the error message to ensure that you don't understand. You have to play more advanced design methods, use it to pack: create or replace package pack_name as .... End pack_name; Yes, this is just a declaration of the package. To define this package, you have to: Create or R EPLACE PACKAGE PACK_NAME As Procedure Proc_name IS - Do you not use AS? Yes, but here AS has been used by a statement, 呶! You also saw it. What is IS? End proc_name function func_name IS ... End func_name end pack_name;

12. Look at the wrong information, from SQLPlus, from the Pro * C pre-compiler, from other tools such as IMP, Exp, Sqlda. Don't mislead it.

13. Tired Pro * C programmer: In the function foo, you have declared the exec sql. The pre-encode of Pro * c will tell you that it can't find the SQL_ERR launcher in the function bar !!! It can use the label across functions. It also dares to claim to be a pre-processor with the compiler, just use Chen The three words knocked out of the bridge five strokes happened to follow the treatment items, I see that the processing is actually.

14. Users of DDL statements: ALTER TABLE TNAME ADD (Col1 Type ...); alter table ty ...); Alter Table Tname Drop Column (col1); why do you have to come out in Drop? COLUMN?

转载请注明原文地址:https://www.9cbs.com/read-26582.html

New Post(0)