On Sun 2003/02/02 11:52:49 EST, "Jeff Urlwin" <[EMAIL PROTECTED]> writes
:
> > > SELECT * FROM table WHERE field IS NULL
> > 
> > thats not the problem... :-). one example - i hope this makes 
> > it clearer what i mean...
> > 
> > SELECT ISNULL(ID,'') AS ID FROM $dbtableWith(nolock) WHERE
> > SUBSTRING(ID,7,6)=LEFT(?,6)
> 
> The only thing I can think of is to build your queries dynamically,
> based upon the connection.  Use $dbh->get_info(17) to get the database
> name. 
> 
> ISNULL(ID, '') for SQL Server can be NVL(ID, '') (if I'm reading it
> right :))
> 
> Substring --> substr() (although you might have a 0 based vs. 1 based
> issue across multiple platforms).
> 
> Nolock might be difficult across multiple platforms as some may not
> support it.  

It depends on which databases you need it to work with.  The easiest 
solution that should work with the most databases is to make sure your sql 
follows SQL-92 standards.  This won't work for all databases, but should 
work with Oracle, Sybase, MS-SQL Server, Informix, Postgres, DB2, etc.  I 
can only verify Oracle and Sybase (the only databases I've worked with 
recently).



Reply via email to