Forum OpenACS Q&A: Re: URGENT: db_list problem

Collapse
Posted by Dan Wickstrom on
Use an tcl var for the offset.  The pg driver is converting the bind vars to quoted strings, while pg expects an integer for the offset value.  The type mismatch is causing your error.
Collapse
Posted by Jerome M on
what do u mean user $ofst instead of :ofst? but is causing an error...

Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  parser: parse error at or near "$"

SQL:
    select msisdn, sms_message, date(date_inserted) as date_i
    from rn1071
    order by date_inserted desc
    limit 30 offset $ofst

TIA

Collapse
Posted by Tilmann Singer on
You propably surrounded your query string with { }. Variables won't get substituted in this, only when the string is surrounded by " ".