¹ØÓÚoracleµÄ×Ô¶¨ÒåtypeµÄÎÊÌâ - Oracle / »ù´¡ºÍ¹ÜÀí
ʹÓÃÁË×Ô¶¨Òåtype
ÈçÏÂ
create or replace type customtype as object(
ele1 char(7),
ele2 char(3)
);
Ö®ºóÔÚpackageÀïÃæÏëʹÓÃ
ÓÚÊÇд
l_ele1_c customtype.ele1%type;
µ«ÊDz»ÐУ¬pls00206µÄ´íÎó
ÆäʵÎÒ¾ÍÊÇÏëÔÚ×Ô¶¨ÒåtypeÄDZ߶¨ÒåºÃÁË£¬packageÄDZßÒÔºó¾Í²»»á±äÁË£¬Ö»ÒªÊ¹ÓÃcustomtype.ele1µÄtype¾ÍºÃÁË
ÇëÎÊÓÐûʲô½â¾ö·½°¸£¿
ʵÔÚ²»ÐУ¬¾ÍÖ»Äܶ¨Òål_ele1_c char(7);ÁË¡¡
TYPE Table_ele1 IS TABLE OF customtype.ele1%TYPE;
TABele1 Table_ele1;
ÓÃTABele1¾Í¿ÉÒÔÁË(Ãû×ÖËæ±ã)
Â¥É쵀 ËûòËÆ ÏëÒýÓõÄÊÇ TYPE ÀïÃæµÄÕâ¸ö
ÄÇÄãΪʲô²»Ö±½Ó¶¨ÒåÊÇ ¾Í
create or replace type customtype as object(
ele1 char(7)
);
TABele1 Table_ele1;
лл¥ÉÏÁ½Î»£¬Æäʵ¾ÍÊÇ¿Í»§¸øÁ˸ötype¶¨Ò壬˵һ¶¨ÒªÓã¬È»ºóÒªÎÒÀ´Ð´Ò»¸öpackage£¬ÓÖ˵±ØÐëÒªÓÃ%typeµÄÐÎʽ¡£ÎҾ;À½áÁË¡¡
ÔÀ´¿ÉÒÔÏÈÓñäÁ¿Ê¹ÓÃÕâ¸öÀàÐÍ
È»ºóʹÓñäÁ¿µÄtypeÀ´¶¨Òå¡¡
Àý£º
l_type customtype;
l_ele1_c l_type.ele1%type;
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
¼ÙÉètable01 ÖÐÓÐ ÒÔÏÂ×ÊÁÏ
emp_no emp_name
------- ------------
0001 TOM
0002 JOHN
0003 MARY
³£Óõ绰
¶øÎÒÃÇÒªµÃµ½ÒÔϵÄOUTPUT (»òÊǸ÷ÖÖÆäËûµÄoutput)
0001,TOM
0002,JOHN
......
1.ÏÖÔÚϵͳÊÇ64λµÄserver2003£¨web·þÎñÆ÷IIS6.0£©×°µÄÊÇ10gµÄoracle¿Í»§¶Ë¡£
2.Êý¾Ý¿â·þÎñÆ÷ͬÑùÊÇ32λµÄserver2003µÄoracle10g¡£
3.web·þÎñÆ÷ÉÏÓÃsqlplus·ÃÎÊÊý¾Ý¿â-Õý³££»
vs2008ÄÚ²¿½¨Á¢Êý¾ÝÔ´£¬·ÃÎÊ ......
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬
·½·¨1£º
°Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû'
......
ÏÖÔÚ ÎÒÓÐ Êý¾Ý¿â oracle_A £¬ÀïÃæÓÐÕűí Ϊ table_A, È»ºóÎÒÒª¶¨Ê±µÄ °Ñ ÁíÒ»¸öÊý¾Ý¿â oracle_B,ÀïÃæµÄÒ»Õűí table_BµÄÊý¾Ý£¬ÐÂÔö·ÅÈëtable_AÀȻºóÔÙÇå¿Õtable_B£¬ÇëÎÊÓ¦¸ÃÔõô×ö£¿
ÓÃд¸ö´æ´¢¹ý³Ì£¬È»ºóÓ ......