Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » APEX_UTIL
APEX_UTIL [message #454511] |
Thu, 06 May 2010 03:40 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
Hello every one.
i am working in oracle 10g, and i dont find Apex_UTIL, So what should i do for that,
Thanks and
Regards.
[Updated on: Thu, 06 May 2010 03:48] Report message to a moderator
|
|
|
|
Re: APEX_UTIL [message #454522 is a reply to message #454519] |
Thu, 06 May 2010 03:56 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
Thanks sir
Aacatually i need it to create a function which convert the comma seperated list of value into nasted table.
|
|
|
|
Re: APEX_UTIL [message #454529 is a reply to message #454525] |
Thu, 06 May 2010 04:02 |
|
rahulvb
Messages: 924 Registered: October 2009 Location: Somewhere Near Equator.
|
Senior Member |
|
|
you can write function with following code.
SET SERVEROUTPUT ON
DECLARE
l_list1 VARCHAR2(50) := 'A,B,C,D,E,F,G,H,I,J';
l_list2 VARCHAR2(50);
l_tablen BINARY_INTEGER;
l_tab DBMS_UTILITY.uncl_array;
BEGIN
DBMS_OUTPUT.put_line('l_list1 : ' || l_list1);
DBMS_UTILITY.comma_to_table (
list => l_list1,
tablen => l_tablen,
tab => l_tab);
FOR i IN 1 .. l_tablen LOOP
DBMS_OUTPUT.put_line(i || ' : ' || l_tab(i));
END LOOP;
DBMS_UTILITY.table_to_comma (
tab => l_tab,
tablen => l_tablen,
list => l_list2);
DBMS_OUTPUT.put_line('l_list2 : ' || l_list2);
END;
/
|
|
|
Re: APEX_UTIL [message #454530 is a reply to message #454525] |
Thu, 06 May 2010 04:03 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
Sir if u dont mind then please help me to create that function i.e String_to_table convert the comma seperated list of value into nasted table.
Thanks
|
|
|
Re: APEX_UTIL [message #454534 is a reply to message #454525] |
Thu, 06 May 2010 04:04 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
Thanks sir.
Sir if you dont mind then please help me to create the function which convert the comma seperated list of value into nasted table.
|
|
|
|
Re: APEX_UTIL [message #454542 is a reply to message #454538] |
Thu, 06 May 2010 04:13 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
ok thanks. sir please tell me that apex_util is avalivable in oracle 10g or not.
Thanks Miche and rahulvb
|
|
|
|
|
Re: APEX_UTIL [message #454643 is a reply to message #454575] |
Thu, 06 May 2010 12:41 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
Be aware of DBMS_UTILITY.comma_to_table limitations!
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 l_list1 VARCHAR2(50) := 'AAA,BBB,CCC , DDD';
3 l_tablen BINARY_INTEGER;
4 l_tab DBMS_UTILITY.uncl_array;
5 BEGIN
6 DBMS_OUTPUT.put_line('l_list1 : ' || l_list1);
7
8 DBMS_UTILITY.comma_to_table (
9 list => l_list1,
10 tablen => l_tablen,
11 tab => l_tab);
12 END;
13 /
l_list1 : AAA,BBB,CCC , DDD
PL/SQL procedure successfully completed.
SQL> DECLARE
2 l_list1 VARCHAR2(50) := '1,2,3BB';
3 l_tablen BINARY_INTEGER;
4 l_tab DBMS_UTILITY.uncl_array;
5 BEGIN
6 DBMS_OUTPUT.put_line('l_list1 : ' || l_list1);
7
8 DBMS_UTILITY.comma_to_table (
9 list => l_list1,
10 tablen => l_tablen,
11 tab => l_tab);
12 END;
13 /
l_list1 : 1,2,3BB
DECLARE
*
ERROR at line 1:
ORA-00931: missing identifier
ORA-06512: at "SYS.DBMS_UTILITY", line 125
ORA-06512: at "SYS.DBMS_UTILITY", line 160
ORA-06512: at "SYS.DBMS_UTILITY", line 202
ORA-06512: at line 8
SQL> DECLARE
2 l_list1 VARCHAR2(50) := 'create,table,for';
3 l_tablen BINARY_INTEGER;
4 l_tab DBMS_UTILITY.uncl_array;
5 BEGIN
6 DBMS_OUTPUT.put_line('l_list1 : ' || l_list1);
7
8 DBMS_UTILITY.comma_to_table (
9 list => l_list1,
10 tablen => l_tablen,
11 tab => l_tab);
12 END;
13 /
l_list1 : create,table,for
DECLARE
*
ERROR at line 1:
ORA-00931: missing identifier
ORA-06512: at "SYS.DBMS_UTILITY", line 125
ORA-06512: at "SYS.DBMS_UTILITY", line 160
ORA-06512: at "SYS.DBMS_UTILITY", line 202
ORA-06512: at line 8
SQL>
|
|
|
|
Re: APEX_UTIL [message #454766 is a reply to message #454645] |
Fri, 07 May 2010 05:53 |
BilalKhan
Messages: 18 Registered: April 2010 Location: Pakistan
|
Junior Member |
|
|
Sir i create the function but it display the error message
SQL> ed
Wrote file afiedt.buf
1 Create or replace function STRING_TO_TABLE(pi_string in varchar2)
2 Return varchar2
3 is
4 l_tablen BINARY_INTEGER;
5 l_tab DBMS_UTILITY.uncl_array;
6 BEGIN
7 DBMS_UTILITY.comma_to_table (
8 list => pi_string,
9 tablen => l_tablen,
10 tab => l_tab);
11 FOR i IN 1 .. l_tablen LOOP
12 l_tab(i) := pi_string;
13 END LOOP;
14* END STRING_TO_TABLE ;
SQL> /
Function created.
SQL> ed
Wrote file afiedt.buf
1 create table x1
2 (
3 value varchar2(200)
4* )
5 /
Table created.
SQL> insert into x1 values('&value');
Enter value for value: 32,36,12,65,85,9663
1 row created.
SQL> /
Enter value for value: 43,36,89,65,112,9663
1 row created.
SQL> /
Enter value for value: 36,63,12,65,95,123
1 row created.
SQL> /
Enter value for value: 32,36,12,85, 85,9663
1 row created.
SQL> select * from x1;
VALUE
----------------------------------------------
32,36,12,65,85,9663
43,36,89,65,112,9663
36,63,12,65,95,123
32,36,12,85, 85,9663
SQL> select STRING_TO_TABLE(value) from x1;
select STRING_TO_TABLE(value) from x1
*
ERROR at line 1:
ORA-00931: missing identifier
ORA-06512: at "SYS.DBMS_UTILITY", line 125
ORA-06512: at "SYS.DBMS_UTILITY", line 160
ORA-06512: at "SYS.DBMS_UTILITY", line 202
ORA-06512: at "SCOTT.STRING_TO_TABLE", line 7
So please help me.
Thanks and Regards.
|
|
|
|
|
Re: APEX_UTIL [message #463751 is a reply to message #454511] |
Sat, 03 July 2010 01:35 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi Bilal Khan, May be your problem is, where do I get the document to learn how to use APEX_UTIL package ?? Am I right? if that is the case then
go to %apex path where u unzipped Apex%\apex\doc (D:\apex_32\apex\doc)and double click index.html then look for API References there you will find lots of references to learn from.
Hasan Al Mamun
Programmer
Bangladesh Bank
Dhaka, Bangladesh
[Updated on: Sat, 03 July 2010 01:37] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Jan 07 11:10:05 CST 2025
|