How to Save a File in Oracle Forms 6 ?
Dear All,
I am using Oracle Forms 6. I need to save a file in .lst format.
I am using,
flnm:=get_file_name('E:\',file_filter=>'Text Files(*.lst|*.lst|');
I f I use this, It prompts me to save the file. I want to save it automatically without asking me to enter the file name. We can get file name too from the above syntax
flnm:=get_file_name('E:\','Test',file_filter=>'Text Files(*.lst|*.lst|');
But i dont want the system to prompt me to save manually. It must be saved in the proper location as mentioned.
Advance thanks for all.
Kindly help me to overcome this issue
Here's an example of a way to write out a file which writes out data from a particular block. The field names are hard coded so need to
be customized:
/* write out data as tab delimited file for import into
excel etc */
function write_file (myfile in varchar2) return varchar2 IS
out_file text_io.file_type;
item_name varchar2(32);
errnum number := ERROR_CODE;
errtxt varchar2(80) := ERROR_TEXT;
myblock varchar2(32) := 'MY_BLOCK';
addrno integer := 0;
BEGIN
go_block(myblock);
go_record(1);
out_file := text_io.fopen(myfile,'w');
/* output field header for excel or word */
text_io.putf(out_file,'%s\n', 'notes' || chr(9) || 'subR' || chr(9)||'X' || 'someid' || chr(9) ||
'title' ||chr(9)||
'first_name'||chr(9)||'last_name'||chr(9)||
'home_address'||chr(9)||'home_city'||chr(9)||'home_state'||chr(9)||'home_zip');
LOOP
if (addrno > 0) then
text_io.putf(out_file,'\n');
end if;
addrno := addrno + 1;
text_io.putf(out_file,'%s',:MY_BLOCK.some_notes || chr(9));
text_io.putf(out_file,'%s',:MY_BLOCK.sub_ripple || chr(9));
text_io.putf(out_file,'%s','X' || :MY_BLOCK.someid || chr(9));
text_io.putf(out_file,'%s',:MY_BLOCK.title || chr(9) || :MY_BLOCK.first_name
|| chr(9) || :MY_BLOCK.last_name || chr(9));
text_io.putf(out_file,'%s',:MY_BLOCK.home_address || chr(9));
text_io.putf(out_file,'%s',:MY_BLOCK.home_city || chr(9) || :MY_BLOCK.home_state ||
chr(9) || :MY_BLOCK.home_zip);
IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
text_io.fclose (out_file);
return 'Y';
exception
when others then
message ('ERROR write_file '|| myfile || ' ' || :system.cursor_block || ' '
|| :system.cursor_record || ' ' ||:system.cursor_field || ' '
|| errnum || ' ' || errtxt);
bell;
synchronize;
return 'N';
END;
Similar Messages
-
How to run batch file from oracle forms 9i
Hi everyone.
i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
i have made a batch file which run the sql loader and transfer my data to database.
How to run batch file from oracle forms 9i.
when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
here is my code
Begin
HOST('C:\temp\batchfile.bat');
message('done');
end;
Thanks in advance
regards
sajidthis is my log file, when i run manually.
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: file_to_upload.ctl
There are 2 data files:
Data File: sk.csv
Bad File: sk.bad
Discard File: none specified
(Allow all discards)
Data File: sk1.csv
Bad File: sk1.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table KHAN, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
SR FIRST * , O(") CHARACTER
DATES NEXT * , O(") CHARACTER
AGENT NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
TRANSACTIONS NEXT * , O(") CHARACTER
PKR NEXT * , O(") CHARACTER
USD NEXT * , O(") CHARACTER
BANK NEXT * , O(") CHARACTER
Table KHAN:
11088 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 132096 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 11088
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Thu Jul 01 23:27:53 2010
Run ended on Thu Jul 01 23:27:54 2010
Elapsed time was: 00:00:00.63
CPU time was: 00:00:00.17 -
How to open .cmdrw file from Oracle Forms 10g
Hi,
We need to call *.cmdrw* file from Oracle forms 10g. Is there any way to call *.cmdrw* file from Oracle forms 10g?
Thanks for the help.
Viishnu NekkantiIn case you want to open a .cmdrw with its associated application you can use the following procedure:
webutil_host.NonBlocking( 'rundll32 url.dll,FileProtocolHandler ' || client_filename );This works for every file where a program has been associated to its file extension. (Adobe Reader for *.pdf, Microsoft Word for *.doc, Microsoft Excel for *.xls and so on)
Regards
Markus -
How to call pdf files from oracle forms
I have a pdf file in the server , I need to call this and open when a button is pressed in the oracle forms.
Please let me know how to do this.
Thanks,
PrevinFrank,
I have oracle applications and I want to open a pdf file located in the server from a button in oracle applications.
Previn,
you don't mention the Forms release you are running.
If you are running Forms on the web, you can use
web.show_document() to load files from the Web if
they are accessible via HTTP.
Frank -
How to generate excel file in oracle forms 10g on client machine
dear Sir,
I am using just file server(installed 10g dev suite) not a oracle application server,
I am running my application from another machine ,it running fine i want to generate excel report on client machine
presently i m using OLE2 for fetching the data in excel , it is working fine but it generates the excel file on file server machine and i want get the output excel on the client machine. aftre OLE2 i m using CLIENT_OLE2 with webutil (instead of OLE2) its get compile successfully but during runtime it give error "oracle.forms.webutil.ole.OleFunctions bean not "found.CLIENT_OLE2.create_obj will not work"
*so please tell me without oracle application server is this possible or not .*your webutil on server side is not configured
you need to re install the webutil jacob.dll files etc. then it will work fine..
you can also generate excel file using reports to change the destination format in SPREADSHEET -
How to call .BAT file in Oracle Forms
Hi All,
I am using Oracle Forms 6i. We have a .Bat script which moves file from our local directory to the server.
I want to invoke this .Bat script to be called when I click on a button in the form.
Appreciate your help here.
Thanks,
Madhu K.Hi
I use this in oracle forms 6i: first i assign this path to a variable:
DECLARE
v_path VARCHAR2(1000);
BEGIN
v_path:= 'C:\file_name.bat' then I use the host command:
HOST( 'cmd /c start' || v_path , no_screen);
END;Hope this helps...
Regards,
Abdetu... -
How to save formula items in oracle forms?
Dear All........
I am nw in this forrum, can anybody plz tell me how to save forumula items in database, I also make that fields as a database field but it is not save in database. plz tell me. thx.Dear!
Steps to take formula column value into database field, follow following steps:
1. Draw a text field named "Formula_Cell"and set its properties which you want for formula. Now, goto its "Database" property set to "No".
Now, goto its "Canvas" Property set to "Null".
2. Now, in Pre-Insert or Pre-Update trigger use following code:
Suppose database field name is AMOUNT then:
:AMOUNT := :FORMULA_CELL;
If you want to mension block names with this then you may do.
Remeber, Formula Column's property of Database must be set to No.
Now, try to save I hope you will got a good solution... -
How to call a .rpt file from oracle form 10g
I need to call a .rpt file from oracle form 10g. please suggest what to do for this
Hi,
onlz rdf and rep files are Reports executables. Convert rpt to rep and you are file (Reports has a conversion utility in the bin directory)
Frank -
How to save pdf file in database
Dear All,
my application is forms 6i and database is 8i,requirement is that how to save pdf file in database and users can view through formsI'll apologize up front for the length of this post. I have a few database procedures I created that write a file to a BLOB column in a table as well as retrieve the BLOB from the column after it stored there. I have successfully stored many different types of binary file to the database using these procedures - including PDF files. I have not used these procedures in a Form so I can confirm that they will work, but theoretically they should work. I'm including the code for each procedure in this posting - hence the apology for the long post! :-)
Also, since these procedures reside on the database you will need to use Forms TEXT_IO built-in package to write your file to the server before you can use these procedures to store and retrieve the file from the database.
These procedures reads and writes a binary file to a table called "LOB_TABLE." You will need to modify the procedure to write to your table.
-- Author : Craig J. Butts (CJB)
-- Name : load_file_to_blob.sql
-- : This procedure uses an Oracle Directory called "IN_FILE_LOC". If you
-- already have a directory defined in the database or would prefer to use
-- a different Directory name, make sure you modify line 21 to reflect the
-- new Directory name.
-- ==================================================================================
-- History
-- DATE WHO DESCRIPTION
-- 12/11/07 CJB Created.
CREATE OR REPLACE PROCEDURE load_file_to_blob (p_filename IN VARCHAR2) IS
out_blob BLOB;
in_file BFILE;
blob_length INTEGER;
vErrMsg VARCHAR2(2000);
BEGIN
-- set the in_file
in_file := BFILENAME('IN_FILE_LOC',p_filename);
-- Get the size of the file
dbms_lob.fileopen(in_file, dbms_lob.file_readonly);
blob_length := dbms_lob.getlength(in_file);
dbms_lob.fileclose(in_file);
-- Insert a new Record into the tabel containing the
-- filename specified in P_FILENAME and a LOB_LOCATOR.
-- Return the LOB_LOCATOR and assign it to out_blob.
INSERT INTO lob_table (filename, blobdata)
VALUES (p_filename, EMPTY_BLOB())
RETURNING blobdata INTO out_blob;
-- Load the file into the database as a blob.
dbms_lob.open(in_file, dbms_lob.lob_readonly);
dbms_lob.open(out_blob, dbms_lob.lob_readwrite);
dbms_lob.loadfromfile(out_blob, in_file, blob_length);
-- Close handles to blob and file
dbms_lob.close(out_blob);
dbms_lob.close(in_file);
commit;
-- Confirm insert by querying the database
-- for Lob Length information and output results
blob_length := 0;
BEGIN
SELECT dbms_lob.getlength(blobdata) into blob_length
FROM lob_table
WHERE filename = p_filename;
EXCEPTION WHEN OTHERS THEN
vErrMsg := 'No data Found';
END;
vErrMsg := 'Successfully inserted BLOB '''||p_filename||''' of size '||blob_length||' bytes.';
dbms_output.put_line(vErrMsg);
END;
-- Author : Craig J. Butts (CJB)
-- Name : write_blob_to_file.sql
-- Descrip : This procedure takes a BLOB object from a database table and writes it
-- to the file system
-- ==================================================================================
-- History
-- DATE WHO DESCRIPTION
-- 12/11/07 CJB Created.
CREATE OR REPLACE PROCEDURE write_blob_to_file ( p_filename IN VARCHAR2 ) IS
v_blob BLOB;
blob_length INTEGER;
out_file UTL_FILE.FILE_TYPE;
v_buffer RAW(32767);
chunk_size BINARY_INTEGER := 32767;
blob_position INTEGER := 1;
vErrMsg VARCHAR2(2000);
BEGIN
-- Retrieve the BLOB for reading
BEGIN
SELECT blobdata
INTO v_blob
FROM lob_table
WHERE filename = p_filename;
EXCEPTION WHEN OTHERS THEN
vErrMsg := 'No data found';
END;
-- Retrieve the SIZE of the BLOB
blob_length := DBMS_LOB.GETLENGTH(v_blob);
-- Open a handle to the location where you are going to write the blob
-- Note: The 'WB' parameter means "Write in Byte Mode" and is only
-- available in the UTL_FILE pkg with Oracle 10g or later.
-- USE 'W' instead for pre Oracle 10q databases.
out_file := UTL_FILE.FOPEN('OUT_FILE_LOC',p_filename, 'wb', chunk_size);
-- Write the BLOB to the file in chunks
WHILE blob_position <= blob_length LOOP
IF ( ( blob_position + chunk_size - 1 ) > blob_length ) THEN
chunk_size := blob_length - blob_position + 1;
END IF;
dbms_lob.read(v_blob, chunk_size, blob_position, v_buffer );
UTL_FILE.put_raw ( out_file, v_buffer, TRUE);
blob_position := blob_position + chunk_size;
END LOOP;
END;Hope this helps.
Craig...
-- If my response or the response of another is helpful or answers your question please mark the response accordingly. Thanks! -
Embed Animated Flash Objects (*.swf file) in Oracle Forms.
Hello All,
To Embed Animated Flash Object (Shockwave *.swf File) in Oracle Forms, Please Follow the Steps Below.
1. Draw "ActiveX Control" Item on Canvas with the Name "OCXITM".
2. Select "ActiveX Control" Item & Go to its Properties (By Pressing F4).
3. Select "ShockwaveFlash.ShockwaveFlash" in "OLE Class" Property of "ActiveX Control" Item.
4. Come again to the Canvas.
5. Right Click on "ActiveX Control" Item, Select "Insert Object...".
6. In Control Type List, Select "Sockwave Flash Object" and Press "OK".
7. On Canvas, Select "ActiveX Control" Item, Go to "Program" Menu, Select "Import OLE Library Interfaces...".
8. Select All "Method Package(s)" & "Event Package(s)" for "ShockwaveFlash.ShockwaveFlash.X" & Press "OK".
9. Go to "Object Nevigator" (By Pressing F3) & Expand "Program Unit" to verify that the Packages are Successfully Imported.
10. Compile All the Objects (By Pressing "Ctrl+Shift+K").
11. In "WHEN-NEW-FORM-INSTANCE" Trigger Write the Below Code.
** Author : Muhammad Waseem Haroon *
** Dated : 07-Apr-2005 *
** Purpose : To Call Macromedia Flash Object (*.swf File) *
** Module : Logo *
DECLARE
oleitm OLEOBJ;
BEGIN
oleitm := :item('OCXITM').INTERFACE;
ShockwaveFlash_IShockwa_0.Movie(oleitm,'d:\movie.swf');--it can be dynamic.
END;12. Compile, Save & Run Your Form.... and... See the Beauty.
Thanks & Regards
Muhammad Waseem Haroon
[email protected]
[email protected]
[email protected]Mark Striekwold did an effort to put flash into forms
http://mark-oradev.blogspot.com/2010/02/flash-inside-oracle-forms.html
http://mark-oradev.blogspot.com/2010/02/flash-test-inside-oracle-forms-part-2.html
http://mark-oradev.blogspot.com/2010/04/flash-test-inside-oracle-forms.html -
Attach pdf files in oracle forms 11g
Hello everyone, I would like to know if is possible and how to attach a pdf file in oracle forms, and how to open it to read it
thankshello ,
u can also try out a HOST command in Oracle Forms.
Give path of PDF file and it will open PDF directly.
Thanks
HARSH SHAH -
How can i attach files in oracle applications
Hi,
How can i attach files in oracle applications ? Is there any thing like open dialogue box?
krishnaHi Naveen,
While I am searching for attaching files to oracle forms in forum, I found you. I have a question; probably you could help me out. I have a custom form which needs to have the facility to open the text files from C drive and load the data into Oracle tables.
The custom form will be attached to Oracle apps responsibility... We are currently using forms6i.
Could you help me out to open a dialog box which provides the users to open the text files from C drive when user clicks on a button
I have attached d2kcomm and d2kwutil to the form. It complies at the form level
but still it is not showing the dialog box.
I would appreciate if you can help me in this regard.
Thanks in Advance
Ravi.
Message was edited by:
ravipampana -
Display blob file with oracle forms
I need to display an image file with oracle forms.
can any body tell me how to do this ?
ThanksHow to do this is dependent on which version of Oracle Forms you are using. Please let us know what version (eg; 10.1.3.x.x not 10g) of Oracle Forms you are using and how your application is deployed (Client/Server or web). If web, what is your Java version?
Craig... -
Hi,
It is urgent for me to know how to save xml file. I use VC++6.0, Oracle xdk 9.0.0.0.0 or 9.0.0.0.0Abeta under windows98.
It is OK to compile the program with print() method. But system will tell me there is illegal operation when I run it. If I delete the line with print(), the result will be normal.
in class node, there is two functions
void print(ostream *out = &cout, uword level = 0,uword step = 4);
void print(DOMString buffer, size_t bufsize, uword level = 0, uword step = 4);
Is there anyone who may tell me how to use them? to write back specific xml file?
Without print(), I can not save the xml file...It seems in Oracle xdk9.0.0.0.0, there is no obvious function to save the file.(or because I am a new comer , not familier with DOM)
Can anyone tell me how to save xml file? or just paste an example! It is very a little urgent to me...Hope you give me some ideas....
Many thanks in advance!!!!
yours,
FienaHi,
goto sxmb_adm > intergration engine configration > specific configration
go in edit mode > new entry
choose
Category -> IDoc
Parameters -> XML_CONVERSION
current value -> 2
Regards,
Manisha -
How can I code this in Oracle Forms?
I have a master-detail form. In the detail block, I have several records. Here is my name table.
ID Name_Type Name
1 old Mike
2 Current John
3 old Peter
4 old Andrew
I would like to create a button trigger which shall perform the following:
1) insert a record into database with a copy of current value. In the above case it will insert create a record for John as name_type = 'OLD'. So we have total of 5 records. Commit the transaction.
2) Scroll through my detail records (5) and go to one specific record and erase the values from it. In the above case, it should find John's record with name_type = 'Current' and erase John from it.
How can I accomplish this in Oracle forms using a button-pressed trigger?Hi,
Simple, using current values you can create new id , 'old' and name so oracle will create record, now refresh block, next using next_record in loop you can find record,erase one and refresh block.
Adinath Kamode
Maybe you are looking for
-
Could anyone help please. I have completed a form and saved it, then I went back into it and made a couple of changes and now I cannot download it as a PDF file. Here is the error message I keep getting There is nothing else open on my mac, so I do
-
Can a Tag name be changed?
Hi I have this backup, USQ4_HOT_0226_2125, and would like to change the TAG to USQ4_HOT_KEEP_UNTIL_JUNE01 RMAN> LIST BACKUP SUMMARY; 2> List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag 7932 B F A
-
Distributed Transaction with EJB 3.0 / JPA
I did some testing here and it proved to work. I would like someone to tell me if this is really true. I have many Stateless Session Bean and Entity Beans, using EJB 3.0 with JPA. The Persistence Unit is configured using JTA transaction type. Some of
-
How to setup Time stamp for CO-PA.
Hello Friends, I have created CO-PA datasource in KEB0. Defaultly, the delta method has been selected as 'Generic delta'. But, I need time stamp for delta process. Where can I setup time stamp for CO-PA data source? Thanks Sumanth
-
Configured a Probe to check the heath of server webpage .But getting a status code of 400. probe http PROBE_80 interval 10 faildetect 2 passdetect interval 10 passdetect count 2 receive 5 request method get url http://<host>:<port>/eml/He