Re: retrieving column names from a table using DBI module

2003-02-18 Thread Brian McCain
It seems to me that there should be a more direct way to do it, but you could do: my $sql = "SELECT * FROM FOO"; my $arrayref = $dbh->selectall_arrayref($sql, { Columns => {} }); my @names; foreach my $key (keys %{$arrayref[0]}){ push @names, $key; } Which would leave you with a reference t

RE: retrieving column names from a table using DBI module

2003-02-18 Thread Helck, Timothy
Manisha, I think this is in the archives, or it was discussed recently. Anyway, here's a snippet that shows how to do it: for ($i=0;$i<$csr->{NUM_OF_FIELDS};$i++) { print "Field $i: $csr->{NAME}->[$i]\n"; } if you get your results back in an arrayref: while ( $arrayRef = $csr->

RE: retrieving column names from a table using DBI module

2003-02-18 Thread Dan Muey
See the DBI documentation it's something like fetch_rowhash. Or what I've done before is a describe query that assigned the column name to a number ( for reference later ) Then when You do select * ... @row = fetch_rowarray ... my $i; foreach $item(@row) { print "Column Name - $column

retrieving column names from a table using DBI module

2003-02-18 Thread Manisha Gupta
Hello I am working with Perl CGi. There is a query where i have to select all columns in a table and display the data on the web page. the query is something like "select * from But the problem is I am not able to get the column names. I am using the DBI module. Is there a way to get column nam

DBD::Oracle userenv('TERMINAL')

2003-02-18 Thread jvinopal
Hello, I would like to set oracle's notion of my TERMINAL value. my $sql = "select userenv('TERMINAL') from dual"; yields the tty: pts/10 which is not particularly interesting. can I override this setting to an application specified string? -j

ora_session_mode

2003-02-18 Thread Markham, Richard
I'm getting DBD::Oracle::st execute failed: ORA-01031: insufficient privileges (DBD: oexec error). I'm trying to send alter system kill session for example and I'm using mode 2 during initial connection. I've verified that the user can connect as sysdba from the OS as well as from a client pc in TO

Re: Need help!

2003-02-18 Thread Pierre Leblanc
Thanks! It's working perfectly on port 5432 (I use Postgres) Thanks to everybody, you've been very helpful! Pierre -- Original Message --- From: Joe Raube <[EMAIL PROTECTED]> To: Pierre Leblanc <[EMAIL PROTECTED]> Sent: Tue, 18 Feb 2003 09:45:58 -0800 (PST) Subject: Re: Need

Re: sorting by number in DBI::CSV

2003-02-18 Thread Jeff Zucker
[EMAIL PROTECTED] wrote: I am storing dates in the form "20030218" (as it seems that there is no DATE format for Tables). If I do "SELECT * FROM table ORDER BY datefield", my program just hangs I haven't heard any reports of this kind of behaviour and it sorts fine

Need help!

2003-02-18 Thread Pierre Leblanc
I have a network with 2 FreeBSD servers configured with Apache. Both servers runs PERL with DBI. Now I want to connect from one server to a database on the other one. The following script works well for a local database: my ($dbname) = "lci"; my ($user) = "www"; # conn

How do I get the database connections to close down?

2003-02-18 Thread Marcus Claesson
Hello all, I really hope some kind soul out there can help me with this problem! I'm using Perl dbi:Pg (as well as DBIx::Recordet) in a CGI script where the users connect to my database through the web. The problem is that the database connections won't close down and I end up with an increasing

Re: Can't load dbi problem

2003-02-18 Thread Bob X
"Alain Brasseur" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > I have install the same configuration on three pc but the last one doesn't > work. > > Apache 2.44 9+mysql+ activeperl5.8 + module cgi, dbd-mysqlPP via ppm.bat. > (win98 is the OS) > > I

RE: sorting by number in DBI::CSV

2003-02-18 Thread nayeem
please check and confirm me. >= Original Message From <[EMAIL PROTECTED]> = >I am storing dates in the form "20030218" (as it seems that there is no >DATE format for Tables). If I do "SELECT * FROM table ORDER BY datefield", >my program just hangs

sorting by number in DBI::CSV

2003-02-18 Thread scf
I am storing dates in the form "20030218" (as it seems that there is no DATE format for Tables). If I do "SELECT * FROM table ORDER BY datefield", my program just hangs (whether the date field is INTEGER or CHAR(20)), but it works OK if I store my dates in the form "date

Re: dbiproxy Problem on Win2K...

2003-02-18 Thread Tim Bunce
On Tue, Feb 18, 2003 at 10:59:35AM +, oliver wrote: > > On Mon, 17 Feb 2003 09:56:02 -0800, Tim Howell wrote: > > >I'm having a problem with dbiproxy on Win2K. I'm connecting to the > >proxy server from perl 5.8 on a linux box in order to access a MS SQL > >database on the Win2K box. Everyt

Can't load dbi problem

2003-02-18 Thread Alain Brasseur
Hello, I have install the same configuration on three pc but the last one doesn't work. Apache 2.44 9+mysql+ activeperl5.8 + module cgi, dbd-mysqlPP via ppm.bat. (win98 is the OS) I have the following error : can't load DBI (@IND is d:\perl\bin; d:\perl\lib, ...). Do I have forgotten somethi

Re: dbiproxy Problem on Win2K...

2003-02-18 Thread oliver
On Mon, 17 Feb 2003 09:56:02 -0800, Tim Howell wrote: >I'm having a problem with dbiproxy on Win2K. I'm connecting to the >proxy server from perl 5.8 on a linux box in order to access a MS SQL >database on the Win2K box. Everything works fine for one request. >After a single query has been exec

Re: question: DBD::Oracle needed for DBI on another host?

2003-02-18 Thread Peter J. Holzer
On 2003-02-06 14:16:39 -0500, Janet Goldstein wrote: > I am running Perl 5.6.0 on a DEC Alpha. I wish to access an Oracle > database located on a different machine. Do I still need to install > DBD::Oracle locallly (on the machine running the script), Yes. > or is DBI enough by itself? No. DBI b

Re: blob error need help

2003-02-18 Thread Sumitro Chowdhury
> while (my $doc = $sth->fetchrow_array) { I would replace $doc with @doc, and as David suggested, rebuild DBD::Oracle against Oracle 8i libraries HTH, Sumitro. On 2003.02.17 15:04 Scott Purcell wrote: I am using ActiveState Perl Version v5.6.1 for MSWin32-x86 on my 2000 box. The dbd was