Oracle??????????????洢???????????????
???????????? ???????[ 2016/10/10 9:53:53 ] ????????????? Oracle
????Sql????
????-- ???????????????????????????
????create or replace trigger tr_emp_salary
????-- update of ???????????Щ?б??????????????????????????of ???????????
????before update of sal on emp
????-- ????????????м???????
????for each row
????-- ????????????????????Declare?ж???
????declare
????maxSalary number(10??2);
????begin
????select max(sal) into maxSalary from emp;
????if :new.sal > maxSalary then
????raise_application_error(-20010??'???????????????????');
????end if;
????end;
????/
????Sql????
????-- ???????????????????????????????????????20%
????create or replace trigger tr_emp_say
????before update of sal on emp
????for each row
????-- ??????д???????????
????when (new.sal < old.sal or new.sal > old.sal*1.2)
????begin
????raise_application_error(-20011??'????????????н???????????????????20%??');
????end;
????/
????????????????????????е??Щ??????
????Sql????
????-- ?????????
????select trigger_name??status from user_triggers;
????-- ?????????
????alter trigger tr_emp_salary disable;
????-- ????????
????alter trigger tr_emp_salary enable;
????-- ?????????д?????
????alter table emp disable all triggers;
????-- ?????????д?????
????alter table emp enable all triggers;
????-- ???±???????
????--alter trigger tr_emp_salary compile;
????-- ?????????
????drop trigger tr_emp_salary;
????????????洢PL/SQL???
?????洢PL/SQL?????洢?????????????????????????????????洢??????????????PL/SQL????????????У???????????????????????????????????????????????????κ?????????з??????
??????????????????????
????in???????????????????????????????????????????????????????
????out?????????????????????????????????????????????????????????
????in out?????????????
?????????????洢????
????????????????????????б?????????д???洢????????С????????????????????з??????
?????洢???????????
????create [or replace] procedure ?????? [(?????? ?????? ?????????...)] is|as
????[declaration] --???巋??
????begin
????--??в???
????[exception]
????--?????????
????end [??????];
?????????????У??????????С?
????1.??SQL>??????μ??ù????execute ???????????? ...??
????2.??PL/SQL???е??ù???????????????? …)??????????PL/SQL???
???????????????顢??????洢??????????е??á?
?????洢?????п?????????DML???select??insert??update??delete??????????????DDL???
?????洢?????????????DDL??????DDL????????????????????У???????execute immediate???????????????????????????????SQL????????????л??????????PL/SQL????
?????洢?????д????????????????????????
????create or replace procedure pk_auto_increment_pro(t_name varchar2) is
????v_ddl varchar2(2000);
????begin
????v_ddl := 'create or replace trigger pk_auto_increment_' || t_name ||
????' before insert on ' || t_name ||
????' for each row
????begin
????dbms_output.put_line(''????id:'' ||:new.id);
????select test_seq.nextval into :new.id from dual;
????dbms_output.put_line(''?????id:'' ||:new.id);
????end;';
????execute immediate v_ddl;
????end;
???????????????
??????????????????????????????????????з??????
??????????????
????create [or replace] function ?????? [(?????б?)] return ????????? is|as
????[local declarations] --???巋??
????begin
????--??в???
????return ???; ??????retutn??????????
????exception
????--?????????
????end;
?????????????ú?????
????1.??SQL>??????μ??ú???
????var varName ????; --???????
????call ?????? into :varName;
????print varName;
????2.??SQL???PL/SQL???е??ú??????????????????PL/SQL???????????÷?
????????????????????????????????????????
?????????塢??
??????????????????????????????????????????????????Э????????????????????Щ??????洢???????????????£?????????洢????????????????????????????????????????????棬?′??????????????????黯??
????????????????
????1.?????????java????
????????淶??????????????洢????????????
???????????????
????create [or replace] package ???? is|as
????--????????
????function ?????? [(?????б?)] return ????????;
????--?洢???????
????procedure ?洢?????? [(?????б?)];
????end [????];
????2.???壨????java?????
??????????????淶
????????????????
????create [or replace] package body ???? is|as
????--???????
????function ?????? [(?????б?)] return ???????? is|as
???????????????
????--?洢???????
????procedure ?洢?????? [(?????б?)] is|as
?????洢???????????
????end [????];
??????e??????????????.?????????
????????洢??????????????????Σ?????ù????????????()???????????
???????ú?????????????????Σ???SQL*Plus?????У??????()???????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Oracle ??????????Oracle?????????????Oracle?????????????ORACLE_NUMBER????Scale?0??????????Oracle 11g R2 ????????????Oracle??????????????????Oracle ?????????(TSPITR)Oracle?????????????Oracle??????????????oracle??????????????Oracle12.2?????????μ????????Oracle???????????????????Oracle???????????????????Oracle????MySQL?????????????oracle????????????????Oracle RAC?е????IP
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????