DBI Question

2004-01-30 Thread ashish srivastava
Hi Is it possible to get the names of the columns which a user has selected? I mean suppose a user writes a query as : select ename,deptno,sal from emp; then can we print the column name(ENAME,DEPTNO,SAL) ? Thanks Ashish Easiest Money Transfer to India. Send Money To 6000 Indian Towns.

RE: DBI Question

2004-01-30 Thread Mark Harris
; } will print columnname: value for each field returned for a given row. Mark -Original Message- From: ashish srivastava [mailto:[EMAIL PROTECTED] Sent: Friday, January 30, 2004 1:48 PM To: [EMAIL PROTECTED] Subject: DBI Question Hi Is it possible to get the names of the columns which

Re: DBI Question

2004-01-30 Thread Richard Morse
On 30 Jan 2004, at 08:48 AM, ashish srivastava wrote: Is it possible to get the names of the columns which a user has selected? I mean suppose a user writes a query as : select ename,deptno,sal from emp; then can we print the column name(ENAME,DEPTNO,SAL) ? Look at the DBI docs, under the

Re: DBI Question

2004-01-30 Thread John Deighan
At 08:48 AM 1/30/2004, ashish srivastava wrote: Hi Is it possible to get the names of the columns which a user has selected? I mean suppose a user writes a query as : select ename,deptno,sal from emp; then can we print the column name(ENAME,DEPTNO,SAL) ? Here's some example code (tested) to

Re: DBI Question

2004-01-30 Thread Joe Youngquist
:34 AM Subject: RE: DBI Question Hi Ashish, If you get the results using a hash reference rather than just an array of values then you can: (not tested...) my $row = $stmt-fetchrow_hashref(); # returns a reference to a hash indexed by column name foreach my $column (keys %{$row

Re: DBI Question

2004-01-30 Thread Rhesa Rozendaal
Richard Morse wrote: On 30 Jan 2004, at 08:48 AM, ashish srivastava wrote: Is it possible to get the names of the columns which a user has selected? I mean suppose a user writes a query as : select ename,deptno,sal from emp; then can we print the column name(ENAME,DEPTNO,SAL) ? Look at the

RE: DBI Question

2003-07-23 Thread Iain Whyte
, -- Iain Whyte infrastructure and systems manager Fortis Clearing Sydney Pty Ltd Ph: +61 2 92336497 Fx: +61 2 92364440 Mb: 0419793593 Em: [EMAIL PROTECTED] -Original Message- From: steve silvers [mailto:[EMAIL PROTECTED] Sent: Thursday, 24 July 2003 1:49 AM To: [EMAIL PROTECTED] Subject: DBI

Re: DBI Question

2003-07-23 Thread Stephen Patterson
On 23 Jul 03, steve silvers ([EMAIL PROTECTED]) wrote: But if you use a statement as a count. SELECT COUNT(*) FROM TABLE WHERE bla.. How do you get the count number. Do you still have to go through a loop and count all occurences of the searched criteria? If so then you can't use a

RE: DBI Question

2003-07-23 Thread Bradley K. Embree
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Stephen Patterson Sent: Wednesday, July 23, 2003 11:10 AM To: [EMAIL PROTECTED] Subject: Re: DBI Question snip as you'll only be getting a single element, you should be able to use $count = $sth

Re: DBI Question

2000-12-20 Thread Charles Pelkey
Try this: print qq(SELECT NAME="column" SIZE="5"); while(defined ($column) = $sth-fetchrow_array){ or print qq(OPTION VALUE="$column"$column/OPTION\n) if (defined $column); --- Charles E. Pelkey [EMAIL PROTECTED] C.P. Designs