table type usage sample:
1, create or replace type ename_tab as table of varchar2(30) ;
2,
set serverout on
declare
p1 ename_tab ;
p2 ename_tab ;
begin
p1 :=ename_tab('') ;
--p2 :=ename_tab('') ;
p1.extend(2);
-- p2.extend(1);
p1(1) := 'Jack' ;
p1(2) := 'Mikel' ;
p1(3) := 'Dameon' ;
p2 := p1 ;
p2(1) := 'Jack-- 1' ;
p2(2) := 'Mikel--2' ;
p2(3) := 'Dameon--3' ;
dbms_output.put_line(p1(1)) ;
dbms_output.put_line(p1(2)) ;
dbms_output.put_line(p1(3)) ;
-- dbms_output.put_line(d) ;
end;
/
3, Conclusion:
1, the table type variable must be initizlize as like : tab_type('').
2, table variable Can be assigned directly just like scaler variable, and the assigned tab var is not required to initialized.
3, the assigned tab var and source tab var occupies difference memory space address.
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/350519/viewspace-1038604/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- User defined table type and table valued parameters
- Percona-Tookit工具包之pt-table-usage
- plsql_列集_collection_type is table ofSQL
- SAP WM中階Storage Type的Capacity Check – Usage check based on SUT
- Inheritance with EF Code First: Part 2 – Table per Type (TPT)
- Javacc sampleJava
- ORA-39117: Type needed to create table is not included in this operation
- dnsjava usageDNSJava
- oracle global temporary table全域性臨時表_測試及v$tempseg_usageOracle
- Inheritance with EF Code First: Part 3 – Table per Concrete Type (TPC)
- [20141106]type and table.txt
- sample a texture as a rendertarget
- netty sampleNetty
- SQL查詢table或index異常增長問題 - space_usage (show_space)SQLIndex
- oracle10g_plsql_rercursor_type_table of_小引例_bulk collect intoOracleSQL
- ORA-14060: data type or length of a table partitioning column may not be changed
- costume GIT usage for meGit
- solaris 10 disksuite usageUI
- Error in Memento Sample Code?Error
- A Simple Sample for Expression Tree (轉)Express
- create table進階學習(二)_dba_free_temp_space_v$tempseg_usage_v$sort_segment
- [Oracle Script] Temporary Sort UsageOracle
- [Oracle Script] Rollback Segment UsageOracle
- BlockRecover Restrictions and Usage NotesBloCREST
- Clear Case usage tips
- Oracle runInstaller 's UsageOracle
- Oracle NUMA usage recommendationOracle
- MySQL, Incorrect usage of UNION and ORDER BYMySql
- Directx3D SimpleSample Sample3D
- (C language Sample ) Compile procedureCompile
- 應用程式日誌Sample
- RCE_sample_ctf_questions(ing)
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] check temp tablespace usageOracle
- [Oracle Script] Undo Usage Per statusOracle
- [Oracle Script] Undo Usage Per sessionOracleSession
- Oracle 11g tablespace usageOracle
- [Shell] Linux monitor tablespace usageLinux