-####
-# Usage: &dbGetColInfo($table);
-sub dbGetColInfo {
- my ($table) = @_;
-
- my $query = "SHOW COLUMNS from $table";
- if ($param{DBType} =~ /^pg/i) {
- $query = "SELECT * FROM $table LIMIT 1";
- }
-
- my %retval;
-
- my $sth = $dbh->prepare($query);
- &SQLDebug($query);
- if (!$sth->execute) {
- &ERROR("GRI => '$query'");
- &ERROR("GRI => $DBI::errstr");
- $sth->finish;
- return;
- }
-
- my @cols;
- while (my @row = $sth->fetchrow_array) {
- push(@cols, $row[0]);
- }
- $sth->finish;
-
- return @cols;
-}
-
-##### NOTE: not used yet.
-# Usage: &dbSelectHashref($select, $from, $where, $other)
-sub dbSelectHashref {
- my $c = dbSelectManyHash(@_);
- my $H = $c->fetchrow_hashref;
- $c->finish;
- return $H;
-}
-
-##### NOTE: not used yet.
-# Usage: &dbSelectHashref($select, $from, $where, $other)
-sub dbSelectManyHash {
- my($select, $from, $where, $other) = @_;
- my $sql;
-
- $sql = "SELECT $select ";
- $sql .= "FROM $from " if $from;
- $sql .= "WHERE $where " if $where;
- $sql .= "$other" if $other;
-
-# sqlConnect();
- my $c = $dbh->prepare($sql);
- # $c->execute or print "\n<P><B>SQL Hashref Error</B><BR>\n";
-
- unless ($c->execute) {
-# apacheLog($sql);
- #kill 9,$$;
- }
-
- return $c;
-}
-