Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 18th, 2006, 01:32 PM
phpweb phpweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 251 phpweb User rank is Private First Class (20 - 50 Reputation Level)phpweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 Days 18 h 21 m 14 sec
Reputation Power: 5
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.

Reply With Quote
  #2  
Old November 20th, 2006, 02:27 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,907 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 9 h 21 m 6 sec
Reputation Power: 279
It's all uppercase, and this is very good IMHO.

Reply With Quote
  #3  
Old November 22nd, 2006, 06:41 AM
quipo quipo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 60 quipo User rank is Corporal (100 - 500 Reputation Level)quipo User rank is Corporal (100 - 500 Reputation Level)quipo User rank is Corporal (100 - 500 Reputation Level)quipo User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 3 h 34 m 28 sec
Reputation Power: 11
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.

Reply With Quote
  #4  
Old November 22nd, 2006, 07:45 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,005 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 11 h 53 m 39 sec
Reputation Power: 67
Quote:
Originally Posted by quipo
Interbase/Firebird by default uses uppercase identifiers, and is case-insensitive, unless you quote the identifiers, in which case they become case-sensitive.
Correct.
This is compliant with the ANSI SQL standard where this behaviour is defined.
So any DBMS that works differently is not ANSI compliant.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Creating table and fields with ibWebAdmin...all field names convert to uppercase...?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT