Use dbms_utility.name_tokenize to split a name : dbms_utility « System Packages « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » System Packages » dbms_utility 
31. 30. 3. Use dbms_utility.name_tokenize to split a name
SQL> set echo on
SQL>
SQL> declare
  2      l_a      varchar2(30);
  3      l_b      varchar2(30);
  4      l_c      varchar2(30);
  5      l_dblink varchar2(30);
  6      l_next   number;
  7
  8      type vcArray is table of varchar2(255);
  9      l_names vcArray := vcArray'owner.pkg.proc@database_link',
 10                   'owner.tbl@database_link',
 11                   'tbl',
 12                   '"Owner".tbl',
 13                   'pkg.proc',
 14                   'owner.pkg.proc',
 15                   'proc',
 16                   'owner.pkg.proc@dblink with junk',
 17                   '123' );
 18  begin
 19      for i in 1 .. l_names.count
 20      loop
 21      begin
 22          dbms_utility.name_tokenize(name   => l_names(i),
 23                                     a      => l_a,
 24                                     b      => l_b,
 25                                     c      => l_c,
 26                                     dblink => l_dblink,
 27                                     nextpos=> l_next );
 28
 29          dbms_output.put_line( 'name    ' || l_names(i) );
 30          dbms_output.put_line( 'A       ' || l_a );
 31          dbms_output.put_line( 'B       ' || l_b );
 32          dbms_output.put_line( 'C       ' || l_c );
 33          dbms_output.put_line( 'dblink  ' || l_dblink );
 34          dbms_output.put_line( 'next    ' || l_next || ' ' || length(l_names(i)));
 35      exception
 36          when others then
 37              dbms_output.put_line( 'name    ' || l_names(i) );
 38              dbms_output.put_line( sqlerrm );
 39      end;
 40      end loop;
 41  end;
 42  /
name    owner.pkg.proc@database_link
A       OWNER
B       PKG
C       PROC
dblink  DATABASE_LINK
next    28 28
name    owner.tbl@database_link
A       OWNER
B       TBL
C
dblink  DATABASE_LINK
next    23 23
name    tbl
A       TBL
B
C
dblink
next    3 3
name    "Owner".tbl
A       Owner
B       TBL
C
dblink
next    11 11
name    pkg.proc
A       PKG
B       PROC
C
dblink
next    8 8
name    owner.pkg.proc
A       OWNER
B       PKG
C       PROC
dblink
next    14 14
name    proc
A       PROC
B
C
dblink
next    4 4
name    owner.pkg.proc@dblink with junk
A       OWNER
B       PKG
C       PROC
dblink  DBLINK
next    22 31
name    123
ORA-00931: missing identifier

PL/SQL procedure successfully completed.

SQL>
31. 30. dbms_utility
31. 30. 1. dbms_utility.get_hash_value
31. 30. 2. Use dbms_utility.name_resolve to find a package
31. 30. 3. Use dbms_utility.name_tokenize to split a name
31. 30. 4. Call dbms_utility.db_version to get the version and its compatible version
31. 30. 5. Use dbms_utility.comma_to_table, dbms_utility.table_to_comma to parse comma delimited value
31. 30. 6. Call dbms_utility.get_parameter_value to get the value of utl_file_dir
31. 30. 7. Call dbms_utility.get_time twice
31. 30. 8. Call dbms_utility.analyze_schema analyze schema
31. 30. 9. Assign value from dbms_utility.get_time to a number variable
31. 30. 10. Call dbms_utility.get_time twice to time the insert statement
31. 30. 11. Timing log
31. 30. 12. dbms_utility.format_error_stack
31. 30. 13. DBMS_UTILITY.FORMAT_CALL_STACK and DBMS_UTILITY.FORMAT_ERROR_STACK
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.