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

ORACLEÓÃLIMITʵÏÖÀàËÆ·ÖÒ³

Á·Ï°ÁËORACLEÀàËÆµÄ·ÖÒ³,Ä¿µÄ:ORACLEµÄLIMITʹÓÃ
declare
type name_arrary_type is varray(20) of varchar2(10);
name_arrary  name_arrary_type;
rowss int:=&ÊäÈëÒ³¼Ç¼Êý;
dpno int:=&ÊäÈ벿ÃźÅ;
v_count int:=0;
cursor  emp_cursor(dpno int) is select ename from emp where deptno=dpno;
begin
open emp_cursor(dpno);
loop
fetch emp_cursor bulk collect into name_arrary limit rowss;
dbms_output.put_line('²¿ÃÅ'||dpno||'Ô±¹¤:');
for i in 1..(emp_cursor%rowcount-v_count) loop
dbms_output.put_line(i||'    '||name_arrary(i)||'  ');
end loop;
dbms_output.put_line('µ±Ç°Ò³Êý:'||(v_count/rowss+1));
dbms_output.new_line;
v_count :=emp_cursor%rowcount;
exit when emp_cursor%notfound;
end loop;
dbms_output.put_line('ÿҳ['||rowss||']Ìõ¼Ç¼,×ÜÒ³Êý:['||ceil(emp_cursor%rowcount/rowss)||']');
close emp_cursor;
end;
ÔËÐнá¹û:
²¿ÃÅ20Ô±¹¤:
1    SMITH 
2    JONES 
3    SCOTT 
4    ADAMS 
µ±Ç°Ò³Êý:1
²¿ÃÅ20Ô±¹¤:
1    FORD  
2    YA_PING 
µ±Ç°Ò³Êý:2
ÿҳ[4]Ìõ¼Ç¼,×ÜÒ³Êý:[2]


Ïà¹ØÎĵµ£º

vb Á¬½ÓoracleÊý¾Ý¿â

         
    Dim cn As ADODB.Connection
    Dim rs     As ADODB.Recordset
    Set cn = New ADODB.Connection
    cn.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info= ......

¶ÁÈ¡oracle blob×Ö·û´®

OleDbConnectioncon=newOleDbConnection(cnnstr);
try
{
con.Open();
}
catch
{}
OleDbCommandcmd=newOleDbCommand(strSQL,con);
System.Data.OleDb.OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())
 
{
stringdd=dr["gggg"].ToString();
byte[]ooo=(byte[])dr["hhhh"];
stringstr;
str=Sys ......

Oracle µÄÊÓͼÓëË÷Òý


ÓбíA(×Ö¶ÎA1,A2)ºÍ±íB(×Ö¶ÎB1,B2).
×Ö¶ÎA2,B2É϶¼ÓÐË÷Òý.
A,B ±íÁª²é
sql1 Õâ¸ösql ·Ç³£¿ì 2ÃëµÄÑù×Ó
select * from A,B where A.A1=B.B1(+) and A2='Öµ1'
sql2 Õâ¸ösql Âýµ½ÈÃÈËÎÞ·¨ÈÌÊÜ
select * from A,B where A.A1=B.B1(+) and B2='Öµ1'
ÍâÁªÒÔºó ±íBÉϵÄË÷Òý²»Æð×÷ÓÃÁË.
Èç¹û»»³ÉÄÚÁª ËٶȺܿì.
sel ......

ORACLE SQLµÄÓÅ»¯


SQLµÄÓÅ»¯Ó¦¸Ã´Ó5¸ö·½Ãæ½øÐе÷Õû£º
1.È¥µô²»±ØÒªµÄ´óÐͱíµÄÈ«±íɨÃè
2.»º´æÐ¡ÐͱíµÄÈ«±íɨÃè
3.¼ìÑéÓÅ»¯Ë÷ÒýµÄʹÓÃ
4.¼ìÑéÓÅ»¯µÄÁ¬½Ó¼¼Êõ
5.¾¡¿ÉÄܼõÉÙÖ´Ðмƻ®µÄCost
SQLÓï¾ä£º
ÊǶÔÊý¾Ý¿â(Êý¾Ý)½øÐвÙ×÷µÄΩһ;¾¶£»
ÏûºÄÁË70%~90%µÄÊý¾Ý¿â×ÊÔ´£»¶ÀÁ¢ÓÚ³ÌÐòÉè¼ÆÂß¼­£¬Ïà¶ÔÓÚ¶Ô³ÌÐòÔ´´úÂëµÄÓÅ»¯£¬¶ÔSQLÓï¾äµÄÓÅ» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ