Friends,Can anyone tell me what is the difference between$ORACLE_HOME//lib/libclntst10.a$ORACLE_HOME...
By rnikaeen_goldli_
Hi all,When i try to login to Oracle Workflow Manager with the following linkhttp://localhost:7778/s...
By user502230
Hi All,Im a Jr. Database Analyst Im trying to make some documentation of ourSCM Plan for my manageme...
By mitch_gillespie_rmc
Hi All,Im a Jr. Database Analyst Im trying to make some documentation of ourSCM Plan for my manageme...
By mitch_gillespie_rmc
I'm looking for references and advice on the best way to managetable schema and stored procedur...
By mark_harrison
Hello allI have just installed instantclient 10.2 in a new workstation, OS is Win2K Professional. In...
By clapidus
Hi,I have a table, mytable (id number, refid varchar2(64), clob text)where refid (a project identifi...
By morten
When I'm running database upgrade assistant to upgrade oracle 9i(9.2.0.1.0)to 11g(11.1.0) I...
By alpesha, 1 Comments
Hi All,I need your help:I have a production database (8.1.6, Solaris) and a QA database (8.1.6 NT).O...
By gruzglin, 1 Comments
HiWhen we are talking about query performance then please tell me what arethe basic things that we n...
By sweety, 2 Comments
I have to join two table like table name emp and table name dept.I have join like thisJoin-1select e...
By pankajgupta, 4 Comments
RMAN> BACKUP AS COPY DATABASE FORMAT='+DGROUP1';Starting backup at 19-AUG-07Starting impli...
By user583972, 10 Comments
Hi,We have a table which comprises of 40 fields and it contains 30 million records. Here, we have a ...
By user573641, 3 Comments
HiI try manually create database in Oracle 10g on Windows XP prof.And I get following error:ERROR at...
By radian7, 4 Comments
Hi all i have a problem on optimize a query.I have two table : tbl_4010 the master ,tbl_4210 the det...
By pedro_riky, 5 Comments
Hi Ian,
Well...it's a bit of a loaded question really, since I guess you're asked if you can access a file without *specifically* unzipping it first, since by definition in order to read the original data there has to be some form of unzipping, even if it happens 'automagically' in-memory without you having to do it yourself.
My first stab at your problem would probably be to load the content of your file into a BLOB and then use the UTL_COMPRESS package to uncompress it and then pass the resulting uncompressed blob through to your parsing routine (with whatever modifications you need to make).
Hope this helps.
jes | Sat, 23 Feb 2008 13:21:00 GMT |
Thanks Jes
I have just tried using utl_compress. I have imported the zip file into a blob field then tried to uncompress the blob field using utl_compress.lz_uncompress(blob).
Unfortunately this then failed with the error;
ORA-29294: A data error occurred during compression or uncompression.
Any ideas?
Not sure whether this is relevent but the source file I am trying to uncompress is a text file.
Cheers ian
ian | Sat, 23 Feb 2008 13:22:00 GMT |
Hi Ian,
The input file would have been in the same zipped format that the utl_compress package is expecting it to be in (i.e. can you try using a file that you have *compressed* using the same package to rule out different compression algorithm problems).
I'll try and knock up an example later if I get a chance.
jes | Sat, 23 Feb 2008 13:23:00 GMT |
Sorry Jes I am not quite sure how to compress a blob and export it as a zip. I have been able to compress a blob and then uncompressed the blob without issue if that helps.
Apologies my PL/SQL skills are a bit weak at the moment, I am picking up things as I go along!!!
So far I have used both winzip and Window XPs own zipping process to zip the text files and both formats I am unable to uncompress the blobs once imported.
Cheers again.
ian | Sat, 23 Feb 2008 13:24:00 GMT |
Hi Ian,
Ok here's "rough" example, note that I knocked it up while eating lunch so you may need to adapt it to how you need yours to work -
Hope this helps,
John.
jes | Sat, 23 Feb 2008 13:25:00 GMT |
Thanks John
Got that to work fine, to import a text file, zip it then import that zip file back in and unzip it.
However, what does not seem to work is when I zip up a file using e.g Winzip and try and import and uncompress that file. Which is really what I want to try and do.
One thing I also noticed was that when you produce a zip file using utl_compress and try and open that file using Winzip, it fails, unless you change the file extension to ".gz"
Cheers ian
ian | Sat, 23 Feb 2008 13:26:00 GMT |
Hi Ian,
>However, what does not seem to work is when I zip up a file using e.g Winzip and try and import and uncompress that file. Which is really what I want to try and do.
Hmmm works fine for me if I adapt my example to import a file that I have already gzipped (my laptop is a Mac, so I can't speak for Winzip). I believe that Winzip can handle decompressing gzipped files, but you need to give it the correct suffix under windows for it to recognise it as such (it doesn't examine the file header to determine the compression type).
So I would say that the utl_compress package routines are fully compatible with gzip compression, but not with the compression used with Winzip, unless someone knows different?
jes | Sat, 23 Feb 2008 13:27:00 GMT |
John - the developers we had in for a piece of work last year used a Java class to unzip files.
The application allows the user to upload a file zipped either with Winzip or XP compressed folders, which is then unzipped through a Java call and the data processed.
I have to say that although this works pretty well, very occasionally it fails and you have to re-zip the file to get it to work.
Hope this helps.
John.
johnvaughan | Sat, 23 Feb 2008 13:28:00 GMT |
Hi John
I starting to think that using java maybe the only option, unfortunately, I have never used java before. Have you got any example of the java code you used? I am assuming the java function is used to uncompresses the blob field?
Cheers ian
ian | Sat, 23 Feb 2008 13:29:00 GMT |