Fw: How to Retrieve Table Name from Statement Handle
- From: joseph_lamb@xxxxxxxxx (Lamb Joseph)
- Date: Wed, 7 May 2008 12:37:32 -0700 (PDT)
To answer you question, for an Oracle environment I would like $sth->{TABLENAME} to contain a list.
my $tablename = $sth->{TABLENAME} ->[0] = First table
$tablename $sth->{TABLENAME} ->[1] = Second table
The $tablename value will be schema.tablename format.
For example:
schema.narf
schema.zord
Joseph Lamb
----- Forwarded Message ----
From: Alexander Foken <alexander@xxxxxxxx>
To: Lamb Joseph <joseph_lamb@xxxxxxxxx>
Cc: dbi-users@xxxxxxxx
Sent: Wednesday, May 7, 2008 11:18:53 AM
Subject: Re: How to Retrieve Table Name from Statement Handle
Hmmm, and what do you think $sth->{TABLENAME} should contain after
executing the following SQL?
SELECT t1.foo,t2.bar FROM narf t1, zord t2 WHERE t1.ikes=t2.blurb
Alexander
On 07.05.2008 19:51, Lamb Joseph wrote:
I am creating a simple tool that will query one table and retrieve the data. Then this tool will turn the data into insert statements.
I was wondering if there was a way to retrieve the table name from the statement handle?
Similar to print "SQL statement contains $sth->{NUM_OF_FIELDS} columns\n";
but like this
print "SQL statement table name is $sth->{TABLENAME} \n";
Joseph Lamb
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
.
- Follow-Ups:
- Re: Fw: How to Retrieve Table Name from Statement Handle
- From: Jonathan Leffler
- Re: Fw: How to Retrieve Table Name from Statement Handle
- Prev by Date: Re: How to Retrieve Table Name from Statement Handle
- Next by Date: Fw: How to Retrieve Table Name from Statement Handle
- Previous by thread: Re: How to Retrieve Table Name from Statement Handle
- Next by thread: Re: Fw: How to Retrieve Table Name from Statement Handle
- Index(es):
Relevant Pages
|