Hi,

I get a field from my mysql database using perl, but when I
print that field the $, of $OFS doesn't seem to work.
The fields are separated with " ":
----------------------- describe y; ----------------------------------
1,2,3,4,5,6
---> 5:id int(11) YES
---> 5:v2 double YES
---> 5:v3 double YES
---> 5:v4 double YES
---> 5:v5 double YES
---> 5:name char(255) YES
...................................................................
I expected to see something like:
---> 5:id,int(11),YES,,
---> 5:v2,double,YES,,NULL,
---> 5:v3,double,YES,,NULL,
---> 5:v4,double,YES,,NULL,
---> 5:v5,double,YES,,NULL,
---> 5:name,char(255),YES,,NULL,
...................................................................
how does this come? does the "NULL" makes the problems?
How can I force the above output without looping over each field?
...................................................................
$SQL="describe y;";
print "----------------------- $SQL ----------------------------------";
$cur=$dbh->prepare($SQL);
$cur->execute;
die "prepare-fehler: $DBI::err ... $DBI::errstr" if $DBI::err;
$,=",";
@t=(1,2,3,4,5,6);
print @t;           # OK works fine.

while(@r=$cur->fetchrow_array){
        print "---> $#r:@r";
        #foreach $s (@r){
        #        printf "$s|";
        #}
        #printf "\n";
}
$cur->finish();
...................................................................

thanks d

Reply via email to