Question (Bug?) : User Defined Flags not received when using FETCH or OFFSET. #428
-
Hello. There is an unexpected behavior with using (FETCH FIRST | OFFSET) X ROWS.
Running:
I went in deeper and saw that in src/oracledb/impl/thin/messages.pyx:680 , when using FETCH or OFFSET, the Has anyone here experienced this behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
What exact DB versions did you test with? (And have you had a chance to try 23ai ? !) |
Beta Was this translation helpful? Give feedback.
-
I just tried this with 23ai (23.6) with the following SQL: create table disc_428 (
id number(9) not null,
json_val json not null,
constraint disc_428_ck_1 check (json_val is json)
);
insert into disc_428 values (
1,
'{"key1": 5, "key2": 6}'
);
insert into disc_428 values (
2,
'{"key3": 15, "key4": 16}'
);
insert into disc_428 values (
3,
'{"key5": 25, "key6": 26}'
);
commit; I then ran this Python script and didn't notice any trouble: import oracledb
conn = oracledb.connect("user/pw@host/service_name")
cursor = conn.cursor()
print("normal")
cursor.execute("select * from disc_428")
for row in cursor:
print(row)
print()
print("with fetch first")
cursor.execute("select * from disc_428 fetch first 1 rows only")
for row in cursor:
print(row)
print()
print("with offset")
cursor.execute(
"""
select * from disc_428
order by id
offset 1 rows
fetch next 1 rows only
""")
for row in cursor:
print(row)
print() Can you try the same script and let me know if you run into any difficulties with it? I suspect it has something to do with the database itself. |
Beta Was this translation helpful? Give feedback.
Thanks. With VARCHAR2(1024) I see the same results as you do -- the value is returned as a string instead of a dictionary. This is a bug in the database and not in the driver. I'll report it internally -- but if you can report this to Oracle Support as well, that would be helpful.