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: 792
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: 216
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
Post Reply