Finding EOF using TEXT_IO package
Hi everybody,
I use TEXT_IO package and read all lines of a text file....
How can the logic of the routine i write come out of the loop when the file ends..(EOF=TRUE).
Thanks ,
Simon
The TEXT_IO raise a NO_DATA_FOUND when the EOF is reached.
Francois
Similar Messages
-
Create a file using text_io package
Hi my friends,
I would like to direct the output from my Reports to a file.
I was searching in Oracle Forum and I found:
1.in the before report trigger open a file(.txt file) for write mode using text_io.fopen. You can specify the file name with whatever path u want.
2.Whatever fields from the report you want to redirect to the this file, go to the repeating frame of that field and use text_io.put or put_line.
How to I could do this?????
3.Finally , maybe in the after report or whereever close the file you opened using text_io.close.
Someone, could give more information about this?
Thanks...
CarlaHi Carla
What I understand from your words is that you want to write out a file based on your query in the report using the text_io package.
You could be doing this in the Format Trigger of the appropriate Repeating Frame.
You could also be using Delimited output and choose an appropriate delimiter character.
With Reports 9i, you could be doing File I/O operations using Java calls by importing a Java class.
Hope this helps.
Regards
Sripathy -
Help finding and using a package
hi guyz,
Iam new to this forum and i need this info urgently. so plz try to help me.
I want to use the package below in an applet to convert my TemporaryRegistrationPermit to create a PNG file and then print it.
how can i get the above package. I searched a lot on net and even on IBM website but never found it. How can i get it and include the class file in an applet and use the methods in it.Is there any other way to include this package in my applet, i mean a URL pointing to this class file.
package com.ibm.gs.houston.saz.trp.utils.TemporaryRegistrationPermit
I would really appreciate an early reply
thank you
tarunHow do you know you need this package ? You know the path to it, so you must have seen it referenced somewhere.
Some background please, but it sounds like it's an IBM internal class of some sort, so I wouldn't get your hopes up unless you have legitimate access to this or know it to be freely available.
D. -
How to use text_io package in append mode
dear all
I'm using text_io in my form. onece it executes read the content of the file in a text file. next time it will over write the content of the file.
I want to get the all the data in to the file rather overwriting the content. Is there any way to set the cursor potition into append mode?
thanksTry out:
TEXT_IO.FOPEN built-in function
A Open the file for reading and writing without deleting existing lines (that is, appending).
http://www.oracle.com/webapps/online-help/reports/10.1.2/state/content/navId.3/navSetId._/vtTopicFile.htmlhelp_rwbuild_hs%7Crwrefex%7Cplsql%7Cbuiltins%7Ctextio%7Cpkg_txtfo~htm/
** Never used!! -
TEXT_IO package...
Is there any restriction on the length of record that can be read from text file using text_io package. I want to read a text file that has number of records with length upto 20000 char. I'm putting this data into a table which has 4 columns of varchar2(4000).
will this work properly?
thanks much
---himanshuCheck each line of the file for a ','. The heading line will not
have any. Only insert data from lines that contain a ','. -
URGENT : ORA 302000 when using TEXT_IO.fopen
Hi,
I get this error ORA 302000 when using TEXT_IO package, the code I use is
new_file:=text_io.fopen('c:\text.txt','r')
i don't have the description of this ORA 302000 , pls does anyone have it?Hi,
I know it's been 2 years but it's still up to date for me.
I tried the suggested piece of code to trace the error but it did not bring anything more
EXCEPTION
When Others then
srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
IF SQLCODE = -302000 then
LOOP
EXIT WHEN TOOL_ERR.NERRORS = 0;
SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
TOOL_ERR.POP;
END LOOP;
END IF;
srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
Only Message 2 and 3 are displayed in the trace file
Any other suggestion?
Manu -
Couldn't find delivery channel when using Mail-Package
Hi,
I use the mail receiver adapter. If I configure the mail header data (sender, receiver, subject) in the adapter configuration everything works fine. But now I need a dynamic subject, so I thought of using "mail package". But now I get an error "Couldn't find receiver channel for message..."
The mail package looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
<Subject>[email protected]</Subject>
<From>[email protected]</From>
<To>[email protected]</To>
<Content_Type>text/xml</Content_Type>
<Content>This is my mail content</Content>
</ns1:Mail>
Has anyone an idea - thanks a lot - wernerHi Werner,
some time ago I posted a weblogs
which describes such a configuration
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
have a look at it
BTW
>>>>now I need a dynamic subject
if you have sp14 or above then there's much
easier method with adapter identifiers
(then you can set the subject in message mapping )
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a> -
How to find length of string after encryption using DBMS_CRYPTO package
Hi,
I am planning do data encryption using DBMS_CRYPTO package. I want to find how much will be string length after encryption.
e.g When I try to encrypt string of length between 1-15 characters it gives me encrypted string of 32 characters. When I try with 16 charcters encrypted string is of 64 characters.
Is ther any formula to calculate length of encrypted string?
Thanks
PravinThe length change is dependent upon the algorithm you are using which can be a combination of cipher block, padding, and chaining.
The best solution is determine the method you are going to use and apply it to the l ongest possible strings you are going to proces, then add some safety margin. There iis no penalty for defining your column as VARCHAR2(4000). -
Embedding images using the TEXT_IO package
Good morning people,
I'm in the process of converting one of my client's corporate reports to an Excel format, using the "TEXT_IO" package. The client requires his logo to appear in the Excel file (for a purely aesthetic purpose).
I've tried - to no avail, might I add - to embed/insert the company's corporate logo into the generated Excel file. This logo is stored as a LONG RAW datatype in the associated JCG_EXCEL_DATA table.
Whenever I attempt to embed this logo, using the "Text_IO.Putf" built-in, Excel displays it as "Bit!+".
Do you perhaps know of a way to do this?
Here's an example of the statement used:
"Text_IO.Putf(out_file, chr(9) || :image_file);"
Thanks and regards,
Johann.Hi,
It will not be possible to do it as it doesn't recognize it as an image.
What about going for a delimiteddata output having the header with the logo.
Please see the 6i patch 11 release notes on OTN documentation for Reports
Thanks
The Oracle Reports team -
How to read an html file and replace a text using text_io
hi,
i want ro read an html file using text_io and replace a particular text with a new text
eg: i want to replace a text called "data.js" and with "maps.js"
how do i do this?You have to write your own code to do that. TEXT_IO is just a low level text file interface.
You need to read in all the text, save it in some internal format (array of varchar2's maybe or in the DB) and then perform a search on the text you have read in, find out where the instances of "data.js" are located and substitute them with "maps.js" After that you need to write to a new file and delete the old one. There is no way to search and replace inside the existing file (what's sometimes referred to as 'in-place' substitution).
See the help section called About the TEXT_IO package for an overview of how it works and some code examples. -
Printing reports using text_io
1) We have a client server application which is to be deployed on the web
environment. The reports generated in our application are having a destination type as File. These reports are printed after applying some print format (escape sequences)
which are passed on to the printer programmatically at runtime while printing.
Now when this application is shifted on to the Application server (Forms server & Reports Server )in web environment ,the report outputs would be generated in the application server as against the client in client server environment as the report server is on the application server.
Now while printing/accessing the report the output file will not be available
to the client unless it is pushed on to the client side from the server . I am able to see reports in pdf/html output but in this case layout of my reports gets changed and I dont want to change my layouts or reformat my report layouts.
How do I redirect the report output from the application server on to the
client within the D2k context and then execute print commands?
Note: In this case we want to use both DMT and Laser printing. Also note that we use escape sequences to adjust reports in desired printing papers.
2) We have second set of reports which we call as document because these are printed after capturing data from 'Form' using text_io utility (please note that for these documents we are not using any Report 6i functionality)and we print it from file using printing mechanism as mentioned above. These are working well in client server application. We adopted this methodology for getting better performance (in terms of speed as database server and network traffic is not involved) of printing. But now we are converting our application for web, we are finding it difficult how to capture Form's data from browser to client's machine and then executing printing commands which are stored in our application liabrary.
If you help me out by giving some suggestions, I shall be grateful to you.
nullHello,
You need to create a client-side PL/SQL package as Program Units for your report. In this package you can define a package variable to hold and share your file handle, and create functions to open, write, and close the file. You can call these functions from the Before Report, Formula, and After Report triggers in your report.
Regards,
The Oracle Reports Team --skw -
How do I find classes in a package
Hi,
I am working on an automation tool which is to be used for testing public API's in our product. The tool is supposed to work this way:
1. A developer of the API adds a new java file containing the test code for the API in a particular package (which the tool defines). Then he compiles and places the stuff in a jar. There is also a driver class in this same package path defined by the test tool. E.g.
driver class: com.aaa.bbb.DriverClass
new API test file: com.aaa.bbb.TestFile
Now the driver file's job is to find out all the other classes in this particular package and then do some processing. When I tried doing the getPackage() on this driver class to find out about the package I got back a null.
Question 1: How can I get the package for a particular class (An ugly way to do this would be to strip it out from the classname)
Question 2: How can I find out what other classes are there in a package?
Thanks in advance on this.
Nikhil Singhal
You can also send me mails at
[email protected]hai
i have the same problem to finding the classes in package...
in my case i know the jars name and i have loaded
classes using code
ResourceBundle bundle = ResourceBundle.getBundle("source\\ClasssPath");
StringTokenizer stToke = new StringTokenizer(bundle.getString("ClassPath"),";");
String temp;
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
while(stToke.hasMoreTokens())
temp = stToke.nextToken().trim();
if(temp.endsWith(".jar"))
JarFile jar = new JarFile(new File(temp));
Enumeration en = jar.entries();
String pathStr;
while(en.hasMoreElements())
pathStr = en.nextElement().toString();
System.out.println("pathStr ="+pathStr);
if(pathStr.endsWith(".class"))
System.out.println( classLoader.getResource(pathStr));
System.out.println(classLoader.loadClass(pathStr.substring(0,pathStr.indexOf(".class")).replace('/','.').trim()));
else classLoader.loadClass(temp);
here i am getting the classes in that package using code
String[] filLis = new File("//it//sella//converter//ptlf//startup//").list();
int length = filLis.length;
while(length-- >0)
System.out.println(">"+filLis[length]);
but its returnign the class when this classes in locale folder(i.e)its not getting the classes in loaded memory...
so how to retrieve the class files names using package structure name...
(i am having more then 20 jars files, inthat inside the jar samepackage structue may appear in more then one jars )
pls help me in this field..
Thanx -
Problem with reports in excel (using text_io)
we are using Report Builder 6.0.5.28.0 with Oracle9i Enterprise Edition Release 9.2.0.1.0. in a client/server evironment. I'm using 'TEXT_IO' to write the report output to a csv file.
The process runs ok but the only problem is that the first line of every page (other than the first) gets repeated.
can anyone out there tell me how to get over this problem.
Thanx in advance
Adolph1. You first need to create a package in your report
PACKAGE conv_text IS
procedure fopen(fname varchar2);
procedure fclose(fname varchar2);
procedure fwrite_c(fname varchar2,
var_c varchar2);
procedure fline;
END;
PACKAGE BODY conv_text IS
o_file TEXT_IO.FILE_TYPE;
filename VARCHAR2(50);
procedure fopen (fname varchar2) is
begin
filename := fname;
o_file := TEXT_IO.FOPEN(filename,'W');
end;
procedure fclose (fname varchar2) is
begin
Text_IO.Fclose(o_file);
end;
procedure fwrite_c (fname varchar2, var_c varchar2) is
begin
Text_IO.Put(o_file,var_c);
end;
procedure fline is
begin
Text_IO.New_Line(o_file);
end;
2. In the "before report trigger" open the csv file (make sure the folder exists on the client m/c)
conv_text.fopen(:filename);
3. In the innermost frame(use the following,for all the fields u want in ur csv file) :
filename VARCHAR2(50);
begin
filename := :filename;
conv_text.fwrite_c(filename,:agency_name);
conv_text.fwrite_c(filename,',');
conv_text.fwrite_c(filename,:invoice_no);
conv_text.fwrite_c(filename,',');
conv_text.fline;
4. In the after report, close the file
conv_text.fclose(:filename);
good luck and let me know if get thru with the problem of the repeating record.
Adolph
[email protected] -
Submitting Oracle job via OCCI using dbms_job package
I am using 10g client to connect to a 9i Database on Redhat Linux AS 3.0.
I am trying to submit a job via OCCI. I get back a jobId, but don't see the job in the user_jobs table or the result of the job being executed.
I am using occi::Statement in the following way :
stmt = connection->createStatement("begin dbms_job.submit(:v1, 'submitJobTest;', sysdate,'sysdate+1'); end;");
// where submitJobTest is a stored procedure
stmt->registerOutParam(1, OCCIINT);
stmt->executeUpdate();
int jobId = stmt->getInt(1);
I get back a job id, but can't find it in the user_jobs. The first time I executed the program, i got back jobId 0, then 1 and so on..
Any ideas? Do I need to use dbms_scheduler package?
Thanks, NiloferGood catch!
Had a bug, in that my autocommit was not being set!
Works now.
Thanks,
Nilofer -
How do I create and use a package?
Sorry for the noobish question, but I have never had the need to use a package and currently would like to learn how they work just to satisfy my own curiosity.
Suppose I have a file named Node.class in a folder named Classes, and I have another class named Main.class sitting in another folder. I want to create a Node object using the Main class.
How do I accomplish that? Would I need to use a package?
I tried to write package Classes; on my Main file but it did not work. thanksThis is an old explanation I wrote:
This is a minimal explanation of packages.
Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
package myapp;
Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
Then a statement to compile your source file named aProgram.java is:
C:\java\work\>javac myapp\aProgram.java
And a statement to run the program is:
java myapp.aProgram
(This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
Explanation:
Compiling
A class is in a package if there is a package statement at the top of the class.
The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
Running
Compiling creates a file, aProgram.class in the myapp directory.
(The following is where people tend to get lost.)
The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)
Maybe you are looking for
-
my macbook wont start the screen turn blue and stay like that for hrs. It only work when i use safe mode, i try to use disk utilities to fix it but the disk utilities keep saying error and a bunch of other stuff. I dont the cds the comp came with, he
-
New computer, can't carry library from ext. HD
Just bought new computer last night. iTunes library has been stored on external hard drive for some time now. Installed iTunes on new computer, no music found. Default iTunes music folder location under Preferences was C:/My Music/iTunes... Changed i
-
Check product key to make sure it is valid and not registered yet
I want to make sure a copy of windows 7 is legit. can you verify if I provide you with product key?
-
MCBZ report how to get total stock qty calculation?
Dear Guru, if i checking one material in Tcode:MMBE having unrestricted stock is 356 & reserved qty is 56. After this when i am executing report MCBZ-- Current stock reqmt list & get Total stock qty is 120 for same material. can any one tell
-
Hello, I run an iMac at home and currently do not use iPhoto at all. Part of the reason for this is that my wife uses a Windows PC and I have yet to work out a way to share iPhoto effectively. Anyway, I am close to buying a MacBook Air for her and