PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → [WD22] Issue with HReadSeekFirst
[WD22] Issue with HReadSeekFirst
Started by Sivaprakash, Feb., 22 2018 7:50 AM - 5 replies
Posted on February, 22 2018 - 7:50 AM
Hello,

[wd22] [postgresql]

I have a composite key with 6 fields,

File1

Field1 varchar(10)
Field2 varchar(10)
Field3 int
Field4 varchar(10)
Field5 varchar(3)
Field6 int

Composite Key [Field1Field2Field3Field4Field5Field6]

When I try to read with
HReadSeekFirst(File1, Field1Field2Field3Field4Field5Field6, [Value1, Value2, Valu3, Value4, Value5, Value6] )

it always returns True.
Even HFound also returns true
Even for those values for which NO record is found.

It points to first record and returns value corresponding to the first record for any value that's been seek.

But the same query run through HExecuteSQLQuery returns correct value and record, but not using HReadSeekFirst.

Any thing that I'm missing ?

Happiness Always
BKR Sivaprakash
Posted on February, 22 2018 - 1:01 PM
Hi

can you test if you have the same result with hreadseek + hidentical option instead of the hreadseekfirst?

Best regards
Posted on February, 22 2018 - 3:04 PM
Yes Fabrice Harari,

We checked with hreadkseek + hidentical also, same result. We found that this issue happens with this file.

Another file with a composite key of 5 fields, with the same data type works fine.
File2

Field1 varchar(10)
Field2 varchar(10)
Field3 int
Field4 varchar(10)
Field5 varchar(3)

Composite Key [Field1Field2Field3Field4Field5]

This works fine.
HReadSeekFirst(File1, Field1Field2Field3Field4Field5, [Value1, Value2, Valu3, Value4, Value5] )

Happiness Always
BKR Sivaprakash
Posted on February, 22 2018 - 4:34 PM
maybe you can check if the fields in the index are case sensitive?
Posted on February, 22 2018 - 9:59 PM
Hello Sivaprakash

Try using HBuildkeyvalue() instead of the array square brackets

Regards
Al
Posted on February, 22 2018 - 9:59 PM
Not that I have much experience with pg, but the native driver translates h* statements into sql, so if you are able to trace the queries received at the pg server, it might provide some insight.