Re: g

From: zafri1936 <zafri1936_at_hotmail.com>
Date: 11 Feb 2006 06:21:55 -0800
Message-ID: <1139667714.988538.24230_at_o13g2000cwo.googlegroups.com>


[Quoted] I am using Text_IO in my form's when button press trigger , inorder to create the
text file, then in the same when button press triger I am calling RMAN via host command in order to run the script which was created by text_IO.

Below you find some of the code. I will appreciate if you solve the problem.

when button press trigger:

Declare

in_file3 Text_IO.File_Type;
linebuf3 VARCHAR2(1800);
output11 varchar2(1000);

BEGIN output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat '; Host(output11,no_screen);

:sql.execution_plan:= 'Working........................';
synchronize;

in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');

Text_IO.Put_Line(in_file3, linebuf3);

Text_IO.put_line(in_file3,' ');

Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
Text_IO.put_line(in_file3,' ');
Text_IO.put_line(in_file3,' ');

Text_IO.FCLOSE(in_file3)

Declare

un VARCHAR2(80);
pw VARCHAR2(80);
cn VARCHAR2(80);

output VARCHAR2(1000);
output2 VARCHAR2(1000);
dummy varchar2(40);
in_file Text_IO.File_Type;
linebuf VARCHAR2(1800);

BEGIN [Quoted] Get_Connect_Info(un,pw,cn);

/* for Plan_table Begg. Second INNER BLOCK */ declare

dummy2 varchar2(40);

begin

select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';

if dummy2 = 'PLAN_TABLE' then
output2:='rman target/ nocatalog _at_C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ; Host(output2,no_screen);

end if;

exception
when no_data_found then

output2:='rman target/ nocatalog _at_C:\EXPLAIN_PLUS\misc\create_table.txt ';
Host(output2,no_screen);

end; --

zafri1936 wrote:
> Hi.
>
> I am not an Oracle expert but as far as I concerned the SQL code which
> I am using did not give the error during the form execution. But when
> forms 6i's Plus80.exe internally try to connect to Oracle Database
> 10G the error comes.
>
>
> Regarding my sql code it something like this which I write in when
> button Press trigger
>
> declare
>
> dummy varchar2(40);
>
> begin
>
> select table_name into ..............................................
>
> if dummy = 'PLAN_TABLE' then
> output2:='rman target/ nocatalog _at_C:\EXPLAIN_PLUS\MISC\TRUNC2.txt '
> ;
> Host(output2,no_screen);
>
> end if;
>
> ...............................
>
>
> zafri
Received on Sat Feb 11 2006 - 15:21:55 CET

Original text of this message