Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Using format specifiers for extracting data from sqlite database file
조회 수: 1 (최근 30일)
이전 댓글 표시
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);
댓글 수: 0
답변 (1개)
Jalaj Gambhir
2020년 8월 25일
편집: Jalaj Gambhir
2020년 8월 25일
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!
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!