RE: long to varchar conversion function

RE: long to varchar conversion function

 

  

How were the privileges to the SO.SO_NOTES table or view granted to the id
executing the function? Through a role or directly? Or is the id executing
also "SO"?

-----Original Message-----
From: Abeam Consultants
[mailto:oracledba-ezmlmshield-x72681058.[Email address protected]
Sent: Wednesday, October 06, 2004 7:33 AM
To: LazyDBA Discussion
Subject: long to varchar conversion function



1* select text from dba_source where name='LONG_TO_CHAR'

FUNCTION LONG_TO_CHAR( in_rowid rowid,in_owner
varchar,in_table_name varchar,in_column varchar2)
RETURN varchar AS
/*
CREATE BY: D.Jenkins
Date: 28-Apr02003

Use: Long to varchar2 conversion,
to allow a substring on long column in the table;

*/

text_c1 varchar2(32767);
sql_cur varchar2(2000);
--
begin
sql_cur := 'select '||in_column||' from
'||in_owner||'.'||in_table_name||' where rowid =
'||chr(39)||in_rowid||chr(39);
dbms_output.put_line (sql_cur);
execute immediate sql_cur into text_c1;

text_c1 := substr(text_c1, 1, 4000);
RETURN TEXT_C1;
END;

SQL> select long_to_char(ROWID,'SO','SO_NOTES','NOTE') from dual;
select long_to_char(ROWID,'SO','SO_NOTES','NOTE') from dual
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "APPS.LONG_TO_CHAR", line 33



The line 33 is execute immediate statement, Am I missing something here,
For the rowid I am passing rowid only.

The apps user has proper permissions for executing this function.

Regards,
Inder


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page