{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9967","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9967/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9967/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9967/events","html_url":"https://github.com/yiisoft/yii2/issues/9967","id":112309234,"number":9967,"title":"How to set a PDO statement attribute?","user":{"login":"thejahweh","id":10514993,"avatar_url":"https://avatars.githubusercontent.com/u/10514993?v=3","gravatar_id":"","url":"https://api.github.com/users/thejahweh","html_url":"https://github.com/thejahweh","followers_url":"https://api.github.com/users/thejahweh/followers","following_url":"https://api.github.com/users/thejahweh/following{/other_user}","gists_url":"https://api.github.com/users/thejahweh/gists{/gist_id}","starred_url":"https://api.github.com/users/thejahweh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejahweh/subscriptions","organizations_url":"https://api.github.com/users/thejahweh/orgs","repos_url":"https://api.github.com/users/thejahweh/repos","events_url":"https://api.github.com/users/thejahweh/events{/privacy}","received_events_url":"https://api.github.com/users/thejahweh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-20T08:05:14Z","updated_at":"2015-10-20T08:08:34Z","closed_at":"2015-10-20T08:08:34Z","body":"I have to use the each method to select in batches. The problem is, that I have to delete some columns in this foreach, which generates a table lock. Now I have to set the cursor `PDO::ATTR_CURSOR` to forward only `PDO::CURSOR_FWDONLY`. Is this even possible by now?\r\n\r\n```php\r\n$simpleQuery = SimpleObject::find();\r\n// need something like: $simpleQuery->setPdoStmtAttr(\\PDO::ATTR_CURSOR, \\PDO::CURSOR_FWDONLY);\r\nforeach ($simpleQuery->each() as $simpleObject) {\r\n    // fancy things...\r\n}\r\n```"}}