Page 1 of 1

GetSequence metadata for Oracle

Posted: 12.11.2024, 17:43
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!

Re: GetSequence metadata for Oracle

Posted: 13.11.2024, 16:00
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

Re: GetSequence metadata for Oracle

Posted: 14.11.2024, 08:09
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!