OracleÓαêʵÓÃ
declare
sqlstring varchar2(100);
emprow emp_bak%rowtype;
myno emp_bak.empno%type;
begin
--sqlstring:='create table emp_bak as select * from emp';
sqlstring:='select * from emp_bak where empno=:myno and sal>:mysal';
myno:='&ÇëÊäÈëÔ±¹¤±àºÅ';
--¶¯Ì¬SQL
execute immediate sqlstring into emprow using myno,3001 ;
dbms_output.put_line(emprow.sal);
exception
when no_data_found then
dbms_output.put_line('ÊäÈëµÄÔ±¹¤±àºÅ²»´æÔÚ');
end;
select * from emp_bak
--ÒþÊ¿Óαê ÓαêÃû×Ö SQL
--ÒþʽÓαê ÊÇoracle ϵͳ×Ô¶¯ÔÚÔËÐÐDMLÓï¾äµÄʱºò Éú³ÉµÄ¡£ Ëû×Ô¶¯´ò¿ª ×Ô¶¯¹Ø±Õ¡£
-- Ò»°ãÇé¿öÏ ¸ÃÓÎ±ê ¶ÔÓÚ³ÌÐòÔ±À´Ëµ ÊÇ͸Ã÷µÄ
declare
begin
update emp_bak set sal = 2500 where empno = 8888;
--Êä³öÒþÊ¿ÓαêÖеÄÒ»¸öÊôÐÔ %rowcount ¾ÍÊÇÓ°ÏìµÄÐÐÊý
dbms_output.put_line(sql%rowcount);
end;
-- %ISOPEN - ÓαêÊÇ·ñ´ò¿ª ²¼¶ûÖµ
-- %noopen ûÓÐÕâ¸öÊôÐÔ£¡£¡
-- %FOUND – ÓαêÖÐÊÇ·ñ»¹ÓÐÊý¾Ý
-- %NOTFOUND – ÓαêÖÐÊÇ·ñ»¹ÓÐÊý¾Ý
-- %ROWCOUNT – SQL Óï¾äÓ°ÏìµÄÐÐÊý
-- CURSOR Óαê
--ÏÔʽÓαê ÓгÌÐòÔ±×Ô¼º¶¨ÒåÓαê ×Ô¼º¶¨Òå ×Ô¼ºÊ¹ÓÃ
--ÓαêҪʹÓõĻ° ²½Öè 1 ¶¨Òå 2 ´ò¿ª 3 ʹÓã¨Ñ»·£© 4 ¹Ø±ÕÓαê
declare
--`1 ¶¨ÒåÓαê
cursor mycursor is select ename,sal from emp_bak;
emprow emp_bak%rowtype;
begin
-- 2 ´ò¿ªÓαê
open mycursor;
-- 3 ʹÓÃÓαê
loop
-- ÓαêÖеÄÊý¾Ý ÊÇͨ¹ý¹Ø¼ü×Ö ÌáÈ¡ fetch
fetch mycursor into emprow.ename,emprow.sal; -- 1 ÌáÈ¡Êý¾Ý 2 ²¢ÇÒ¸ÃÓαê»áÖ¸ÏòÏÂÒ»ÐÐ
if(emprow.sal >2000 and emprow.sal<3000) then
dbms_output.put_line(emprow.ename||' '|| emprow.sal);
end if;
-- dbms_output.put_line(emprow.ename||' '|| emprow.sal);
exit when mycursor%NOTFOUND; --2 ʹÓÃÓαêµÄ%NOTFOUNDÊôÐÔ¼ì²âÓαêÊÇ·ñ»¹ÓÐÊý¾Ý Èç¹ûûÓÐÁË ÄÇô¾ÍÍ˳öÑ»·£¡£¡
end loop;
-- ¹Ø±ÕÓαê
close mycursor;
end;
--¼òµ¥Ð´·¨ Ñ»·Óαê
declare
--`1 ¶¨ÒåÓαê
cursor mycursor is select ename,
Ïà¹ØÎĵµ£º
¸Ðл¶ÁÕß¿´¡¶Oracle´óÐÍÊý¾Ý¿âϵͳÔÚAIXUNIXÉϵÄʵսÏê½â¡·Õâ±¾Ê飬ÕâÀï»Ø´ðһЩ¶ÁÕßÓʼþÌá³öµÄÒ»¸ö½ÏΪ¹«¹²µÄÎÊÌ⣺ASMÓÐʲôÓã¿ÎªÊ²Ã´Óã¿ ASMÊÇOracle´Ó10g¿ªÊ¼ÌṩµÄÒ»ÖÖ´æ´¢¹ÜÀí¼¼Êõ£¬Ö¸µÄÊÇÒ»¸öÔÚÎïÀí¾í£¨»òÕß´ÅÅÌ·ÖÇø£©ÉÏÌرðΪOracleÊý¾ÝÎļþ¶ø´´½¨µÄ¡°×¨Óá±Îļþϵͳ¡£¸ÃÎļþϵͳÓÉOracleÄÚºËά ......
1.Êý¾Ý¿â¹éµµÄ£Ê½:
* ·Ç¹éµµÄ£Ê½:µ±Êý¾Ý¿âÊý¾ÝÖ»¶Á²»»á¸Ä±äʱ,Êý¾Ý²»»á¸Ä±ä,Êý¾Ý¿âÊʺÏÓ÷ǹ鵵ģʽ, ÕâÑùÌá¸ßÐÔÄÜ
&nb ......
Ç°Ìì×°ºÃµÄ£Ï£ò£á£ã£ì£å£¬×òÌìͻȻ²»ºÃÓÃÁË£¬´ÓOracleµÄ´íÎóÌáʾÀ´¿´,ÊÇ˵TNS:no listener £¬¹À¼ÆÊÇijÖÖ·þÎñûÓÐÆô¶¯£¬´ò¿ªwindows¹ÜÀí¹¤¾ß->·þÎñ£¬Ò»¿´£¬ÓÐÒ»¸öOracleOraHome90TNSListenerÕâÑùµÄ·þÎñ£¬ºÍ´íÎóÐÅÏ¢ÌâÊÇÒ»Ö£¬»ù±¾¾Í¿ÉÒԿ϶¨ÊÇÕâ¸ö·þÎñËùÒý·¢µÄÎÊÌâ¡£ÔÙÒ»¿´£¬¸Ã·þÎñûÓÐÆô¶¯£¬ËìÊÖ¹¤Æô¶¯£¬Ë¢ÐºóÒ»¿´£¬¸Ã· ......
Oracle Enterprise Manager Oracle EMÊÇÓû§°²×°Oracle£¬´´½¨ÁËÊý¾Ý¿â²¢ÅäÖúÃÍøÂç×ÊÔ´ºó£¬Oracle¸½´ø°²×°µÄÒ»¸öÊý¾Ý¿â¹ÜÀíÈí¼þ¡£Í¬Ê±£¬EMÒ²Ìṩ¶ÔÐÔÄܵ÷ÊÔÓаïÖúµÄ¹¤¾ß£¬ÈçSQL*LoaderºÍRecovery Manager £¨RMAN£©µÈ¡£ Oracle Diagnostics Pack (ODP) ODPÓ¦¸ÃËãÊÇOracleÊý¾Ý¿â»·¾³ÐÔÄܵ÷ÊÔµÄ×îÖ÷ÒªºÍ×îÓÐЧµÄ¹¤¾ß£¬ËüÌá¹ ......