Hello people !!!

I'm try to contruct SQL dump LDAP simple function, but get nothing with 
this.....

Here de code:

sub CacheLDAP {
        my ($self) = shift;
        my ($TableName,@Attrs,@Entries) = @_;
        my $fields;
        my $values;
        my $sth;
 
        foreach my $entry (@Entries) {
                foreach my $attr (@Attrs) {
                        $fields = $fields ."$attr,";
                        $values = $values ."'" .$entry->get_value($attr) .
"',";
                }
                my $sql = "INSERT INTO $TableName ($fields) VALUES (
$values);";
                print "$sql\n";
                $fields = "";
                $values = "";
        }
}


Here the use:

my @data = $ldap->search( ... )->entries;

- This code works fine
#foreach my $row (@data) {
#       print $row->get_value('sAMAccountName') ."\n";
#}

- This subrotine don't work and @Entries inside of sub are empty !
$ldap->CacheLDAP("table",@attrs,@data);

I'm not try this codes together. Where is the mistake ????

Allot tanks for help.....

Best regards,

Davi


Davi Baldin
IBM Certified Professional
Especialista em Linux
Analista de Suporte Pleno
[EMAIL PROTECTED]
(19) 3254-1266
(19) 8142-8902

Reply via email to