Hi, I got a problem when I tried to query my database:
===========================================================
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
ERROR: Attribute 'axt1113' not found
SQL: SELECT cm_index.articleid FROM cm_index WHERE cm_index.articleid=AXT1113
while executing
"ns_pg_bind 0or1row nsdb0 {SELECT cm_index.articleid FROM cm_index WHERE cm_index.articleid=AXT1113}"
===========================================================
The following lines are my source code
===========================================================
ad_page_contract {
@author char.wang
@creation-date 2003-7-14
}
set issue 113
set query1 "SELECT book.issue FROM book WHERE book.issue = $issue"
set IfIssueExist [db_0or1row {dummy1} $query1]
set textID AXT1113
set query2 "SELECT text.textid FROM text WHERE text.textid = $textID"
set IfTextExist [db_0or1row {dummy2} $query2]
ad_return_template
===========================================================
I made two sql queries in this script, both of them were trying to figure out if this record is already exist in database.
The first query can work correctly without any problem, while the second query can't.
The query condition is the only difference between these two queries.
When I tried to replace the value of textID from "AXT1113" to "1113", somehow it works, how could this happen?
Does that mean I should only use numbers to do query?
Could any one help me with this problem?
I am using OpenACS 4.6.2 with aolserver 3.3 and postgresql 7.2.3