Params In Subquery Psgsql

Hi!

Here is my code to execute my query:


Yii::app()->db->createCommand(

                "UPDATE [...]

                WHERE my_id IN(SELECT my_id

                                FROM [...]

                                WHERE f_contract_id=:contract_id AND f_site_id=:site_id)

                        AND f_site_id=:site_id

                        AND f_expiry_date>NOW()"

            )->queryColumn(array(':contract_id'=>$this->f_contract_id,

                                     ':site_id'=>$this->f_site_id));

As you can see, I have two parameters :site_id, one in my query, one in the subquery.

This query return this error:

Here is the content of my parameter according to my logs:

In fact, both of my parameters a replaced in my query, but the parameter in my subquery is replaced without simple quote, thats why i get an "Invalid column index".

Is it a bug or is it my fault?

Note, this code works with php 5.2, I get an error since I have been upgraded to php 5.4.

Solved.

In fact I have to do a queryAll instead a queryColumn.

Sorry for useless topic.

You should use execute() method instead of queryColumn(), which tries to read data from that query. An UPDATE query doesn’t return anything.