Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Oracle ÏÔʽÓαê

--------------------ÏÔʽÓαê
--²éѯÊý¾Ý
select * from employees;
--¶¨Ò岿·Ö
declare
       --ÉùÃ÷Óαê
       cursor mycur is select * from employees where employee_id<120;
       --¶¨ÒåÒ»¸ö¼¯ºÏ±äÁ¿ÓÃÓڴ洢ij¸ö±íµÄÒ»Ìõ¼Ç¼
       rowdata employees%rowtype;
--Ö´Ðв¿·Ö
begin
       --´ò¿ªÓαê
       open mycur;
       loop
            --ÔÚÑ­»·ÖÐÓÃfetchÌáÈ¡¼Ç¼
            fetch mycur into rowdata;
            dbms_output.put_line('salary:'||rowdata.salary||'    '||'hire_date:'||rowdata.hire_date||'    '||'first_name:'||rowdata.first_name);
            --ÓÃ%notfoundÊôÐÔ¼ì²âÊÇ·ñµ½×îºóÒ»Ìõ¼Ç¼
            exit when mycur%notfound;
       end loop;
       --Ìá½»ÊÂÎñ;
       commit;
       --¹Ø±ÕÓαê
       close mycur;
--Òì³£²¿·Ö
exception
       --ÓÐÒì³£Ôò»Ø¹ö
       when others then
       rollback;
end;
/
--------------------²ÎÊýÓαê
--²éѯÊý¾Ý
select * from employees where salary<=10000;
--¶¨Ò岿·Ö
declare
       --¶¨ÒåÓαꣻעÒ⣺²ÎÊýÀàÐÍ(input_salary)²»ÐèÒªÖ¸¶¨¾«¶È
       cursor mycur(input_salary number) is select * from employees where salary<input_salary;
       --¶¨ÒåÒ»¸ö¼¯ºÏ±äÁ¿ÓÃÓÚ´æ´¢Ä


Ïà¹ØÎĵµ£º

OracleÈÕÆÚº¯Êý²Ù×÷(ÊÕ¼¯ÕûÀí°æ)

¾­³£ÔÚÆ½Ê±µÄ¿ª·¢ÖÐÒªÓõ½oracleµÄÈÕÆÚº¯Êý£¬Ã¿´Î¶¼ÒªÉÏÍøÈ¥²é£¬ÏÖÔÚÓеãʱ¼ä£¬×Ô¼ºÊÕ¼¯ÕûÀíÁËһϡ£ÌùÔÚÕâÀ·½±ã×Ô¼º£¬Ò²·½±ã´ó¼Ò¡£
---------------------------------------------------------------------------------------------------------------------------------- 
³£ÓÃÈÕÆÚÐͺ¯Êý
1¡£Sysdate µ±Ç°È ......

linux ÏÂoracle µÄ°²×°(·þÎñ¶ËºÍinstant client)

linux ϰ²×°oracle ÊÇÒ»¼þºÜÁîÈËÍ·ÌÛµÄÊÂÇ飬ÎÒ°Ñ×Ô¼ºµÄ°²×°²½ÖèÄóöÀ´¸ø´ó¼Ò·ÖÏíһϡ£
Ò».linux·þÎñ¶ËµÄ°²×°.
1.ÏÂÔØoracle·þÎñ¶ËÈí¼þ,ÏÂÔØÍøÖ·ÈçÏÂ
http://www.oracle.com/technology/software/products/database/index.html
ÎÒÑ¡ÔñµÄ°æ±¾ÊÇ£ºOracle Database 10g Release 2 (10.2.0.1.0) for Linux x86-64
  ......

¹ØÓÚoracleµ¼³öexcelºÍexcelµ¼ÈëoracleµÄ¾­Ñé×ܽá

Ò»¡¢oracleµ¼³öexcel
·½·¨Ò»£º×î¼òµ¥µÄ·½·¨---Óù¤¾ßplsql dev
Ö´ÐÐFile =>new Report Window ¡£ÔÚsql±êÇ©ÖÐдÈëÐèÒªµÄsql£¬µã»÷Ö´Ðлò°´¿ì½Ý¼üF8£¬»áÏȳԳö²éѯ½á¹û¡£ÔÚÓҲ๤¾ßÀ¸£¬¿ÉÒÔÑ¡Ôñ°´Å¥Áí´æÎªhtml¡¢copy as html¡¢export results£¬ÆäÖÐexport results°´Å¥ÖоͿÉÒÔµ¼³öexcelÎļþ¡¢csvÎļþ¡¢tsvÎļþ¡¢xmlÎļþ¡ ......

oracleѧϰ±Ê¼Ç£¨Ò»£©·ÖÏí

1¡¢»ù±¾Óï·¨
SELECT
from
WHERE
GROUP BY
HAVING
ORDER BY
SELECT:²éѯµÄ×Ö¶Î
1¡¢¿ÉÓÃ*±íʾËùÓÐ×ֶΡ£
2¡¢×Ö¶ÎÖ®¼äÓöººÅ·Ö¸î¡£
3¡¢¿ÉΪ×Ö¶ÎÆð±ðÃû Æä±ðÃû¿Éд³ÉSELECT AAAA¡£AA AS SS »ò AAAA¡£AA SS ¿ÉÊ¡ÂÔas
4¡¢¿ÉÖ±½Óд×Ö¶ÎÖµ£ºÈç SELECT AAAA¡£AA SS,'ÕÅÈý' NAME from ¡£¡£¡£
from:²éѯµÄ±íÃû
1¡¢±íà ......

oracle¹éµµÄ£Ê½ÐÞ¸Ä

C:\Documents and Settings\Administrator>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on ÐÇÆÚ¶þ 10ÔÂ 13 15:26:31 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Á¬½Óµ½:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partition ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ