Re: Bizarre Problem Involving EuSQL
- Posted by cklester <cklester at yahoo.com> Sep 12, 2005
- 522 views
Instead of being able to use this:
data = {1,"Name","Text","12.12.2004","12:15",2,1} sql = sprintf("SELECT COUNT(*) FROM ENTRIES WHERE (JOURNAL_ID=%d) AND (ENTRY_NAME='%s') AND (ENTRY_TEXT='%s') AND (ENTRY_DATE='%s') AND (ENTRY_TIME='%s') AND (AUTHOR_ID=%d) AND (PRAYER_ID=%d)",data)
(the above kept saying "not enough values for sprintf), I had to use this:
sql = "SELECT COUNT(*) FROM ENTRIES WHERE (JOURNAL_ID=" & sprintf("%d",{data[1]}) & ") " sql &= "AND (ENTRY_NAME='" & data[2] & "') AND (ENTRY_TEXT='" & data[3] & "') " sql &= "AND (ENTRY_DATE='" & data[4] & "') AND (ENTRY_TIME='" & data[5] & "') AND (AUTHOR_ID=" & sprintf("%d",{data[6]}) & ") AND (PRAYER_ID=" & sprintf("%d",{data[7]}) & ")"
-=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/