Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Using format specifiers for extracting data from sqlite database file

1 Ansicht (letzte 30 Tage)
Sushanth Manchikatla
Sushanth Manchikatla am 1 Aug. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
In the given code snippet, what should be done at the "?" to get the details mentioned in the query from a table BIO in the database file database.db?
I need to place name (John) at the question mark. What should be done to get the result?
(No element in the database table is NULL)
con = sqlite('database.db');
name = "John";
sqlquery = "SELECT AGE,EMAIL,EDUCATION FROM BIO WHERE NAME == ?";
result = fetch(con,sqlquery);

Antworten (1)

Jalaj Gambhir
Jalaj Gambhir am 25 Aug. 2020
Bearbeitet: Jalaj Gambhir am 25 Aug. 2020
Hi,
Have a look at the answer here. You have to create a string using square brackets to concatenate the variable with the remaining query.
Hope this helps!

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by