Re: utl_compress zip file

From: <hegyvari_at_ardents.hu>
Date: Wed, 22 Apr 2009 01:25:03 -0700 (PDT)
Message-ID: <260de3a9-1cf9-495b-a043-b86dfedb7cc5_at_z9g2000yqi.googlegroups.com>



On ápr. 17, 14:31, "stevedhow..._at_gmail.com" <stevedhow..._at_gmail.com> wrote:
> On Apr 17, 5:02 am, hegyv..._at_ardents.hu wrote:
>
>
>
> > On ápr. 17, 09:29, Shakespeare <what..._at_xs4all.nl> wrote:
>
> > > pianokruk schreef:
>
> > > > Hello,
>
> > > > The following piece of code produces an ora-29294. If I save the
> > > > contents of the variable uj after the base64 decode to a file, the
> > > > file is a perfectly valid zip that can be unzipped. What am I missing?
>
> > > > declare
> > > > eredeti varchar2(6000) default
> > > > 'UEsDBBQAAgAIAOZIhzpMHviiHAQAABALAAAjABEAYTE0MjY5MjM3dDAwMTIwMDkw
> > > > NDA2MDAwMDAwMDE4OC54bWxVVA0AB+cX20nnF9tJ5xfbSb1WPY/jNhDtA+Q/EOr1
> > > > 7bPXC63ukAR3ua8UuVwQpONKtExbEg2S8q71D1KmT+MyxVXXpRXyvzKkRIlaL26L
> > > > A+LC8AzfjN6b4YycPL+vSnQkXFBW3zihFziI1BnLaV3cOB9/eeleOc/TRKFcIU8l
> > > > EVtCJJKnA7lxJLmX/r0oHbTlZHPj4HARLddRvJJBELphoD6hu2EeYKSDKpJTfOMc
> > > > 8g2k/Pabr0k6z7iVVdmnFC2uSowgcS2UXx6uff/u7s4jByakt2180kOcHnN9L+gM
> > > > dxd7jBd+BM/wf3v/7kO2JRV2aS0krjMCUYJeC+18xzIsddG+8Bj0CHtFPneALUKJ
> > > > xuMcS22C4xa3VOCW1UxQydJZOJBaB4tgGfSf8Ooq8R/ghyz7psyZS/N5fOKP/hkO
> > > > xNAyLQjH3g5Dohc1PZJGgAwT0SMMRbJhBZ7i8C3jEMgxfaG/ddwDkBbrz9UmGSls
> > > > 6RUpanIkLRFp9wc/dn/XJ0lKUnef5L9/ItF2Zyho4luwIbApThtS7lmeRqBxsoZj
> > > > IRmvTWlGu2VSuoJx1adHyxwPZQ6WS4+IOPEfiRtzAqkdKU6K1ECUs1p2Z6H5mqOB
> > > > kG8xSny7CsmG7EqSGSApoYLTQ0B2+pNuDfqe1aIpJQwpesVZc0BvN9JLfIUY4RCr
> > > > SRptbuQuosQ37hGX0ckAU0sr0ve4OIEIruQUiT94LZzqzaGB2U2/a3J8IEIm/uSz
> > > > gLSvVRio+0rnhVN3kLWScMX85+687z5nLYVrNzovkDtSlmn3jzQgbVuoLW77560T
> > > > 3/wetfq2WBi2et/P6cBwFQTxGsq0ehbCNVi6z8K1njQ1ZzOo6aTdoeRIjg+69QP3
> > > > 0JvuDEOBXnVnmBPU/VWc4GrnFL3mLMcPWva/tSKOvtyKX7tzeWLF041oZIaf6sTq
> > > > shHqclfAUKavoYj9L+sM72CXPYO7upPs0eYlvlXsYevTemNPOTNa+2UZAYuLsd1T
> > > > XJYwfE2Vqql3g4UbLEHO5B6hUM+djYzdONRV3j0Abmi7xRJzChfDJA0hqe23wRVs
> > > > qu4sG4lLvS8G1yREi5P00Aic9psDlNjOEXogdVuTKv3x48vEN8a4dOZFggdNuwbU
> > > > qfuyN2BtIprDHwLHLgGvyF7dBclx3eJ9RpkbIli4R5LfcrYnHHY/Gg+7zwLl3aed
> > > > KpOJnGaPmG58+P0NWkVeHHhR7AXq1fHIeq3rEyxRkea3aqMaaw5I3Xg4tKdQSqaw
> > > > sGV5Gq0DNXG2a44Eh3u1MiD7GG8wvAszAT2Fe2kM+5hwCRV0w9VCA3pz0subIX8Y
> > > > LAAx2qY/uuZDa+x2JEwIeHlQOb1AIDtnRywvOvQEyaclfqUGQ2zaiIVmX1xwUO45
> > > > D+254NLjZnzmQMNhAM54WUi1MGwusEbtsprxSP8DUEsBAhcLFAACAAgA5kiHOkwe
> > > > +KIcBAAAEAsAACMACQAAAAAAAAAAAACAAAAAAGExNDI2OTIzN3QwMDEyMDA5MDQw
> > > > NjAwMDAwMDAxODgueG1sVVQFAAfnF9tJUEsFBgAAAAABAAEAWgAAAG4EAAAAAA==';
> > > > uj raw(30000);
> > > > kicsom raw(30000);
> > > > begin
> > > >     uj := UTL_ENCODE.BASE64_DECODE(utl_raw.cast_to_raw(eredeti));
> > > >     kicsom:=UTL_COMPRESS.LZ_UNCOMPRESS(uj);
> > > > end;
> > > > /
>
> > > > K
>
> > > Save to a file and load in a variable again and check the differences.
> > > My bet: missing an end-of-file character after decoding.
>
> > > Shakespeare
>
> > Hmm, can it be that I want to uncompress a zip file and not a gzip
> > file? When I tried to decompress something which was compressed by
> >utl_compressit worked.
>
> > K
>
> I have been testing withutl_compress, so this is a timely post.  I
> tried with 11.1.0.7 using your data and got the same result you did.
> I then wrote out your compressed string using utl_file.put_raw, and
> could unzip the resulting file (Linux) using unzip.
>
> I also tried using the zip file created above with
> dbms_lob.loadblobfromfile, andutl_compress.lz_uncompress still
> wouldn't uncompress it.  I then took the xml file that was originally
> compressed, gzipped it using gzip, and tried to load that andutl_compress.lz_uncompress it, and still got the same ora-29294.
>
> So...no answers :(  But I would be interested if you get one.
>
> Regards,
>
> Steve

Well, I got to the same point. The error message is quite meaningless, provided you can unzip the file using zip. I gave up experimenting with utl_compress and decided to write what I need in Java, so I will not have answers I am afraid.

K Received on Wed Apr 22 2009 - 03:25:03 CDT

Original text of this message