{"action":"created","issue":{"url":"https://api.github.com/repos/mattn/go-oci8/issues/54","labels_url":"https://api.github.com/repos/mattn/go-oci8/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/mattn/go-oci8/issues/54/comments","events_url":"https://api.github.com/repos/mattn/go-oci8/issues/54/events","html_url":"https://github.com/mattn/go-oci8/issues/54","id":59316622,"number":54,"title":"Prepared statement only succeeds on the first query","user":{"login":"bgmerrell","id":146526,"avatar_url":"https://avatars.githubusercontent.com/u/146526?v=3","gravatar_id":"","url":"https://api.github.com/users/bgmerrell","html_url":"https://github.com/bgmerrell","followers_url":"https://api.github.com/users/bgmerrell/followers","following_url":"https://api.github.com/users/bgmerrell/following{/other_user}","gists_url":"https://api.github.com/users/bgmerrell/gists{/gist_id}","starred_url":"https://api.github.com/users/bgmerrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgmerrell/subscriptions","organizations_url":"https://api.github.com/users/bgmerrell/orgs","repos_url":"https://api.github.com/users/bgmerrell/repos","events_url":"https://api.github.com/users/bgmerrell/events{/privacy}","received_events_url":"https://api.github.com/users/bgmerrell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-28T01:03:34Z","updated_at":"2015-02-28T13:20:04Z","closed_at":null,"body":"I am trying to use prepared statements with the go-oci8 driver.  The first query succeeds but subsequent queries fail.  Here is my test code:\r\n\r\n```\r\nimport (\r\n\t\"database/sql\"\r\n\t\"fmt\"\r\n\t\"log\"\r\n\r\n\t_ \"github.com/mattn/go-oci8\"\r\n)\r\n\r\nconst (\r\n\tUsername    = \"username\"\r\n\tPassword    = \"password\"\r\n\tHostname    = \"localhost\"\r\n\tPort        = \"1521\"\r\n\tServiceName = \"service\"\r\n\r\n\tQuery = \"select foo, bar from baz where qux =:qux\"\r\n)\r\n\r\nfunc main() {\r\n\tdb, err := sql.Open(\"oci8\",\r\n\t\tUsername+\":\"+Password+\"@\"+Hostname+\":\"+Port+\"/\"+ServiceName)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer db.Close()\r\n\tstmt, err := db.Prepare(Query)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer stmt.Close()\r\n\r\n\tvar foo, bar string\r\n\tqux := \"12345\"\r\n\terr = stmt.QueryRow(qux).Scan(&foo, &bar)\r\n\tif err != nil {\r\n\t\tif err == sql.ErrNoRows {\r\n\t\t\tfmt.Println(\"no results for qux:\", qux)\r\n\t\t} else {\r\n\t\t\tlog.Fatal(err)\r\n\t\t}\r\n\t}\r\n\tfmt.Printf(\"foo: %s, bar: %s\\n\", foo, bar)\r\n\r\n\terr = stmt.QueryRow(qux).Scan(&foo, &bar)\r\n\tif err != nil {\r\n\t\tif err == sql.ErrNoRows {\r\n\t\t\tfmt.Println(\"no results for qux:\", qux)\r\n\t\t} else {\r\n\t\t\tlog.Fatal(err)\r\n\t\t}\r\n\t}\r\n\tfmt.Printf(\"foo: %s, bar: %s\\n\", foo, bar)\r\n}\r\n```\r\n\r\nHere is my output:\r\n\r\n```\r\nfoo: 1234, bar: 5678\r\n2015/02/27 17:59:57 exit status 1\r\n```\r\n\r\nThe first line is expected; I would expected that information to be printed twice, but the second query returns an error (and log.Fatal(err) gets called).\r\n\r\nAre prepared statement expected to work?  Am I using doing something incorrectly?"},"comment":{"url":"https://api.github.com/repos/mattn/go-oci8/issues/comments/76525814","html_url":"https://github.com/mattn/go-oci8/issues/54#issuecomment-76525814","issue_url":"https://api.github.com/repos/mattn/go-oci8/issues/54","id":76525814,"user":{"login":"mattn","id":10111,"avatar_url":"https://avatars.githubusercontent.com/u/10111?v=3","gravatar_id":"","url":"https://api.github.com/users/mattn","html_url":"https://github.com/mattn","followers_url":"https://api.github.com/users/mattn/followers","following_url":"https://api.github.com/users/mattn/following{/other_user}","gists_url":"https://api.github.com/users/mattn/gists{/gist_id}","starred_url":"https://api.github.com/users/mattn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattn/subscriptions","organizations_url":"https://api.github.com/users/mattn/orgs","repos_url":"https://api.github.com/users/mattn/repos","events_url":"https://api.github.com/users/mattn/events{/privacy}","received_events_url":"https://api.github.com/users/mattn/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T13:20:04Z","updated_at":"2015-02-28T13:20:04Z","body":"I'm sorry. I don't understand what is your problem."}}