Topic: SQL*Plus and PL/SQL >> Procedure for CLOB to display
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: Procedure for CLOB to display |
| focusora |
Posted: Jun 18, 2008 02:08:01 AM |
Total Post: 18
Joined: May, 2008
|
-- Need guide to create Stored Procedure for CLOB datatype
My table name XYZ having two columns
col1 as number
col2 as CLOB
select * from XYZ ;
col1 col2
-- ---
1 aasddsf
2 basdfsdf
3 cafdasd
4 dadfsd
5 eafasd
if i pass col1 as input,then
i must get display for col2
sql>exec col1(3) ;
col2
----
cafdasd
|
|
|
focusora |
| Posted: Jun 20, 2008 09:38:46 AM | |
|
Total Post: 18
Joined: May, 2008
|
Hi all., i got the code for CLOB to execute for pl/sql
code:
SQL> create or replace package clob_proc as
2 type cursorType is ref cursor;
3 procedure return_clob(p_cursor in out cursorType,p_col1 number)
4 ;
5 end;
6 /
Package created.
SQL> create or replace package body clob_proc as
2 procedure return_clob(p_cursor in out cursorType,p_col1 number)
3 is
4 begin
5 open p_cursor for
6 select col1,col2,col3 from tablename where col3 = p_col1;
7 end;
8 end;
9 /
Package body created.
SQL> var c refcursor;
SQL> exec clob_proc.return_clob(:c,93);
PL/SQL procedure successfully completed.
SQL> print c
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 335 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|