Menu

#1 public class method observers

open
nobody
None
5
2001-05-25
2001-05-25
No

I would like to add some public class method that return available types
for create, drop, ... methods.

In fact I need it to give on-line help to users (list of available types for commands).
Because these types lists might be change, it seems to me better to use internal parameters
%create, %compile, %drop, ...
But these hash tables are local variables (it normal indeed ...), so I think that the best way
to access to these infos are observer methods.

well, this is what I added in my copy of oracle.pm in the class method section :

sub get_create_types
{
return keys %create;
}

then, I use it in help function like this to show available types :

warn "\nPossible object types are:\n";
warn join("\n",DDL::Oracle->get_create_types),"\n";

so that help result is :

Possible object types are:
type
database link
constraint
function
components
comments
table
procedure
table family
exchange table
package
snapshot
schema
profile
snapshot log
role
trigger
tablespace
materialized view
index
materialized view log
sequence
package body
view
exchange index
synonym
rollback segment
user

What do you think about this ?
Would you like to generalize this, or suggest me an other way to do it ?

Regards,
Philippe Daigremont

Discussion


Log in to post a comment.