Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    9

    Unanswered: ActiveX ActivePerl DTS Task

    I am trying to create a dts script task in SQL Server 2000 using a perl script. It extracts the files fine, but when I try to tell it the current directory is gives me a "Function Not Found" error when I use the SetCwd function. I am not sure why it is telling me this. Any help would be appreciated.

    Here is the perl script:

    #using modules
    use Archive::Tar;
    use Compress::Zlib;
    use Win32;

    sub Main()
    {
    #create a new tar archive object
    my $tar = Archive::Tar->new;

    #set the name of the compressed files
    $main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp .tar";
    $res_tar = "ListingsRESIDENTIAL-Residential.txt.gz";

    # set the directory
    $dir = "C:\Inetpub\wwwroot\legacyrealestate\db\";
    Win32:etCwd($dir);

    #read the main tar file and extract files
    $tar->read($main_tar,1);
    $tar->extract();

    return 0; # DTSTaskExecResult_Success;
    }

  2. #2
    Join Date
    Dec 2003
    Posts
    9
    OK I figured it out. You have to use SetCwd before you uncompress the files and use "/" instead of "\" when you give the directory. DOH!!

    #using modules
    use Archive::Tar;
    use Compress::Zlib;
    use Win32;

    sub Main()
    {
    #create a new tar archive object
    my $tar = Archive::Tar->new;

    # set the directory
    $dir = "C:/Inetpub/wwwroot/legacyrealestate/db/";
    Win32:etCwd($dir);

    #set the name of the compressed files
    $main_tar = "DW168E.tmp.tar";
    $res_tar = "ListingsRESIDENTIAL-Residential.txt.gz";

    #read the main tar file and extract files
    $tar->read($main_tar,1);
    $tar->extract();

    return 0; # DTSTaskExecResult_Success;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •