Skip to content

Update README.md#1

Open
TheresaSchmidt wants to merge 1 commit intodialogos-project:masterfrom
TheresaSchmidt:master
Open

Update README.md#1
TheresaSchmidt wants to merge 1 commit intodialogos-project:masterfrom
TheresaSchmidt:master

Conversation

@TheresaSchmidt
Copy link

Ich habe zwei weitere Beispiele eingefügt, die den Umgang mit Variablen vom Typ string veranschaulichen.

@timobaumann
Copy link
Contributor

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.
select * from questions where body like 'How many%' limit 1; would make sense in the example domain, with How many being replacable against Which of the following, What, Where, and this choice could come from a DialogOS expression.

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 not in (https://www.w3schools.com/sql/sql_in.asp).

Would you care to draft such an example?

@TheresaSchmidt
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants