|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Creating table and fields with ibWebAdmin...all field names convert to uppercase...?
Hi.
Just installed firebird 2.0, and ibWebAdmin. Create a table using SQL from within ibWebAdmin like this: CREATE TABLE pageit ( PagID integer not null, PagParent integer not null, PagName char(50), PagActive integer not null, PRIMARY KEY (PagID) ); Then I insert two rows like this, using SQL from ibWebAdmin: insert into pageit (PagID, PagParent, PagName, PagActive) values (1,0,'Welcome',1); insert into pageit (PagID, PagParent, PagName, PagActive) values (2,0,'Gallery',1); Then I do a normal select using SQL from webadmin like this: select PagID, PagName from pageit; Which returns two rows as it should. If I now create a php script to fetch and output the data it then fails when I reference the table fields like this: $row['PagID'] $row['PagName'] Then I thought maybe this, ibase_fetch_assoc was a bit different that the mysql and mssql equivalent..... Then I took another look at this page: http://no2.php.net/ibase_fetch_assoc and read the first comment... and found this: **************************************** Unlike mysql_fetch_assoc, all indexes of associative array are upper-case. so, use $row = ibase_fetch_assoc($result); echo $row["INDEX"]; not echo $row["index"]; **************************************** WHY on the earth does it work like this when using ibase_fetch_assoc Why on earth is it not possible to use the same case as when the table / fields where created? Really really weird and superconfusing, and most certainly not very practical. Any clever way to make this work without having to convert each field name to uppercase. Maybe a setting for the firebird database engine or whatever. This is not good when developing applications that are supposed to work against multiple databases. And I would rather not have to call a function everytime inside my application which converts the fieldname to uppercase. That is timeconsuming and a waist of time for the rest of the databases. And I would rather not convert my whole application to uppercase fieldnames since that would make it unusable against the other databases. Anyone
__________________
BongoBongo Last edited by phpweb : November 19th, 2006 at 07:33 AM. |
|
#2
|
||||
|
||||
|
It's all uppercase, and this is very good IMHO.
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
Interbase/Firebird by default uses uppercase identifiers, and is case-insensitive, unless you quote the identifiers, in which case they become case-sensitive.
Having all the identifiers in the same case (either upper or lower) is a good thing if you have portability in mind. If you really want mixed-case identifiers, you must quote them. Everywhere. In CREATE TABLE, SELECT, INSERT, UPDATE, ..., statements. Everywhere. |
|
#4
|
|||
|
|||
|
Quote:
This is compliant with the ANSI SQL standard where this behaviour is defined. So any DBMS that works differently is not ANSI compliant. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Creating table and fields with ibWebAdmin...all field names convert to uppercase...? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|