SQL Server Stored Procedure Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

SQL Server
Stored Procedure Examples

Quick Start
Encryption
File Access
IMAP
POP3
SMTP
Email Object
DKIM / DomainKey
FTP
HTML Conversion
HTTP
MHT
MIME
NTLM
RSA
Diffie-Hellman
DSA
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
String
Tar
Upload
XML
XMP
Zip

Amazon S3
Bz2
CSV
FileAccess
Byte Array
RSS
Atom
Self-Extractor

Untar a .tar.bz2 Compressed Archive

Untar a .tar.bz2 compressed archive.

Download 32-bit Chilkat TAR ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @sTmp0 nvarchar(4000)
    --  Important: It is helpful to send the contents of the
    --  tar.LastErrorText property when requesting support.

    --  Untar a .tar archive.
    DECLARE @tar int
    EXEC @hr = sp_OACreate 'Chilkat.Tar', @tar OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    --  Any string automatically begins the 30-day trial.
    DECLARE @success int

    EXEC sp_OAMethod @tar, 'UnlockComponent', @success OUT, 'Anything for 30-day trial'
    IF @success <> 1
      BEGIN
        EXEC sp_OAGetProperty @tar, 'LastErrorText', @sTmp0 OUT

        PRINT @sTmp0
        RETURN
      END

    --  Untar into c:/temp/untarDir.  The directory tree(s) contained
    --  within the TAR archive will be re-created rooted at this
    --  directory.
    EXEC sp_OASetProperty @tar, 'UntarFromDir', '/Users/chilkat/temp/untarDir'

    --  If any filepaths within the Tar archive are absolute,
    --  automatically make them relative by removing the first
    --  forward or backward slash.  This protects from untarring
    --  files to unexpected locations.
    EXEC sp_OASetProperty @tar, 'NoAbsolutePaths', 1

    EXEC sp_OAMethod @tar, 'UntarBz2', @success OUT, '/Users/chilkat/testData/tar/abc123.tar.bz2'
    IF @success <> 1
      BEGIN
        EXEC sp_OAGetProperty @tar, 'LastErrorText', @sTmp0 OUT

        PRINT @sTmp0
      END
    ELSE
      BEGIN

        PRINT 'Success'
      END
END
GO

 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.