New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oracle querying with methods find, does not work #5603
Comments
@gustperz do you by chance use PHP7 whith this example? I suggest logging the executed queries and checking that parameters are passed in correctly, as this might be affected by a bug that pretty much breaks |
@Ocramius I'm using php 5.5.19 |
@gustperz Can you show us the generated SQL? |
@zeroedin-bill @Ocramius
this output is EchoSQLLogger |
Can you also dump the table DDL? |
@zeroedin-bill this is the DDL of table TERCEROS
|
@gustperz The only thing I can think here is that OCI8Statement is binding the parameter wrong somehow. Can you attach a debugger and trace the query into OCI8Statement and see how it's passing the parameters to bindParam and oci_bind_by_name? I do not have an oracle environment so I'm unable to do this myself at the moment. |
Hi!!! I've got the same problem that @gustperz Can anybody help us? Thanks in advance!!! |
You are using CHAR fields so you will need to pad your 10 character string "1120567829" to 15 characters "1120567829 "
Same thing for "fulano" which should be 15 characters long "fulano " since your table uses CHAR's 😢:
Try This:
Your mapping information is also wrong, you need to add the options={"fixed":true} for both columns in you Entity I'm usually using yml mappings, so please double check this before using but I believe the annotation should look like this:
@gustperz Some advise: Even Die Hard Oracle Evangelists recommend against using them. If you plan on using doctrine extensively (or any ORM for that matter), move to VARCHAR2 even if it means spending time and $$ to update other applications or PL\SQL that you are trying to maintain compatibility with. |
@cyframepaul nice one! Closing this one as invalid as per your comment. |
I'm creating a REST API with slim3 framework and I using Doctrine2 as orm
I have the entity:
and so get the manager:
when using any method find which should return one single Empleado this return null
None are found, even though I have an Empleado with apellido1 = 'fulano' and cedula = '1234567' inserted in the database.
All table and column names are upercase, the names on the entity changed to make it a more consistent with the objective of the api, since in the TERCEROS table are stored employees, I do not know because it was called that way when it was created.
PS: Sorry for my english
The text was updated successfully, but these errors were encountered: