Ask the Expert

Is it possible to incorporate a compress/uncompress utility into a SQL query?

Is it possible to incorporate a compress/uncompress utility into a SQL query? I want to select a CLOB, compress it and then write it to a table with a BLOB, all in SQL. Is it possible to include GZIP (Solaris UNIX) into a SQL select and update statement?


    Requires Free Membership to View

It is not possible to include non-SQL functions in a SQL query. The closest thing you can do is to code an external procedure which calls your external routine. But you can't call the procedure from SQL. You can however call the procedure from a PL/SQL block. For more information on external procedures, please refer to the Oracle documentation.

You can still perform what you want to accomplish as long as you do not try to constrain yourself to a SQL query. Have you tried using OCI or Perl to extract the CLOB, compress it, and store it as a BLOB?

For More Information


This was first published in June 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: