Skip to Main Content
  • Questions
  • Manipulate the autogenerated names for types inside packages

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Carlos.

Asked: May 13, 2019 - 7:33 pm UTC

Last updated: May 16, 2019 - 3:42 pm UTC

Version: 12.2

Viewed 1000+ times

You Asked

Hey,
if you create a type inside a package, this type is created in the database with a name like 'SYS_...'. Is there any possibility to affect/influence the auto generated name? Or do i can rename it? And how?

Why I asked that?

I work a lot with pipelined functions and I like the feature declare a type in package as MYTABLE%rowtype. So any change in the table reflect to that type. And also reflect in the pipelined function. Or all these bulk processing stuff. It's cool. But i hate these autogenerated names...

I don't want to create an object type on sql level. When I do that, I have to create an object table (and not a relational table). Or I have to do make all changes in future on type AND table object.

Any help for me?

What are the cons if i use object tables (based on a single object type without any member functions and special stuff)? Can I mix them without any problems with relational tables?

and Chris said...

I'm a bit baffled as to what the issue is here.

If you're using object type, you can just reference that as the return type for your pipelined table function. No need to create an object table on top of it.

Similarly, I'm not sure why you're trying to reference SYS_ object in your code. Or even what you mean by these objects!

If you share an example of the code you're writing we'll help you find a better solution.

In the meantime, you may find these examples of various ways to use pipelined table functions in this Live SQL tutorial helpful https://livesql.oracle.com/apex/livesql/file/tutorial_GS1U5KY647O601AZ0CGDQTKJX.html

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library