laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

ORA-01722 Oci8Exception(code: 1722)

Open A-Tahemmout opened this issue 3 years ago • 1 comments

Summary of problem or feature request

I'm try to insert a blob in a table, the table has all columns as VARCHAR and it uses 2 composite keys which both are VARCHAR, and the model has increting as false and the keyType as string. When inserting or updating ORA-01722 get thrown the problem is in the last key binding is the SQL RETERNING statement that gives the primaryKey the value of 0. I have read the oci8 code I seen that a variable sequence gets the name of the primaryKey that is define in the model found no way to override it was hoping to be a way to remove the returning statement that has the primary key and it bind

Code snippet of problem

System details

  • Windows 11
  • 8.1
  • 8
  • 8

A-Tahemmout avatar Jan 25 '22 02:01 A-Tahemmout

image I end up updating the saveLob method in the \yajra\laravel-oci8\src\Oci8\Query\Processors\OracleProcessor.php guess it set the id to be always 0 wich look pretty weird as the id should if not most match the row id but changing PDO::PARAM_INT to PDO::PARAM_STR in the blindParam did the trick, I still don't agree with the solution since I needed to modify the vendor code and also the fact that the id is set on 0 all the time, should be a way to change the id and its type Looks very wrong!.

A-Tahemmout avatar Jan 25 '22 02:01 A-Tahemmout

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 08 '22 03:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 15 '22 04:10 github-actions[bot]