oracle PL SQLѧϰ°¸Àý£¨Èý£©
´æ´¢¹ý³Ì
==========================================================================
==========================================================================
¡¾ÑµÁ·15.1¡¿ ´´½¨Ò»¸öÏÔʾ¹ÍÔ±×ÜÈËÊýµÄ´æ´¢¹ý³Ì¡£
²½Öè1£ºµÇ¼SCOTTÕË»§(»òѧÉú¸öÈËÕË»§)¡£
²½Öè2£ºÔÚSQL*PlusÊäÈëÇøÖУ¬ÊäÈëÒÔÏ´洢¹ý³Ì£º
CREATE OR REPLACE PROCEDURE EMP_COUNT
AS
V_TOTAL NUMBER(10);
BEGIN
SELECT COUNT(*) INTO V_TOTAL from EMP;
DBMS_OUTPUT.PUT_LINE('¹ÍÔ±×ÜÈËÊýΪ£º'||V_TOTAL);
END;
²½Öè3£º°´“Ö´ÐД°´Å¥½øÐбàÒë¡£
Èç¹û´æÔÚ´íÎ󣬾ͻáÏÔʾ:
¾¯¸æ: ´´½¨µÄ¹ý³Ì´øÓбàÒë´íÎó¡£
Èç¹û´æÔÚ´íÎ󣬶Խű¾½øÐÐÐ޸ģ¬Ö±µ½Ã»ÓдíÎó²úÉú¡£
Èç¹û±àÒë½á¹ûÕýÈ·£¬½«ÏÔʾ£º
¹ý³ÌÒÑ´´½¨¡£
²½Öè4£ºµ÷Óô洢¹ý³Ì£¬ÔÚÊäÈëÇøÖÐÊäÈëÒÔÏÂÓï¾ä²¢Ö´ÐУº
ÏÔʾ½á¹ûΪ£º
¹ÍÔ±×ÜÈËÊýΪ£º14
PL/SQL ¹ý³ÌÒѳɹ¦Íê³É¡£
˵Ã÷£ºÔÚ¸ÃѵÁ·ÖУ¬V_TOTAL±äÁ¿ÊÇ´æ´¢¹ý³Ì¶¨ÒåµÄ¾Ö²¿±äÁ¿£¬ÓÃÓÚ½ÓÊÕ²éѯµ½µÄ¹ÍÔ±×ÜÈËÊý¡£
×¢Ò⣺ÔÚSQL*PlusÖÐÊäÈë´æ´¢¹ý³Ì£¬°´“Ö´ÐД°´Å¥ÊǽøÐбàÒ룬²»ÊÇÖ´Ðд洢¹ý³Ì¡£
==========================================================================
¡¾ÑµÁ·15.2¡¿ ÔÚPL/SQL³ÌÐòÖе÷Óô洢¹ý³Ì¡£
²½Öè1£ºµÇ¼SCOTTÕË»§¡£
²½Öè2£ºÊÚȨSTUDENTÕË»§Ê¹Óøô洢¹ý³Ì£¬¼´ÔÚSQL*PlusÊäÈëÇøÖУ¬ÊäÈëÒÔϵÄÃüÁ
GRANT EXECUTE ON EMP_COUNT TO STUDENT
ÊÚȨ³É¹¦¡£
²½Öè3£ºµÇ¼STUDENTÕË»§£¬ÔÚSQL*PlusÊäÈëÇøÖÐÊäÈëÒÔϳÌÐò£º
SET SERVEROUTPUT ON
BEGIN
SCOTT.EMP_COUNT;
END;
²½Öè4£ºÖ´ÐÐÒÔÉϳÌÐò£¬½á¹ûΪ£º
¹ÍÔ±×ÜÈËÊýΪ£º14
PL/SQL ¹ý³ÌÒѳɹ¦Íê³É¡£?
˵Ã÷£ºÔÚ±¾ÀýÖУ¬´æ´¢¹ý³ÌÊÇÓÉSCOTTÕË»§´´½¨µÄ£¬STUDENÕË»§»ñµÃSCOTTÕË»§µÄÊÚȨºó£¬²ÅÄܵ÷Óøô洢¹ý³Ì¡£
×¢Ò⣺ÔÚ³ÌÐòÖе÷Óô洢¹ý³Ì£¬Ê¹ÓÃÁ˵ڶþÖÖÓï·¨¡£
==================================
Ïà¹ØÎĵµ£º
ÎÊÌâ±³¾°£º
¡¡¡¡ÈÕ³£¶ÔSql Server 2005¹ØϵÊý¾Ý¿â½øÐвÙ×÷ʱ£¬ÓÐʱ¶ÔÊý¾Ý¿â£¨È磺SharepointÍøÕ¾ÅäÖÃÊý¾Ý¿âÃû
Sharepoint_Config£©½øÐÐЩ²»Õý³£²Ù×÷ÈçÊý¾Ý¿âÔÚ¶Áдʱ¶øÎÞ¹ÊÍ£Ö¹Êý¾Ý¿â£¬´Ó¶øµ¼ÖÂSql Server 2005Êý¾Ý¿â²»Õý³£
Öжϣ¬µ±Ôٴδò¿ªÊý¾Ý¿âʱ»á·¢ÏÖijЩÊý¾Ý¿â»á±»±ê¼ÇΪ“¿ÉÒÉ”£¨suspect)£¬¼´ÔÚÊý¾ ......
1.Ôø¾²»Ð¡ÐÄ°Ñ¿ª·¢¿âµÄÊý¾Ý¿â±íÈ«²¿É¾³ý£¬µ±Ê±ÏŵÄÒªËÀ¡£½á¹ûÕÒµ½ÏÂÃæµÄÓï¾ä»Ö¸´µ½ÁË1¸öСʱ֮ǰµÄÊý¾Ý£¡ºÜ¼òµ¥¡£
×¢ÒâʹÓùÜÀíÔ±µÇ¼ϵͳ£º
select * from ±íÃû as of timestamp sysdate-1/12 //²éѯÁ½¸öСʱǰµÄij±íÊý¾Ý£¡¼ÈÈ»Á½Ð¡Ê±ÒÔÇ°µÄÊý¾Ý¶¼µÃµ½ÁË£¬¼ÌÐøÔõô×ö£¬ÖªµÀÁË°É¡£¡£
Èç¹ûdropÁË±í£¬Ôõô°ì£¿£¿¼ûÏ ......
sqlÈÕÆÚº¯Êý(ת)
[ 2007-8-23 16:33:00 | By: ²½ ]1.Ò»¸öÔµÚÒ»ÌìµÄ
Select DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
2.±¾ÖܵÄÐÇÆÚÒ»
Select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
3.Ò»ÄêµÄµÚÒ»Ìì
Select DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
4.¼¾¶ÈµÄµÚÒ»Ìì
Select DATEADD(qq, DATEDIFF(qq,0,getdat ......
ÌìÓв»²â·çÔÆ£¬
IBM µÄÖж˴ÅÅÌÕóÁÐÕâ´ÎÓÖÈÇ»öÁË¡£ÔÚ΢ÂëÉý¼¶µÄʱºò£¬
DS4800 ·¢Éú¹ÊÕÏ¡£µ¼Öµ±Ê±ÔÚÕą̂¿âÉϵļ¸Ì×Éú²ú¿â±¨´íÁË¡£
IBM¹¤³Ìʦ°ÑÕóÁйÊÕϻָ´ºó£¬ÅÄÅÄƨ¹É×ßÈË£¬ÕóÁÐÉϵÄÊý¾ÝÓÖµÃÎÒÃÇÀ´Ïë°ì·¨ÇÀ¾ÈÁË¡£¡£¡£¡£
»¹ºÃÓÐoracle supportµÄÖ§³ÖÎÒÃÇ×îÖÕ»¯½âÁËÕâ´ÎΣ»ú¡£ÏÂÎÄÏêϸ½éÉÜÁËÕû¸ö»Ö¸´µÄ¹ý³Ì¡£
oracle¹¤ ......
select trunc(sysdate ,'yyyy') from dual --±¾Äê¶ÈµÚÒ»Ìì
select trunc(sysdate ,'mm') from dual --±¾ÔµÚÒ»Ìì
&nbs ......