For anyone interested, the performance difference between using the TIBSQL and the TIBTable is HUGE. Should have guessed it would be since the TIBTable is keeping everything in memory? Anyway, use the Ascii_Char(Value) function with the TIBSQL and the speed is orders of magnitude faster! I am inserting nearly 3 million records, and once it approached 30,000 records, the TIBTable method started crawling, whereas the TIBSQL method happily chugs away at about 1,500 inserts per second (I'm only commiting the transaction after every 100, but perhaps even that is unneccessary?).

Cheers,
Phil.

Phil Middlemiss wrote:

Thanks Robert. In the mean time I played around with using a TIBTable and doing

atable.FieldByName('ACharField').AsString := Char(aval);

which is working I think. Not sure if this is faster or slower than just using a TIBSQL.

Cheers,
Phil.

Robert martin wrote:

Hi

Just go unlazy and checked the 'Firebird book'. There is an Ascii_Char(Value) function in the IB_UDF.dll library that should do what you need. (didn't bother to post to FB support group)


Rob Martin Software Engineer

phone +64 03 377 0495
fax   +64 03 377 0496
web www.chreos.com

Wild Software Ltd



Phil Middlemiss wrote:

Heh, no sister - only brothers.

I'm not a member of the Firebird support group. Yes, please post it, but could you also point me to where to join?

Cheers,
Phil.

Robert martin wrote:

Hi Phil

I can't guarantee it but Char() is probably in one of the add on dlls for Firebird. I can post your question on the Firebird support group if you are not a member :)

I don't know If I have asked this, but do you have a sister called Janet?
Rob Martin
Software Engineer


phone +64 03 377 0495
fax   +64 03 377 0496
web www.chreos.com

Wild Software Ltd



Phil Middlemiss wrote:

That was the first thing I tried too, unfortunately illegal in Firebird.

Phil.

Paul Ritchie wrote:

Not sure about FireBird but in SQL Server that would be

INSERT INTO MYTABLE VALUES (1, Char(34))

Does that help?

Cheers,
Paul.



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Phil Middlemiss
Sent: Tuesday, 19 April 2005 11:28 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] casting a number as a char in IB SQL


I'm running into difficulty trying to convert the number 34 into a CHAR
(length 1) in an INSERT statement using Firebird/Interbase. This is the
query as I'm trying it:


INSERT INTO MYTABLE VALUES(1, Cast(34 as CHAR))

which it doesn't like - it seems to be trying to convert 34 into the
string '34' which is 2 characters instead of #34.


Am I trying to do the impossible? The Character Set for the relevant
field is 'WIN1251' does that make a difference?


Cheers,
Phil.

_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi





_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi




------------------------------------------------------------------------


_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi



_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi



_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi



_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to