Closed stepanovdg closed 1 month ago
I just tried this (after adding the missing ending triple quote in your code above) and it worked just fine for me! What database (platform and version) are you using? I just tried with 23.4 on Linux.
@anthony-tuininga Yes sorry for triple qoute missing. Incorrectly copied. Just checked - we have cluster on ec2 running oracle 19c enterprise.
Also just rechecked - its the same error. I wrote simple generate sql query function that just iterate over datatypes (two columns null and not null version). So have that query printed and and executed. Execute (getConnection helper method works fine as executing all other queries good - it is just something with that particular) And in order to check if I had problems in syntax I copied into dbveawer with session to the same db and it successfully created table (without any change). I assume maybe its realted to thin client. But it is strange. And error itself related to not null constraint.
So I am unblocked for development - just using manually created that query but wanted to create it also in our automated tests later.( and its failing ()
@stepanovdg as a workaround for automated tests, how about creating it in PL/SQL?:
SQL> @t
SQL> begin
2 execute immediate 'drop table if exists mytab';
3 execute immediate 'create table mytab (c number)';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> desc mytab
Name Null? Type
----------------------------------------- -------- ----------------------------
C NUMBER
@stepanovdg, the error you are getting (ORA-00922: missing or invalid option
) is coming from the server. It might be useful to get the packet output (set the environment variable PYO_DEBUG_PACKETS
to any value before running your script). The only packets required are the ones where the DDL is sent and the response received. Hopefully this will uncover the mystery!
@stepanovdg Are you able to get the requested trace?
Closing - requested info not provided.
We are trying to create dynamically table with all build in oracle datatypes (and fill some data) to use for testing of datatypes conversions in our application. It appears that valid ddl statement is failing when use oracledb. Same table is created successfully in commandline or dbveawer. (maybe thin/thick mode related). But is strange create table not work in thin.
platform.platform: Windows-11-10.0.22631-SP0 sys.maxsize > 2**32: True platform.python_version: 3.12.4 oracledb.version: 2.2.1
Thin mode.