oracle ´æ´¢Í¼Æ¬µÄ´æ´¢¹ý³Ì[ת]
¡¡C:\>sqlplus /nolog
¡¡¡¡SQL*Plus: Release 9.2.0.1.0 - Production on ÐÇÆÚÈý 1ÔÂ 19 14:46:21 2005
¡¡¡¡Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
¡¡¡¡SQL> connect chanet/chanet@oradb;
¡¡¡¡ÒÑÁ¬½Ó¡£
¡¡¡¡SQL> CREATE TABLE IMAGE_LOB (T_ID VARCHAR2 (5) NOT NULL,T_IMAGE BLOB NOT NULL);
¡¡¡¡±íÒÑ´´½¨¡£
¡¡¡¡SQL> CREATE OR REPLACE DIRECTORY IMAGES AS 'C:\Oracle'; --ͼƬĿ¼
¡¡¡¡Ä¿Â¼ÒÑ´´½¨¡£
¡¡¡¡SQL> CREATE OR REPLACE PROCEDURE IMG_INSERT (TID VARCHAR2,FILENAME VARCHAR2) AS
¡¡¡¡ 2 F_LOB BFILE;
¡¡¡¡ 3 B_LOB BLOB;
¡¡¡¡ 4 BEGIN
¡¡¡¡ 5 INSERT INTO IMAGE_LOB (T_ID, T_IMAGE)
¡¡¡¡ 6 VALUES (TID,EMPTY_BLOB ()) RETURN T_IMAGE INTO B_LOB;
¡¡¡¡ 7 F_LOB:= BFILENAME ('IMAGES', FILENAME);
¡¡¡¡ 8 DBMS_LOB.FILEOPEN (F_LOB, DBMS_LOB.FILE_READONLY);
¡¡¡¡ 9 DBMS_LOB.LOADfromFILE (B_LOB, F_LOB, DBMS_LOB.GETLENGTH (F_LOB));
¡¡¡¡11 DBMS_LOB.FILECLOSE (F_LOB);
¡¡¡¡12 COMMIT;
¡¡¡¡13 END;
¡¡¡¡14 /
¡¡¡¡¹ý³ÌÒÑ´´½¨¡£
¡¡¡¡SQL>-- ʾÀý
¡¡¡¡SQL> EXEC IMG_INSERT('1','f_TEST.jpg');
¡¡¡¡PL/SQL ¹ý³ÌÒѳɹ¦Íê³É¡£
Ïà¹ØÎĵµ£º
Can you connect to an Oracle database with a 64-bit Oracle client?
Technote (FAQ)
Question
You are unable to connect to an Oracle database with a 64-bit Oracle client. Does Lotus Enterprise Integrator (LEI), Lotus Domino Enterprise Connection Services (DECS), or LSX ......
Oracle
1£¬shutdownÖ®ºó£¬ÈçºÎÆô¶¯Êý¾Ý¿âʵÀý£¿
ͨ¹ýCMDÃüÁî·û sqlplus "sys/password as
sysdba"£¬»áÁ¬µ½Ò»¸ö¿ÕÏÐʵÀý£¬ÕâÑù¿ÉÔÙÓÃstartupÃüÁî¡£
2£¬×°ÁËÊý¾Ý¿âÖ®ºó£¬ÓÃÁËshutdown£¬ºóÓÃÁËstartupµÈÆô¶¯Ö®ºó£¬¿ÉÓÃsql
plusºÍÍøÒ³·½Ê½Á¬oracle¡£µ«ÓÃjdbcÁ¬½Ó³ö´í£¿
ÊǼàÌýÆ÷ûÆô¶¯£ºD:\oracle\product\10.1.0\Db_1\ ......
select * from test where rownum <=10 ÏÂÃæÊǹØÓÚrownumµÄ½éÉÜ ================================ RownumºÍrow_number() over()µÄʹÓà ROWNUMÊÇOracle´Ó8¿ªÊ¼ÌṩµÄÒ»¸öαÁУ¬ÊÇ°ÑSQL³öÀ´µÄ½á¹û½øÐбàºÅ£¬Ê¼ÖÕ´Ó1¿ªÊ¼£¬³£¼ûµÄÓÃ;¾ÍÊÇÓÃÀ´·ÖÒ³Êä³ö. ±ÈÈç SELECT * from torderdetail a WHERE ROWNUM <= 10 ÕâÌõÓï¾ä¾ ......
MySQL:
SELECT column from table
ORDER BY RAND()
LIMIT 1
PostgreSQL:
SELECT column from table
ORDER BY RANDOM()
LIMIT 1
Microsoft SQL Server:
SELECT TOP 1 column from table
ORDER BY NEWID()
IBM DB2
SELECT column, RAND() as IDX
from table
ORDER BY IDX FETCH FIRST 1 ROWS ONLY
Thanks Ti ......
Ëùν³öÓÚjob¶øʤÓÚjob£¬ËµµÄ¾ÍÊÇOracle 10gºóµÄÐÂÌØÐÔSchedulerÀ²¡£ÔÚ10g»·¾³ÖУ¬ORACLE½¨ÒéʹÓÃSchedulerÌæ»»ÆÕͨµÄjob£¬À´¹ÜÀíÈÎÎñµÄÖ´ÐС£Æäʵ£¬½«SchedulerÃèÊö³É¹ÜÀíjobµÄ¹¤¾ßÒѾ̫¹ýƬÃæÁË£¬10G°æ±¾ÖÐÐÂÔöµÄScheduler¾ø²»½ö½öÊÇ´´½¨ÈÎÎñÕâô¼òµ¥¡£¡£¡£¡£
Ìáʾ£ºORACLEÖйÜÀíSchedulerÊÇͨ¹ýDBMS_SCHEDULER°ü£¬±¾ÕÂÒ ......