Up Prev Next
From: "Barlow, Ed" <ebarlow at mlp dot com>
Subject: RE: Checking to see if a variable is a DBH
Date: Jan 6 2006 10:53PM
i think you can just see if its a reference... ie... use the ref()
built in function. will return "" if it is not a reference and when i
it returned DBI::db for DBI connections to both sybase and SQL server.
[mailto:firstname.lastname@example.org] On Behalf Of Wechsler, Steven
Sent: Friday, January 06, 2006 5:00 PM
Subject: Checking to see if a variable is a DBH
Sorry, this is not a sybase-specific question, but DBI...
I'm writing a function that I want to be able to pass either a
Sybase server name or a DBI dbhandle; if the former, it will establish a
connection to the server; if the latter, it will use the extant
connection. Is there a straightforward way to check to see if the value
passed to the function is a DBH or not?
Steve Wechsler | email@example.com
Sybase/SQL Server Database Administrator
Picture (Metafile)MTV Networks