Hi

I am starting a new Symfony5 project that uses Doctrine DBAL and an Oracle 
database. I am trying to figure out best practices and wanted to 
investigate the usage of bind variables.

I seem to have hit an issue whereby the bind variable type isn't being 
respected.

Here's a simple insert function:

public *function *createActionTypeWithBind(*Request *$request, *Connection 
*$conn, *string *$action_type_name){

    $sql *= **'insert into tt_action_type (action_type_id, action_type_name) 
values (TT_SEQ_JUNK.nextval, :action_type_name)'*;

    $query *= *$conn*->*prepare($sql);

    $query*->*bindValue(*'action_type_name'*, $action_type_name, 
ParameterType*::**INTEGER*);

    $query*->*execute();

 

    *return new *Response(*'done'*);

}


The function should fail because $action_type_name is a *string *and I have 
typed it as an integer, but the insert in fact works(!).

Can anybody enlighten me here?

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/doctrine-user/0a31641c-99ec-4962-a685-f02e34ca91c2%40googlegroups.com.

Reply via email to