Oracle ´æ´¢¹ý³Ì
create or replace procedure p //ÓоÍÌæ»»£¬Ã»Óоʹ´½¨
is
cursor c is
select * from emp for update;
begin
for v_emp in c loop
if (v_emp.deptno =10) then
update emp2 set sal*2 where current of c;
elsif () then
update emp2 set sal*2 where current of c;
else
update emp2 set sal*2 where current of c;;
end if;
end loop;
commit;
end;
2¡¢Ö´ÐÐ
exec p;
--------
begin
p;
end;
3¡¢´ø²ÎÊýµÄ´æ´¢¹ý³Ì
create or replace procedure p
(v_a in number,v_b number,v_ret out number,v_temp in out number) //in ´«µÄ²ÎÊý,out´«³ö²ÎÊý
is
begin
if(v_a>v_b) then
v_ret:=v_a;
else
v_ret :=v_b;
end if;
v_temp:=v_temp+1;
end;
ʹÓÃ:
declare:
v_a number :=3;
v_b number :=4;
v_ret number;
v_temp number :=5;
begin
p(v_a,v_b,v_ret,v_temp);
dbms......(v_ret);
dbmmm.....(v_temp);
end;
Èç¹ûÓдíÎó £¬¿ÉÒÔÖ´ÐÐshow error ÃüÁîÏÔʾ´íÎóÐÅÏ¢
4¡¢functionº¯Êý
create or replace function sal_tax
(v_sal number)
return number;
is
begin
if (v_sal<2000) then
return 0.10;
elsif (v_sal<2750) then
return 0.15;
 
Ïà¹ØÎĵµ£º
·½·¨Ò»£º
----------------------------------------------------------------
---Muti-row to line(col2row)
----------------------------------------------------------------
create or replace type str_tab is table of varchar2(20);
/
grant all on str_tab to public;
create public synonym str_tab for ......
ÒÔÏÂÁгöµÄÊÇOracle
Óû§¹ÜÀí¹ý³ÌÖг£ÓõÄһЩָÁÒÔ¹©´ó¼Ò²Î¿¼¡£
Oracle
Óû§¹ÜÀíÖ®Ò»¡¢´´½¨profile
Îļþ¡£
1.
SQL>Create
profile
ÎļþÃû limit
2.
  ......
INSERT /*+APPEND */ INTO employee (empno,ename,sal,deptno)
SELECT empno,ename,sal,deptno from emp
WHERE deptno=20;
µÚ¶þÌõÓï¾äʹÓÃ/*+APPEND */À´±íʾ²ÉÓÃÖ±½Ó×°ÔØ·½Ê½£¬µ±Òª×°ÔØ´óÅúÁ¿Êý¾Ýʱ£¬²ÉÓõڶþÖÖ·½·¨×°ÔØÊý¾ÝµÄËÙ¶ÈÒªÔ¶Ô¶ÓÅÓÚµÚÒ»ÖÖ·½·¨¡£
ʹÓöà±í²åÈëÊý¾Ý
ʹÓÃALL²Ù×÷·ûÖ´Ðжà±í²åÈëʱ£¬ÔÚÿ¸öÌõ¼þ× ......
½ñÌìÖØÐÂÕûÀíµçÄÔ£¬ÕÒµ½Ò»¸öÎļþ£¬¿´ÁËÏÂÈÕÆÚ£¨2006.11.3£© £¬Å²»Ð¡ÐÄÔÙ¶ªÁË£¬´æµ½ÍøÉÏÀ´É¹É¹¡£
1.HKEY_LOCAL_MACHINE
HKEY_LOCAL_MACHINE
SOFTWARE
ORACLE
2.HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services
3.ÖØÐÂÆô¶¯»úÆ÷.
create role a identified by passwor ......
Ò»¡¢ ³£ÓÃÈÕÆÚÊý¾Ý¸ñʽ
1.Y»òYY»òYYY ÄêµÄ×îºóһ룬Á½Î»»òÈýλ
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from ......