Oracle Êý¾ÝÀàÐÍ·ÖÏí
¸øÍŶÓÄÚ²¿×öµÄÒ»¸öOracle Êý¾ÝÀàÐÍ·ÖÏí£¬Ö÷ÒªÊǹØÓÚOracleÊý¾ÝÀàÐÍһЩÄÚ²¿´æ´¢½á¹¹¼°ÐÔÄܽéÉÜ¡£
http://www.slideshare.net/yzsind/oracle-4317768
ÒÔÏÂÊÇPPTÖÐunDumpNumberº¯ÊýµÄÈ«²¿´úÂ룺
create or replace function unDumpNumber(iDumpStr varchar2) return number is
TYPE ByteArray IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
Bytes ByteArray;
Result number;
i integer;
pos1 integer;
pos2 integer;
pos3 integer;
vlength integer;
begin
result := 0;
pos1 := instr(iDumpStr, 'Len=') + 4;
pos2 := instr(iDumpStr, ':');
vlength := substr(iDumpStr, pos1, pos2 - pos1);--get length
i := 0;
pos2 := pos2 + 1;
--½«dumpµÄ×Ö·û´®Ìî³äµ½Êý×éÖÐ
for i in 0..vlength-1
loop
pos3 := instr(iDumpStr, ',', pos2);
if pos3>0 then
Bytes(i) := trim(substr(iDumpStr, pos2, pos3 - pos2 ));
else
Bytes(i) := trim(substr(iDumpStr, pos2));--×îºó1×Ö½Ú
end if;
pos2 := pos3 + 1;
end loop;
--»¹ÔNUMBER
if Bytes(0) = 128 then --128±íʾ0
result := 0;
elsif Bytes(0) > 128 then --´óÓÚ128±íʾÕýÊý
for i in 1 .. vlength - 1 loop
result := result +
(Bytes(i) - 1) * power(100, (Bytes(0) - 193) - i+1);
end loop;
else --СÓÚ128±íʾ¸ºÊý
for i in 1 .. vlength - 2 loop
result := result +
&nb
Ïà¹ØÎĵµ£º
----±¾Óû§ËùÓµÓеÄϵͳȨÏÞ:
select * from user_sys_privs;
---±¾Óû§¶ÁÈ¡ÆäËûÓû§¶ÔÏóµÄȨÏÞ:
¡¡select * from user_tab_privs;
-----Ìí¼ÓȨÏÞ
GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW ,
DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE,
DBA,CONNECT,RESOURCE,CREATE&nbs ......
select distinct id
from table t
where rownum < 10
order by t.id desc;
ÉÏÊöÓï¾äµÄ¹ýÂËÌõ¼þÖ´ÐÐ˳Ðò ÏÈwhere --->order by --->distinct
Èç¹ûÓÐgroup byµÄ»° group by ÔÚorder byÇ°ÃæµÄ ......
ÔÚoracleÖУ¬ÎÒÃÇ´´½¨Ò»¸öÖ÷¼ü£¬Ôòͬʱ×Ô¶¯´´½¨ÁËÒ»¸öͬÃûµÄΨһË÷Òý£»É¾³ýÖ÷¼ü£¬ÔòÖ÷¼üÔ¼ÊøºÍ¶ÔÓ¦µÄΨһË÷Òý¶¼É¾³ýÁË¡£ÕâÊÇÎÒÃǾ³£¼ûµ½µÄÏÖÏó¡£
·¢³öÒ»¸ö´´½¨Ö÷¼üµÄsql£¬oracleÆäʵִÐÐÁËÁ½²½£º´´½¨Ö÷¼üÔ¼Êø¡¢´´½¨/¹ØÁª ΨһË÷Òý¡£²½ÖèÊÇÕâÑùµÄ£º
´´½¨Ö÷¼üÔ¼ÊøÊ±£¬¼ì²é¸ÃÖ÷¼ü×Ö¶ÎÉÏÊÇ·ñÒѾ´æÔÚΨһË÷Òý¡£Èô² ......
SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
re ......
create or replace and compile java source named md5util as
import java.security.MessageDigest;
public class MD5Util
{
public static String encrypt(String s)
{
char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', ......