PL/SQL ¿éµÄѧϰ£¨¾«»ª£©
PL/SQL¿é
declare
begin
--SQLÓï¾ä
--Ö±½ÓдµÄSQLÓï¾ä(DML/TCL)
--¼ä½Óдexecute immediate <DDL/DCLÃüÁî×Ö·û´®>
--select Óï¾ä
<1>±ØÐë´øÓÐinto×Ó¾ä
select empno into eno from emp
where empno =7369;
<2>Ö»Äܲ鵽һÐÐ**********
<3>×ֶθöÊý±ØÐëºÍ±äÁ¿µÄ¸öÊýÒ»ÖÂ
exception
--Òì³£
when <Òì³£Ãû×Ö> then --ÌØ¶¨Òì³£
<´¦ÀíÓï¾ä>
when others then --ËùÓÐÒì³£¶¼¿É²¶»ñ
<´¦ÀíÓï¾ä>
end;
<Àý×Ó>
±àд³ÌÐò ÏòDEPT±íÖвåÈëÒ»Ìõ¼Ç¼£¬
´Ó¼üÅÌÊäÈëÊý¾Ý£¬Èç¹û
Êý¾ÝÀàÐÍÊäÈë´íÎóÒªÓÐÌáʾ
ÎÞ·¨²åÈë¼Ç¼ Ò²ÒªÓÐÌáʾ
Ö»ÄÜÊäÈëÕýÊý,Èç¹ûÓиºÊýÌáʾ
declare
n number;
no dept.deptno%type;
nm dept.dname%type;
lc dept.loc%type;
exp exception; --Òì³£µÄ±äÁ¿
exp1 exception;
num number:=0; --¼ÆÊýÆ÷
pragma exception_init(exp,-1); --Ô¤¶¨ÒåÓï¾ä
--(-1´íÎóºÍÒì³£±äÁ¿¹ØÁª)
pragma exception_init(exp1,-1476);
e1 exception; --×Ô¶¨ÒåÒì³£±äÁ¿
begin
--ÊäÈëÖµ
no := '&񅧏';
num := num + 1;
if no < 0 then
raise e1; --×Ô¶¨ÒåÒì³£µ
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷Òª½²ÊöÈý¸öÄÚÈÝ£º
1.ÈçºÎ´´½¨hierarychyidµÄ±í£¬²åÈëÊý¾Ý¼°»ù±¾µÝ¹é²éѯ¡£
2.½éÉÜhierarchyidµÄ10ÖÖרÓк¯Êý¡£
3.½éÉÜhierarchyidÌØÓеÄÉî¶ÈÓÅÏÈË÷Òý(Depth-First Indexing)ºÍ¹ã¶ÈÓÅÏÈË÷Òý(Breadth-First Indexing)
ÔÚÉÏÒ»½ÚÖÐ
http://blog.csdn.net/tjvictor/archive/2009/07/30/4395677.aspx
ÎÒÃÇÒѾÑÝ ......
ÔÚLINQ to EntitiesÖÐûÓа취ÔÙÏñ LINQ to SQL ÖÐÒ»ÑùʹÓà Contains µÄ·½·¨À´ÊµÏÖsql "in" ¹Ø¼ü×Ö
ÏÂÃæ´úÂëÔÚ LINQ to SQL ÖпÉÐÐ ÔÚLINQ to EntitiesÈ´ÎÞ·¨ÔËÐУº
var s = db.Account.Select(c => c.ID);
var ret =(from t in db.Profile
where&n ......
LINQ to SQL ÐÔÄÜ 10 Tips
http://www.cnblogs.com/worksguo/archive/2008/06/04/1213075.html
ǰһÖÜ£¬ÎÒµÄÓ²ÅÌÓÐÁ½·ÖÇø»µÁË£¬ÎÒ×¼±¸µÄÎÄÕÂÓë×ÊÁ϶¼ÔÚÀïÃæ£¬ËùÒÔLINQµÄÎÄÕÂÍ£ÁËÒ»¶Îʱ¼ä£¬ÕæµÄÌ«²»ºÃÀ£¬ÎªÀ´ÃÖ²¹Ò»Ï¾ÍÏÈ·¢ÕâÆªÎÄÕÂÉÏÀ£¬Ã÷ÌìÔÙһƪ¹ØÓÚDisconnection DataµÄÎÄÕ¡£
Ö»²»¹ýÐҺã¬ÔÚÕ⼸ÌìÖÐÎҽ߾¡È«Á¦ ......
ÈÕÖ¾ÎļþÂú¶øÔì³ÉSQLÊý¾Ý¿âÎÞ·¨Ð´ÈëÎļþʱ£¬¿ÉÓÃÁ½ÖÖ·½·¨£º
¡¡¡¡Ò»ÖÖ·½·¨£ºÇå¿ÕÈÕÖ¾¡£
¡¡¡¡1£®´ò¿ª²éѯ·ÖÎöÆ÷£¬ÊäÈëÃüÁî
¡¡¡¡DUMP TRANSACTION Êý¾Ý¿âÃû WITH NO_LOG
¡¡¡¡2.ÔÙ´ò¿ªÆóÒµ¹ÜÀíÆ÷--ÓÒ¼üÄãҪѹËõµÄÊý¾Ý¿â--ËùÓÐÈÎÎñ--ÊÕËõÊý¾Ý¿â--ÊÕËõÎļþ--Ñ¡ÔñÈÕÖ¾Îļþ--ÔÚÊÕËõ·½Ê½ÀïÑ¡ÔñÊÕËõÖÁXXM,ÕâÀï»á¸ø³öÒ»¸öÔÊÐíÊÕËõµ ......