GetSequence metadata for Oracle

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 794
Joined: 18.11.2018, 17:37
Location: Hungary

GetSequence metadata for Oracle

Post by aehimself »

Hello,

Since I needed it and it was not yet implemented I added the sequence collection for Oracle.
Unfortunately I was unable to find how I can connect a sequence to a catalog and a schema (if it can be at all) so those fields are left empty.

Pull request is available on GitHub as usual.

Cheers!
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
MJFShark
Expert Boarder
Expert Boarder
Posts: 217
Joined: 04.06.2020, 13:59

Re: GetSequence metadata for Oracle

Post by MJFShark »

I may be misunderstanding, but for Oracle catalog should be empty and schema should be the SEQUENCE_OWNER column of ALL_SEQUENCES.

Also in the pull request is the following incorrect?

Code: Select all

     if FConSettings.ClientCodePage.Encoding = ceUTF16 then begin
        Result.UpdatePAnsiChar(SequenceNameIndex, GetPAnsiChar(SEQ_NAME_INDEX, Len), Len);
      end else begin
        Result.UpdatePWideChar(SequenceNameIndex, GetPWideChar(SEQ_NAME_INDEX, Len), Len);
      end;
to my eye it looks like it should be:

Code: Select all

     if FConSettings.ClientCodePage.Encoding = ceUTF16 then begin
        Result.UpdatePWideChar(SequenceNameIndex, GetPWideChar(SEQ_NAME_INDEX, Len), Len);
      end else begin
        Result.UpdatePAnsiChar(SequenceNameIndex, GetPAnsiChar(SEQ_NAME_INDEX, Len), Len);
      end;
Good job on the new feature!

-Mark
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 794
Joined: 18.11.2018, 17:37
Location: Hungary

Re: GetSequence metadata for Oracle

Post by aehimself »

MJFShark wrote: 13.11.2024, 16:00I may be misunderstanding, but for Oracle catalog should be empty and schema should be the SEQUENCE_OWNER column of ALL_SEQUENCES.
I started my journey with MySQL and MSSQL and things were a lot more easy to understand there. I will be completely honest, I am totally lost in this Oracle naming madness... as I have no idea what these mean I thought better to leave them empty :)
MJFShark wrote: 13.11.2024, 16:00Also in the pull request is the following incorrect?
The filling is the carbon copy of how UncachedGetIndexInfo does it. Tested it in both AL32UTF8 and UTF16 and while all worked fine - there were absolutely no special characters in our sequence names so I simply might have gotten away with it.
If it is bugged this way, it has to be changed there too.
You might be right though as it is the other way around in all other methods...

I'll make some adjustments based on these in a second commit soon, thank you for the heads-up!
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Post Reply