Conversation
|
Hi Theresa, thanks for this. Essentially, you're pointing out the need for adding quotes around strings in SQL, right? If there is no string, SQL interprets the characters as a column name. The example so far used a column of int type so the digits need not be (actually: must not be) quoted (and a sequence of digits can't be a column name). I think that indeed we should point out how to pass on quotes to SQL. However, the present fix does not work, for several reasons:
In the example database, there's no answers field and the one there is (correct field) is an int. However, it could probably make sense to have an example that filters the questions for some keyword. E.g. Even better: avoid asking the same question twice by storing the questions that were already asked in a list and then avoiding to re-ask by using Would you care to draft such an example? |
|
Actually I only wanted to point out the thing about the quotes because it caused confusion. I didn't see that the examples were meant to come from the example data base. I might think about more suitable examples when I can spare some time. |
Ich habe zwei weitere Beispiele eingefügt, die den Umgang mit Variablen vom Typ string veranschaulichen.