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

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 December 12th, 2003, 03:15 PM
thomasj thomasj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 thomasj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Table size?

I have a table with a lot of Varchar fields.

Like: VARCHAR (10000)

But it seems that I am running out of space on this table.

When a try to add a new varchar field (10000), I get this error:



"fmCompile.trCompile:
This operation is not defined for system tables.
Unsucceddfull metadata update.
New record size of 69412 bytes is too long.
TABLE MYTABLE"


Any help?

Reply With Quote
  #2  
Old December 13th, 2003, 04:41 PM
wagga wagga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 wagga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Table Size

There is a row width limit of 64k BYTES. ie Unicode chars will be half, etc.

Easy fix, just use BLOBS - each field uses 10 bytes ( it points to the real data)

see this:

URL

cheers - dave

Reply With Quote
  #3  
Old December 14th, 2003, 01:15 PM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 249 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 23 m 12 sec
Reputation Power: 13
You can use BLOBs for larger text columns, however, they cannot be indexed, easily searched and should be updated/inserted in different ways.

A more important and logical question would be:
Why on earth do you need VARCHAR(10000) columns?
__________________
Martijn Tonies
Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
Upscene Productions
http://www.upscene.com

Reply With Quote
  #4  
Old December 14th, 2003, 03:48 PM
thomasj thomasj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 thomasj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi upscene & wagga:


Thanks for your reply.


I need the big varchar fields to store some graphics settings in.
I don't generete the settings, I just need to store them.

I will try the Blob field later.

Thanks for now.

Reply With Quote
  #5  
Old December 15th, 2003, 02:52 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 249 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 23 m 12 sec
Reputation Power: 13
In that case, you really should use BLOBs. But are these settings this large?

Well, good luck.

Reply With Quote
  #6  
Old December 15th, 2003, 03:40 AM
thomasj thomasj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 thomasj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi upscene:

Are there a special way to handle BLOB fields when update/insert?


This:
UPDATE myTABLE SET settings = "TEST"

dont work.


Error:
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
feature is not supported.
BLOB and array data types are not supported for move operation

Reply With Quote
  #7  
Old December 15th, 2003, 03:51 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 249 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 23 m 12 sec
Reputation Power: 13
Quote:
Are there a special way to handle BLOB fields when update/insert?

First of all, don't use double quotes ("value") but single quotes for values ('value'). With double quotes, Firebird thinks you're using a column name.

Second, BLOBs can be updated/inserted directly if you're using text blobs (BLOB SUB_TYPE TEXT), but others require you to use prepared statements:

INSERT INTO ... (MYBLOB) VALUES (:MYBLOB)

Prepare the statement.

(In Delphi)
Use something like:
ParamByName('MYBLOB').LoadFromStream(etc)

Reply With Quote
  #8  
Old December 15th, 2003, 11:00 AM
thomasj thomasj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 thomasj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi upscene:

Again thanks.


I use Database workbench as database editor.
Really great product.

I am quit new to Firebird, and I want to optimize my speed/mem usage on my database.
Maybe you can help me explain some of these terms:


- Page size
- Allocated pages
- Page buffers
- Sweep interval


Thanks

Regards
Thomas

Reply With Quote
  #9  
Old December 15th, 2003, 11:09 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 249 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 23 m 12 sec
Reputation Power: 13
Hi Thomas,

>>I use Database workbench as database editor.
>>Really great product.

Thank you for your kind comments.

I advise you to download the InterBase 6 documentation (from www.ibphoenix.com) - most of it is still valid for Firebird.

Short explanations:
>> Page size

Each database is build from "pages". Blocks of database-data with a certain size. Depending on your average record length, one page might be better than another. Most people use 8192 bytes as their page size.

>> Allocated pages

The number of pages used for your database.

>> Page buffers

The number of pages Firebird will allocate as cache memory when someone connects to this database.

>> Sweep interval

Check this elsewhere, I'm unable to explain this quickly.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Table size?

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap