Search found 164 matches

by Wild_Pointer
04.01.2010, 16:45
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

In which File? There is no Function named "SQLStrToFloatDef"
Please, look in Zeos\src\core\ZSysUtils.pas
by Wild_Pointer
04.01.2010, 09:37
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

Your test program works ok on my computer: StrToFloatDef('12.5')= Using locale (thousands=. decimals=,): 125,00 Using thousands=, decimals=.: 12.50 Using thousands=. decimals=.: 125.00 Using thousands=. decimals=,: 125,00 OldSQLStrToFloatDef('12.5')= Using locale (thousands=. decimals=,): 125,00 Usi...
by Wild_Pointer
04.01.2010, 08:27
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

Hello, mdaems.

having decimal separator = thousand separator is not too good, so I vote for *not* using ifdef. Let's make things simple and clear.
by Wild_Pointer
03.01.2010, 17:45
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

mdaems wrote:Anyhow... I'd like to be sure to know what postgres returns in your cases. Is it effectively a ',' instead of '.'?
No. Postgresql returns 12345.67 (no thousand separator, "." as decimal separator) to me.
by Wild_Pointer
03.01.2010, 17:38
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

I guess I've found the problem - its thousand separator. On locale settings I have it set to ".". FPC eliminates all thousand separator characters before trying to get float from string. As my thousand is set to "." FPC eliminates all "." characters in Str and so Decima...
by Wild_Pointer
31.12.2009, 14:37
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

It seems to be FPC bug. http://forum.lazarus.freepascal.org/index.php?topic=8150.0 I've wrote a test procedure: procedure TForm1.Button2Click(Sender: TObject); var _real: Double; _dc: char; begin _dc := DecimalSeparator; DecimalSeparator:='.'; _real := StrToFloatDef('1.2', 0); DecimalSeparator:= _dc...
by Wild_Pointer
31.12.2009, 13:24
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

I've tested on postgresql 8.3.4 so I guess the problem is not related to server version (not 8.4 at least).
by Wild_Pointer
31.12.2009, 11:15
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

I can confirm this behavior is also observed using Zeos 7 and Lazarus 0.9.28 beta, fpc 2.2.4 rev 21921 win32/win64.
by Wild_Pointer
31.12.2009, 10:22
Forum: PostgreSQL
Topic: Transaction Isolation Level
Replies: 5
Views: 4120

Hello, martinrame. I guess you are mixing SQL and delphi code into one :). What I wanted to say is you should set AutoCommit to false and TransactIsolationLevel to tiNone on your TZConnection component. That way Zeos doesn't manage transactions. You should execute 'START TRANSACTION ISOLATION LEVEL ...
by Wild_Pointer
30.12.2009, 07:41
Forum: PostgreSQL
Topic: Transaction Isolation Level
Replies: 5
Views: 4120

Hello, matinrame If you want all DDL commands in single transaction, then you should use them. I would suggest using tiNode and calling BEGIN, SET TRANSACTION ISOLATION LEVEL and COMMIT manualy. This way you'll be able to handle your transactions as you want. The other thing is the lock issue. I thi...
by Wild_Pointer
29.12.2009, 10:40
Forum: 6.6 - stable
Topic: Postgres 8.4 and Decimal
Replies: 30
Views: 2873

Hello, baba

What version of zeos lib are you using? What is your Operating system. Do you use zeos with lazarus?

please provide the create script of your test.preise table (you can copy it from pgAdmin).
by Wild_Pointer
19.12.2009, 09:27
Forum: 6.6 - stable
Topic: Begin and commit not working with postgresql
Replies: 5
Views: 769

Hello, danielf. As you describe it, the thing you should double check is TransactIsolationLevel. Maybe your program changes it dynamically?.. If TransactIsolationLevel = tiNone the Begin and Commit commands are not used. If thats not the case - than this may be connected to CBuilder. I have almost n...
by Wild_Pointer
18.12.2009, 14:35
Forum: 6.6 - stable
Topic: Begin and commit not working with postgresql
Replies: 5
Views: 769

Hello, To test I used simple code: ZConnection1.Database := 'sport3_test'; ZConnection1.Connect; ZConnection1.StartTransaction; qZ.Open; ZConnection1.Commit; In Monitor file I got: 2009-12-18 15:21:15 cat: Connect, proto: postgresql-8, msg: CONNECT TO "sport3_test" AS USER "postgres&q...
by Wild_Pointer
17.12.2009, 16:35
Forum: User Patches
Topic: Connection string for postgresql
Replies: 1
Views: 1555

Connection string for postgresql

The formation of postgresql connection string is not as good as it could be. For example if you leave the database name field empty in TZConnection component on connect you'll get error saying dbname is "user=". While this is not a big problem as connection usually has database, user and p...
by Wild_Pointer
17.12.2009, 13:08
Forum: 6.6 - stable
Topic: Begin and commit not working with postgresql
Replies: 5
Views: 769

Hello, danielf

would you provide more information on TZConnection component you are using:
- what is the value for AutoCommit
- what is TransactIsolationLevel
- what DB system are you connected to?