[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] SQL Style Guide available
From: |
Jürgen Henge-Ernst |
Subject: |
Re: [Phpgroupware-developers] SQL Style Guide available |
Date: |
Wed, 7 May 2003 16:09:48 +0200 |
User-agent: |
KMail/1.5 |
On Wednesday 07 May 2003 15:42, Chris Weiss wrote:
> >I am sorry to say - the "phpgw_" is redundant here and has no helpful
> >meaning also
>
> no it is VERY needed for people on shared hosts who only get one database.
> It should be replaced with a config var so the admin can change phpgw_ to
> whatever s/he wants.
This will require function like DB_TableName(name), DB_ColumnName(), .. and so
on which translates tablename and columnanes in the manner the database
expect that name and may add a prefix/suffix for the table/column. If all
places in the application use such functions it is very easy to port the
application to another DB-System. If you are using DB2. e.g. the Columnames
are case-senistive if you put " around the columnname. Then the associative
Array of odbc_fetch_row also use those case-senitive names in the result and
no further transformation of that result must be made when the field is
fetched.
I'm developping applications, which run on DB2 Server, DB2 Host, Oracle,
MySQL, PostgresSQL and it's terrible, because each database use Tablenames
and Columnnames in different formats (upper/lowercase and
case-sensitive/case-insensitive).
Such functions will make the porting of applications to different Databases
much easier, if they are used, or you handle such things in the DB-Layer (e.g
Parse the statement and change the parts which need to be modified like
table-prefixes and " around Columnnames) which is more complicated than using
such functions when generating the queries.
Just my two cents
Greetings Jürgen
--
Juergen Henge-Ernst //IngelheimerStr 1 // 64295 Darmstadt // Germany
email: address@hidden ICQ 56324358