Ïê½âOracleÊý¾Ý¿âÓÅ»¯·½°¸Óëʵ¼ù
ÔÚÕâÀïÎÒÃǽ«½éÉÜOracleÊý¾Ý¿âÓÅ»¯·½°¸Óëʵ¼ù£¬²»Í¬µÄ»·¾³»áÓв»Í¬µÄµ÷ÊÔ£¬µ«ÊÇÒ²»áÓвî±ð£¬Ï£Íû´ó¼ÒÄܺÏÀíµÄÎüÊÕ¡£ Ò»¡¢Ç°ÑÔ ¶þ¡¢ORACLEÊý¾Ý¿âÓÅ»¯¸ÅÊö 1¡¢ÄÚ´æµÈ²ÎÊýÅäÖõÄÓÅ»¯ 2¡¢¼õÉÙÎïÀí¶ÁдµÄÓÅ»¯ 3¡¢ÅúÁ¿Öظ´²Ù×÷µÄSQLÓï¾ä¼°´ó±í²Ù×÷µÄÓÅ»¯ ¶þ¡¢ORACLEÊý¾Ý¿âÓÅ»¯·½°¸ 1¡¢ÄÚ´æµÈOracleϵͳ²ÎÊýÅäÖà 2¡¢Ê¹ÓÃË÷Òý 3¡¢±í·ÖÇø 4¡¢ProcedureÓÅ»¯ 5¡¢ÆäËû¸ÄÔì 6¡¢Î¬»¤×÷Òµ¼Æ»® Èý¡¢ORACLEÊý¾Ý¿âÓÅ»¯Ç°ºó±È½Ï 1¡¢ÅúÁ¿Öظ´µÄSQLÓï¾äÖ´ÐÐÐÔÄÜ 2¡¢Ò»Ð©µ¥´Î¡¢²»³£ÓõIJÙ×÷µÄÓï¾äÖ´ÐÐÐÔÄÜ ËÄ¡¢²Î¿¼ 1¡¢³£ÓõÄÓÅ»¯¹¤¾ß 2¡¢²Î¿¼ÎÄÏ× Ò»¡¢Ç°ÑÔ Ëæ×Åʵ¼ÊÏîÄ¿µÄÆô¶¯£¬Êµ¼ÊÏîÄ¿ÖÐʹÓÃµÄ OracleÊý¾Ý¿â¾¹ýÒ»¶Îʱ¼äµÄÔËÐУ¬ÔÚÏß±£´æµÄÊý¾ÝÁ¿ºÍÒµÎñ´¦ÀíµÄÊý¾ÝÁ¿ÔÚÖð½¥Ôö´ó£¬×î³õµÄOracleÉèÖã¬ÓëÏÖÔÚʵ¼ÊÐèÒªµÄÔËÐÐÐÔÄÜÓÐÒ»¶¨²î¾à£¬ÐèÒª½øÐÐһЩÓÅ»¯µ÷Õû¡£ ±¾ÎĽ«½áºÏ±¾ÈËʵ¼Êά»¤¾Ñ飬ÏàÓ¦µØÌá³öʵ¼ÊÏîÄ¿Êý¾Ý´¦ÀíµÄһЩÓÅ»¯·½·¨£¬ÒÔ¹©²Î¿¼¡£ ÊÊÓÃÓÚOracle 9i¡£ ¶þ¡¢OracleÊý¾Ý¿âÓÅ»¯¸ÅÊö OracleÊý¾Ý¿âµÄÓÅ»¯£¬Õë¶Ô²»Í¬µÄÓ¦Ó㬻áÓвàÖص㲻ͬµÄÓÅ»¯·½·¨£¬¸ù¾ÝÎÒÃÇʵ¼ÊÏîÄ¿µÄÓ¦ÓÃÌص㣬ÎÒÃÇÖ÷Òª¹ØÐĵÄÊÇÿ´ÎÊÂÎñÖ´ÐÐÍê³ÉµÄʱ¼ä³¤¶Ì¡£ ´ÓOracleÊý¾Ý¿â±¾ÉíµÄÌص㣬ÎÒÃÇ¿ÉÒÔ°ÑÓÅ»¯¹¤×÷»®·ÖΪ³õʼÓÅ»¯ÉèÖã¬Î¢ÓÅ»¯¡£ ÔÚ³õʼÓÅ»¯ÉèÖÃʱ£¬ÎÒÃÇÖ»Äܸù¾ÝÓ²¼þÇé¿ö£¬¹À¼ÆÒµÎñÔËÐеÄÇé¿ö£¬×ۺϾÑ飬¸ø³öÒ»ÖÖ¾ÑéÉèÖ㬴óÌåÉÏÀ´Ëµ£¬ÕâÖÖ¾ÑéÉèÖÃÀëÂú×ãÓÅ»¯ÐèÇóµÄÄ¿±ê²»ÊǺÜÔ¶¡£ÔÚÍê³ÉÁ˳õʼÓÅ»¯ÉèÖú󣬾¹ýÒ»¶Îʱ¼äµÄÒµÎñÔËÐУ¬ÒÑ¿É¿ªÊ¼ÊÕ¼¯Êµ¼ÊÔËÐл·¾³µÄÐÔÄÜÊý¾Ý£¬´Ëʱ£¬¾Í¿ÉÒÔ¶Ô¸÷ÖÖOracleÐÔÄÜÖ¸±ê¡¢¸÷ÖÖ¹ØÐĵÄÊÂÎñ²Ù×÷½øÐÐÐÔÄÜÆÀ¹À£¬È»ºó½øÐÐ΢ÓÅ»¯ÁË¡£ OracleÓÅ»¯£¬²»ÊÇÒ»¸öÒ»õí¶ø¾ÍµÄ¹¤×÷£¬Ò²²»ÊÇÒ»¸öÒ»ÀÍÓÀÒݵŤ×÷£¬ÐèÒª¶¨ÆÚά»¤£¬¶¨Æڹ۲죬ÔÚ·¢ÏÖÐÔÄÜÆ¿¾±Ê±¼°Ê±½øÐе÷Õû¡£Oracle×ÜÊÇ´æÔÚÐÔÄÜÆ¿¾±µÄ£¬²»Ê¹Óᢲ»²Ù×÷µÄÊý¾Ý¿â×ÜÊÇ×î¿ìµÄ£¬ÔÚ½â¾öµ±Ç°Æ¿¾±ºó£¬×ÜÊÇ»áÓÐÁíÒ»¸öÆ¿¾±³öÏÖ£¬ËùÒÔÔÚÓÅ»¯Ç°£¬ÎÒÃÇÐèҪȷ¶¨Ò»¸öÓÅ»¯Ä¿±ê£¬ÎÒÃǵÄÄ¿±êÊÇÂú×ãÎÒÃǵÄÓ¦ÓÃÐÔÄÜÒªÇó¾Í¿ÉÒÔÁË¡£ OracleÓÅ»¯£¬Éæ¼°µÄ·¶Î§Ì«¹ã·º£¬°üº¬µÄÓÐÖ÷»úÐÔÄÜ£¬ÄÚ´æʹÓÃÐÔÄÜ£¬ÍøÂç´«ÊäÐÔÄÜ£¬SQLÓï¾äÖ´ÐÐÐÔÄܵȵȣ¬´ÓÎÒÃÇÃæÏòÍø¹ÜÀ´Ëµ£¬Âú×ãÊÂÎñÖ´ÐÐËÙ¶ÈÐÔÄÜÖ÷Òª±íÏÖÔÚ£º 1£©ÅúÁ¿Öظ´µÄSQLÓï¾äÖ´ÐÐÐÔÄÜ£¨Ö÷ÒªÊÇͨ¹ýProcedure¼ÆËãÍê³ÉÊý¾ÝºÏ²¢ºÍÊý¾Ý»ã×ܵÄÐÔÄܺÍÅúÁ¿Êý¾Ý²É¼¯Èë¿âµÄÐÔÄÜ£©£» 2£©Ò»Ð©µ¥´Î¡¢²»³£ÓõIJÙ×÷µÄÓï¾äÖ´ÐÐÐÔÄÜ£¨Ö÷ÒªÊÇGUIµÄ·Ç¹æÂɲÙ×÷
Ïà¹ØÎĵµ£º
Oracle
ÖеÄÈÕÆÚÀàÐͼ°ÆäÏà¹ØµÄº¯Êý
Oracle
ÌṩÁ˺ܶàµÄÄÚÖõÄÈÕÆÚÀàÐÍ£¬°üÀ¨Èçϼ¸ÖÖ£º
Date
Timestamp
Timestamp With Time Zone
Timestamp With Local Time Zone
Interval Year To Month
Interval Day To Second
DateÀàÐÍÓÃÓÚ´æ´¢ÈÕÆÚ£¬¾«È·µ½Ã룬¿ÉÄÜͨ¹ýÉèÖÃNLS_DATE_FORMAT»òÕßTO_CHAR·½·¨À´¸ñʽ»¯ÈÕÆÚµÄÊ ......
dc-test2<oracle>sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 22:44:25 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> define
DEFINE _DATE = ......
recordʾÀý£º
create or replace procedure pro_test_record(vid in varchar2) is
type userRow is record(
id t_user.id%type,
name t_user.name%type
);
realRow userRow;
begin
select id,name into realRow from t_user where id=vid;
dbms_output.put_line(realRow.id||','||realRow.name);
end pro_test_re ......
Ò».·ÖÎöº¯Êý2(rank\dense_rank\row_number)
Ŀ¼
===============================================
1.ʹÓÃrownumΪ¼Ç¼ÅÅÃû
2.ʹÓ÷ÖÎöº¯ÊýÀ´Îª¼Ç¼ÅÅÃû
3.ʹÓ÷ÖÎöº¯ÊýΪ¼Ç¼½øÐзÖ×éÅÅÃû
Ò»¡¢Ê¹ÓÃrownumΪ¼Ç¼ÅÅÃû£º
ÔÚÇ°Ãæһƪ¡¶Oracle¿ª·¢×¨ÌâÖ®£º·ÖÎöº¯Êý¡·£¬ÎÒÃÇÈÏʶÁË·ÖÎöº¯ÊýµÄ»ù±¾Ó¦Óã¬ÏÖÔÚÎÒÃÇÔÙ ......
OracleÊý¾Ý¿âÓÐÈýÖÖ±ê×¼µÄ±¸·Ý·½·¨£¬ËüÃÇ·Ö±ðÊǵ¼³ö£¯µ¼È루EXP/IMP£©¡¢Èȱ¸·ÝºÍÀ䱸·Ý¡£µ¼³ö±¸¼þÊÇÒ»ÖÖÂß¼±¸·Ý£¬À䱸·ÝºÍÈȱ¸·ÝÊÇÎïÀí±¸·Ý¡£
Ò»¡¢ µ¼³ö£¯µ¼È루Export£¯Import£©
ÀûÓÃExport¿É½«Êý¾Ý´ÓÊý¾Ý¿âÖÐÌáÈ¡³öÀ´£¬ÀûÓÃImportÔò¿É½«ÌáÈ¡³öÀ´µÄÊý¾ÝËͻص½OracleÊý¾Ý¿âÖÐÈ¥¡£
£±¡¢ ¼òµ¥µ¼³öÊý¾Ý£¨Export£©ºÍµ¼ÈëÊý¾ ......