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

Oracle:PL/SQL ÖÐÈçºÎʹÓÃArray

http://tech.163.com/05/0701/10/1NIODMQS00091589.html
ÒòΪÔÚPL/SQL Öв¢Ã»ÓÐÊý×é.
ÕâÊÇż²é×ÊÁÏÕҵķ¶ÀýºÍ×Ô¼ºÐ´µÄ·¶ÀýÀ´½âÊÍÈçºÎÔÚPL/SQL ÖÐʹÓÃÊý×é. Ò²ÐíºÜ¶àÈËÒÑÖªµÀ, ²»¹ý¾ÍÊÇÈò»ÖªµÀµÄÅóÓÑÃÇÁ˽âһϰɡ£
----------------------
µ¥Î¬Êý×é
------------------------
DECLARE
TYPE
emp_ssn_array IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;
best_employees
emp_ssn_array;
worst_employees emp_ssn_array;
BEGIN
best_employees(1)
:= '123456';
best_employees(2) := '888888';
worst_employees(1)
:= '222222';
worst_employees(2) := '666666';
FOR i IN
1..best_employees.count LOOP
DBMS_OUTPUT.PUT_LINE('i='|| i || ',
best_employees= ' ||best_employees(i)
|| ', worst_employees= '
||worst_employees(i));
END LOOP;
END;
---------------------- ¶à
άÊý×é
------------------------
DECLARE
TYPE
emp_type IS RECORD
( emp_id employee_table.emp_id%TYPE,
emp_name
employee_table.emp_name%TYPE,
emp_gender
employee_table.emp_gender%TYPE );
TYPE emp_type_array IS TABLE OF
emp_type
INDEX BY BINARY_INTEGER;
emp_rec_array emp_type_array;
emp_rec
emp_type;
BEGIN
emp_rec.emp_id := 300000000;
emp_rec.emp_name
:= 'Barbara';
emp_rec.emp_gender := 'Female';
emp_rec_array(1)
:= emp_rec;
emp_rec.emp_id := 300000008;
emp_rec.emp_name :=
'Rick';
emp_rec.emp_gender := 'Male';
emp_rec_array(2) :=
emp_rec;
FOR i IN 1..emp_rec_array.count LOOP
DBMS_OUTPUT.PUT_LINE('i='||i
||',
emp_id ='||emp_rec_array(i).emp_id
||', emp_name
='||emp_rec_array(i).emp_name
||', emp_gender =
'||emp_rec_array(i).emp_gender);
END LOOP;
END;
--------------
Result --------------
i=1, emp_id =300000000, emp_name =Barbara,
emp_gender = Female
i=2, emp_id =300000008, emp_name =Rick,
emp_gender = Male
×¢
£ºÔÚPL/SQL
ÖÐÊÇûÓÐÊý×é(Array) ¸ÅÄîµÄ. µ«ÊÇÈç¹û³ÌÐòÔ±ÏëÓÃArray µÄ»°, ¾ÍµÃ±äͨһÏÂ, ÓÃTYPE ºÍTable of Record
À´´úÌæ¶àάÊý×é, Ò»ÑùͦºÃÓõġ£
emp_type ¾ÍºÃÏóÒ»¸ötable ÖеÄÒ»Ìõrecord Ò»Ñù, ÀïÃæÓÐid,
name,genderµÈ¡£emp_type_array Ïó¸ötable, ÀïÃ溬ÓÐÒ»ÌõÌõÕ


Ïà¹ØÎĵµ£º

VB.NETÖÐÄܲ»ÄܶÔDATASETÔÙÓÃSQLÓïÑÔ

¿ÉÒÔɸѡÊý¾Ý£¬µ«²»ÄÜÊDZê×¼µÄSQLÓï¾ä£º
Me.DsUserManager1.Tables(0).Select("id > 5 and id <20")
---------------------------------------------------------------
1.ɸѡ£º
dataset.tables("tabname").select("id=1")'Ï൱ÓÚSQLÖÐWHEREºóµÄÌõ¼þÄÚÈÝ
2.±£´æµ½ÄÄ£¿Õâµ¹ÊDz»Öª ......

ÓÃÃüÁîÐÐ(CMD)ÖÐÆô¶¯ºÍ¹Ø±ÕORACLE·þÎñ


ÓÃÃüÁîÐÐ(CMD)ÖÐÆô¶¯ºÍ¹Ø±ÕORACLE·þÎñ
 
 
¼àÌýÆô¶¯
lsnrctl start
¼àÌýÍ£Ö¹
lsnrctl stop
Æô¶¯Oracle
net start oracleservicesid
Í£Ö¹Oracle
net stop oracleservicesid
 
netÃüÁîÊÇwinϵͳÃüÁÆäËüµÄ·þÎñÆô¶¯ºÍÉÏÃæµÄÀàËÆ£¡
......

Redhat Linux oracle 10g em °´Å¥ÂÒÂë½â¾ö

ÍøÉÏÓкܶàµÄ×ÊÁÏ£¬²Î¿¼itput£¨http://space.itpub.net/471666/viewspace-215923£©µÄ¡£
OS : Redhat
DB : Oracle 10.2.0.4.0
1.ÐÞ¸Äjdk ÏÂÃæµÄ×ÖÌå¡£
[oracle@a ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@a ~]]$ mv font.properties font.properties_bak
[oracle@a ~]]$
[oracle@a ~]]$ cp font.properties.zh_CN.R ......

sqlÃæÊÔÌâÄ¿

Sql³£ÓÃÓï·¨ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
 
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK) Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ