this (the method below) is database dependent, i use it with postgres:

sub getFieldNames {
  my $dbh     = new DBI(...)
  my $sth     = $dbh->prepare("SELECT * FROM $table WHERE 1=0");
  
  $sth->execute;

  #
  # Get all the field names (execlue the field's we were asked to exclude) and 
return...
  #
  my @fields;
  
  foreach my $field (@{$sth->{'NAME'}}) {
    next if ($ignore_fields{$field});
    push(@fields, $field);
  } 
    
  return @fields;
} 

On Wed, 2003-10-15 at 16:41, ramakrishna wrote:
> Hi,
> 
> Can any one tell me How to get fields from a SQL Database.
> I need to get each field separately.
> 
> Thanks in advance,
> Ramakrishna.S


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to