Search found 211 matches

by MJFShark
16.06.2021, 11:36
Forum: ZeosLib 7.3/8.0 Forum
Topic: Firebird and SupportsMixedCaseIdentifiers
Replies: 5
Views: 187

Re: Firebird and SupportsMixedCaseIdentifiers

Hi Jan, I believe the value for SupportsMixedCaseIdentifiers is specifically for unquoted identifiers. The only database I use where this value is true is MySQL 5.7 on Linux with Get_lower_case_table_names = 0. This value correctly defaults to False in ZDbcMetadata. Here's the help for it from ZDbcM...
by MJFShark
15.06.2021, 22:00
Forum: ZeosLib 7.3/8.0 Forum
Topic: Firebird and SupportsMixedCaseIdentifiers
Replies: 5
Views: 187

Firebird and SupportsMixedCaseIdentifiers

Currently Firebird returns True for SupportsMixedCaseIdentifiers, but I *think* it should be false? Btw, thanks Jan for your recent updates on using Firebird embedded. I had been meaning to look into this for an internal project and your wiki page helped (although I'm just on windows for it.)

-Mark
by MJFShark
05.06.2021, 17:39
Forum: User Patches
Topic: Issue with RefreshCurrentRow with no primary key.
Replies: 7
Views: 398

Re: Issue with RefreshCurrentRow with no primary key.

Here's what I ended up with. This just adds two checks for "WhereAll" since if that's true the refresh statement could change each time if there are nulls involved. This retains the refresh statement caching if there's a primary key. Body of TZGenerateSQLCachedResolver.RefreshCurrentRow if...
by MJFShark
05.06.2021, 17:21
Forum: User Patches
Topic: Fixes for Oracle OCINumber BCD2Nvu method
Replies: 0
Views: 512

Fixes for Oracle OCINumber BCD2Nvu method

Currently the BCD2Nvu function fails for negative numbers and for some positive numbers with a negative exponent. I've made a pull request which I think fixes both issues.

-Mark
by MJFShark
04.06.2021, 15:21
Forum: User Patches
Topic: Issue with RefreshCurrentRow with no primary key.
Replies: 7
Views: 398

Re: Issue with RefreshCurrentRow with no primary key.

In my case I use RefreshCurrentRow after a post to reread the values in case they changed (triggers and such.) In my testing it with Oracle I ran into a lot of errors that seem to be related to the refresh statement being cached. The only way that I was able to fix it completely (so far) was to remo...
by MJFShark
03.06.2021, 19:21
Forum: User Patches
Topic: Issue with RefreshCurrentRow with no primary key.
Replies: 7
Views: 398

Re: Issue with RefreshCurrentRow with no primary key.

To take care of the caching problem I ended up adding "or WhereAll" to the test for InitStmt. if (RefreshResultSet = nil) or (RefreshResultSet.GetStatement = nil) or RefreshResultSet.GetStatement.IsClosed or WhereAll then InitStmt(Stmt) else RefreshResultSet.GetStatement.QueryInterface(IZP...
by MJFShark
03.06.2021, 18:31
Forum: User Patches
Topic: Issue with RefreshCurrentRow with no primary key.
Replies: 7
Views: 398

Issue with RefreshCurrentRow with no primary key.

NOTE: The issues pointed out below all correspond to tables that don't have a primary key. So this is a bit of a special case, but it would be nice to fix it. See my note below on the RefreshResultSet statement caching. I noticed when calling RefreshCurrentRow on a query with no primary key and some...
by MJFShark
01.06.2021, 12:52
Forum: ZeosLib 7.3/8.0 Forum
Topic: Possible issue with PostgreSQL decimal fields.
Replies: 8
Views: 393

Re: Possible issue with PostgreSQL decimal fields.

Hi Jan, Thanks! I've now realized that the only reason my changes seemed to work is because memory was zeroed before the pgnumeric was filled in, as soon as I filled it with something else instead my tests all failed! However I may have actually fixed things (instead of my non-fix from above lol.) T...
by MJFShark
31.05.2021, 19:33
Forum: ZeosLib 7.3/8.0 Forum
Topic: Possible issue with PostgreSQL decimal fields.
Replies: 8
Views: 393

Re: Possible issue with PostgreSQL decimal fields.

I think I fixed it. In procedure BCD2PGNumeric change the following line: From: NBASEDigit := (PWords - Dst - 8) shr 1; //calc count of nbase digits To: NBASEDigit := Max((PWords - Dst - 8), 1); //calc count of nbase digits NumBasedDigits := NBASEDigit; In my test program which generates thousands o...
by MJFShark
31.05.2021, 17:41
Forum: ZeosLib 7.3/8.0 Forum
Topic: Possible issue with PostgreSQL decimal fields.
Replies: 8
Views: 393

Re: Possible issue with PostgreSQL decimal fields.

Figured it out where the issue is! BCD2PGNumeric fails on any value where the number of decimal places is not 0 or a multiple of 4 digits. The result is a truncation to that "level" so 1.12 becomes 1, 1.123456 becomes 1.1234, etc. 1 (or any integer): Works! 1.1: Fails (returns 1) 1.12: Fai...
by MJFShark
28.05.2021, 13:09
Forum: ZeosLib 7.3/8.0 Forum
Topic: Possible issue with PostgreSQL decimal fields.
Replies: 8
Views: 393

Re: Possible issue with PostgreSQL decimal fields.

Hi Jan, Thanks. I've now tested using .AsBCD as well as just an .AsString (with the same results, truncated values) and it appears that all roads eventually lead through the BCD2PGNumeric procedure. I'm not savvy enough with BCD or Pg's internal format to debug it (and it's easily possible that I'm ...
by MJFShark
27.05.2021, 22:00
Forum: ZeosLib 7.3/8.0 Forum
Topic: Possible issue with PostgreSQL decimal fields.
Replies: 8
Views: 393

Possible issue with PostgreSQL decimal fields.

Hi All! I'm having some issues when entering floating point types into PostgreSQL. This appears to affect query field editing as well as using parameters for data entry. Here's a small console mode program that gives a quick example. In this case inserting "23.82" into a Decimal(10,6) colu...
by MJFShark
23.05.2021, 21:47
Forum: ZeosLib 7.3/8.0 Forum
Topic: Rounding question related to RoundNanoFractionTo
Replies: 0
Views: 346

Rounding question related to RoundNanoFractionTo

This may be something I don't understand, but RoundNanoFractionTo seems to give some unexpected results. If you call: x := RoundNanoFractionTo(123456789, 3); The result is 124000000. Am I crazy or should that be 123000000? I'm aware of different rounding schemes (banker's rounding and such) but I ca...
by MJFShark
15.05.2021, 21:50
Forum: ZeosLib 7.3/8.0 Forum
Topic: ZFormatSettings issues related to separators
Replies: 1
Views: 97

Re: ZFormatSettings issues related to separators

Update. Another options is to always set XXXFormatSettings.FormatSettings to a TFormatSettings object with the values you need before using the various .Format properties. Note that you still need to set the individual format properties or it will default to the system FormatSettings object, which m...