Home » Developer & Programmer » Forms » run select statment in button press trigger
run select statment in button press trigger [message #330234] Sat, 28 June 2008 02:09 Go to next message
mahrhaideriqbal
Messages: 11
Registered: August 2007
Junior Member
hello and hi

,e using form6i and oracle 9i at web without webutil
me have two work area at different stations ,both have same table structure but no wan /lan link between then
me want to load data from one satation to another yhrough text file
Me want to generate a txt file for a table at when-button-press

DECLARE
--
VPATH VARCHAR2(500);
In_File Text_IO.File_Type;
linebuf number;
begin
message(' 1') ; message(' ') ;
In_File := text_io.fopen('c:/host.txt','w');

text_io.put_line(In_File,'hostname >> c:\host.txt');

Text_IO.put_line(in_file,'run{sql "select m. BOOKING_NO
from yarn_booking_master ";}');

text_io.fclose(In_File);
message(' 2') ; message(' ') ;
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = -302000 then
message(' 3') ; message(' ') ;
LOOP
message(' 4') ; message(' ') ;
EXIT WHEN TOOL_ERR.NERRORS = 0;
MESSAGE('TO_CHAR(TOOL_ERR.CODE)'||TO_CHAR(TOOL_ERR.CODE) || ': ' || 'TOOL_ERR.MESSAGE'||TOOL_ERR.MESSAGE);
TOOL_ERR.POP;
END LOOP;
END IF;

end ;

problem is that script run and data not
any body help
Re: run select statment in button press trigger [message #330259 is a reply to message #330234] Sat, 28 June 2008 06:24 Go to previous messageGo to next message
mahrhaideriqbal
Messages: 11
Registered: August 2007
Junior Member
its complete correct source

declare

--
xlfile text_io.file_type;
BEGIN
--
--
--
xlfile := text_io.fopen ('D:\dATA.SQL', 'w');

FOR c_table_data IN (SELECT BOOKING_NO,
BOOKING_DATE,
PARTY_CODE ,
BROKER_COMMISSION ,
COMMISSION_RATE ,
FRIGHT_RATE ,
FRIGHT_PARTY ,
DELIVERY_TERM ,
DELIVERY_FLAG ,
RETURN_FLAG ,
CREATED_BY ,
CREATION_DATE ,
LAST_UPDATED_BY ,
LAST_UPDATION_DATE ,
INTER_DEV ,
LOG_PHY ,
LOG_FOR_BKNO ,
ORG ,
REF_DELIVERY_NO
FROM yarn_booking_master
where booking_date = '01-Mar-1993')
LOOP
text_io.put (xlfile, 'insert into yarn_booking_master values(');
--
text_io.put (xlfile, '''' || NVL (c_table_data.BOOKING_NO, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL(c_table_data.BOOKING_DATE,'01-MAR-1900'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.PARTY_CODE, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.BROKER_COMMISSION, 0));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.COMMISSION_RATE, 0));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.FRIGHT_RATE, 0));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.FRIGHT_PARTY, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.DELIVERY_TERM, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.DELIVERY_FLAG, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.RETURN_FLAG, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.CREATED_BY, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || c_table_data.CREATION_DATE);
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.LAST_UPDATED_BY, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || c_table_data.LAST_UPDATION_DATE);
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.INTER_DEV, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.LOG_PHY, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.LOG_FOR_BKNO, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.ORG, 'X'));
text_io.put (xlfile, ',');

text_io.put (xlfile, '''' || NVL (c_table_data.REF_DELIVERY_NO, 'X'));
text_io.put (xlfile, ');');
Text_IO.New_Line(xlfile);

END LOOP;

text_io.fclose (xlfile);
--
--
--
end ;
Re: run select statment in button press trigger [message #330556 is a reply to message #330234] Mon, 30 June 2008 07:49 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
me have two work area at different stations ,both have same table structure but no wan /lan link between then
me want to load data from one satation to another yhrough text file

Why would you want to use Forms and text files to move data around? Oracle uses Export and Import utilities for such a purpose. Did you consider use of these utilities?
Previous Topic: when button pressed
Next Topic: Pop_list then what?
Goto Forum:
  


Current Time: Mon Feb 03 07:54:57 CST 2025