±±´óÇàÄñoracleѧϰ±Ê¼Ç31
pl/sql ±í
ÔÚpl/sql¿éÖÐÁÙʱʹÓá¢ÏñÊý×éÒ»ÑùµÄ¶ÔÏó
°üº¬Ò»ÁкÍÒ»¸öÖ÷¼ü
²»ÄܶÔÁкÍÖ÷¼ü½øÐÐÃüÃû
ÁпÉÒÔÊÇÈκαêÁ¿Êý¾ÝÀàÐÍ
Ö÷¼ü±ØÐëÊÇbinary_integerÀàÐÍ
´óСûÓÐÏÞÖÆ
ÉùÃ÷pl/sql±í
¶¨Òå±íµÄÀàÐÍ
type ÀàÐÍÃû is table of ÁÐÀàÐÍ|±äÁ¿Êý¾ÝÀàÐÍ index by binary_integer;
ÉùÃ÷±í±äÁ¿
±íÃû ÀàÐÍÃû;
ÒýÓÃpl/sql±í
±íÃû(ϱê)
¸³Öµ
±íÃû(ϱê):=±í´ïʽ;
ÊôÐÔ·½·¨:
count --·µ»Øpl/sql±íµÄ×ÜÐÐÊý£»
delect --ɾ³ýpl/sql±íµÄËùÓÐÄÚÈÝ£»
delect(ÐÐÊý) --ɾ³ýpl/sql±íµÄÖ¸¶¨µÄÐУ»
delct(¿ªÊ¼ÐУ¬½áÊøÐÐ) --ɾ³ýpl/sql±íµÄ¶àÐУ»
first --·µ»Ø±íµÄµÚÒ»¸öINDEX;
next(ÐÐÊý) --Õâ¸öÐÐÊýµÄÏÂÒ»ÌõµÄINDEX;
last --·µ»Ø±íµÄ×îºóÒ»¸öINDEX;
declare
Type stuNameTableType is table of student.stu_name%type index by binary_integer;
stuNameTable stuNameTableType;
begin
for i in 1..10
loop
stunametable(i):='student'||i;
end loop;
for i in 1..stunametable.count
loop
dbms_output.put_line('µÚ'||i||'¸öÔªËØ£º'||stunametable(i));
end loop;
end;
±íÀàÐÍÐèҪʹÓÃbulk collectÅúÁ¿°ó¶¨½øÐÐselect¸³Öµ£¬bulk collect×Ó¾äÒ²¿ÉÓÃÓÚFetch bulk collect into ×Ó¾äÖÐ
declare
TYPE studentTableType is table of student%rowtype index by binary_integer;
studentTable studentTableType;
begin
select * bulk collect into studentTable from student order by stu_id;
for i in 1..studentTable.count loop
dbms_output.put_line(studentTable(i).stu_id);
dbms_output.put_line(studentTable(i).stu_name);
dbms_output.put_line(studentTable(i).stu_sex);
dbms_output.put_line(studentTable(i).stu_birthday);
end loop;
end;
RecordÀàÐÍ
ÉùÃ÷
type ¼Ç¼ÀàÐÍÃû is record (
×Ö¶Î1 ÀàÐÍ[not null[:=±í´ïʽ]]
×Ö¶În ÀàÐ
Ïà¹ØÎĵµ£º
LinuxÏÂÆô¶¯oracle10gµÄemºÍisqlplusµÄ·½·¨:
×¢:$ORACLE_HOMEΪoracleµÄ°²×°Â·¾¶
1,ʹÓÃEM(enterprise managment)
1.1Æô¶¯EM
$ORACLE_HOME/bin/emctl start dbconsole
Èç¹û³öÏÖÏÂÃæÏà¹ØÐÅÏ¢,˵Ã÷·þÎñÆô¶¯
Z set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.1.0.3.0
Copyright (c) 1996, 200 ......
ʱ¼ä: 2006-06-15 À´×Ô£ºCSDN
< type="text/javascript"><!--
google_ad_client = "pub-0103898066674568";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_ ......
1)µ¼ÈëoracleÊý¾Ý¿âÎļþ.dmpʱ³öÏÖ´íÎó
imp PERSONNEL_MANAGE/MWQ@MIS file=C:\personnel_manage.dmp fromuser=PERSONNEL_MANAGE ignore=y commit=y grants=y;
IMP-00058: Óöµ½ ORACLE ´íÎó 1017
ORA-01017: invalid username/password; logon deniedÓû§Ãû:
¿ÚÁî:
IMP-00058: Óöµ½ ORACLE ´íÎó 1017
ORA-01017: in ......
/*============´´½¨Customer±í==========*/
create table Customer
(
Customer_id number(6) not null,
Customer_name varchar2(50) not null,
Password varcha ......