Internal Oracle Functions

Dmeister

Member
How do I call functions/procedures like desc or "recover automatic standby..." using doa? Any examples would greatly be appreciated.

Thanks.
 
Calling a procedure can be done iether through the TOraclePackage component or by executing a TOracleQuery containing the following SQL statement:

begin
add_something(:a, :b);
end;

for example if you have the following procedure:

create or replace procedure add_something(
a in number;
b in number;
) as
begin
insert into.... something;
end;
/

desc used in SQL-Plus is not an oracle procedure it's an SQL-plus command. To get a similar functionality you need to search oracles system views to retrieve the information. For example

desc my_table

is similar to

select column_name, data_type from user_tab_columns where table_name = 'MY_TABLE';

Note the upper case in the latter statement.
I think you can conclude that statements that do not require a semicolon or a slash to execute is infact a SQL-Plus command and not an oracle statement. (note that desc my_table works fine both with and without the terminating semicolon).

Best regards Jonas
 
Back
Top