Home » SQL & PL/SQL » SQL & PL/SQL » CAST sentence
CAST sentence [message #190772] Fri, 01 September 2006 03:15 Go to next message
Oriol_e9g
Messages: 9
Registered: July 2006
Junior Member
I have a question about the CAST sentence. I have done a function with a table type output, and I use a querry like this to extract the information:

select * from TABLE (cast(MyPack.MyFuction (‘value1’,value2’) as MyTableType))

Because when I’m using a querry like this:

select * from TABLE (MyPack.MyFuction (‘value1’,value2’))

…it doesn’t work.

But some other person has told to me that this second querry works fine in his system with the same function .

So when is the cast sentence needed? It’s for my system settings? or my version?

In this system there’s no need to use the CAST sentence:

select * from product_component_version
PRODUCT / VERSION
NLSRTL / 9.2.0.1.0
Oracle9i Enterprise Edition / 9.2.0.1.0
PL/SQL / 9.2.0.1.0
TNS for 32-bit Windows: / 9.2.0.1.0

But, in this system I need the CAST sentence:

select * from product_component_version
PRODUCT / VERSION / STATUS
NLSRTL / 9.2.0.5.0 / Production
Oracle9i Enterprise Edition / 9.2.0.5.0 / 64bit Production
PL/SQL / 9.2.0.5.0 / Production
TNS for HPUX: / 9.2.0.5.0 / Production

Because without it appears the error ORA-22905: cannot access rows from a non-nested table item.

Why? Do somebody know when and why I need to use the CAST sentence?

Thank you very much for your help.
Re: CAST sentence [message #190776 is a reply to message #190772] Fri, 01 September 2006 03:24 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

 i think cast is no longer needed in 9x.so you can just say
select * from table(MyPack.MyFuction(‘value1’,value2’)).you had to use cast in 8x.


gurus ,plz correct me if i m wrong.


regards,
icon9.gif  Re: CAST sentence [message #190808 is a reply to message #190772] Fri, 01 September 2006 06:16 Go to previous message
Oriol_e9g
Messages: 9
Registered: July 2006
Junior Member
I thought the same but, in theory I have oracle 9i, because if I do:

select * from product_component_version
PRODUCT / VERSION
NLSRTL / 9.2.0.5.0
Oracle9i Enterprise Edition / 9.2.0.5.0
PL/SQL / 9.2.0.5.0
TNS for HPUX: / 9.2.0.5.0


Appear: Oracle9i Enterprise Edition 9.2.0.5.0

But I need cast sentence Sad I don't understand it Sad why?
Previous Topic: size of database
Next Topic: pl/sql tables
Goto Forum:
  


Current Time: Sat Dec 10 16:51:40 CST 2016

Total time taken to generate the page: 0.15009 seconds