Back to General discussions forum
Hi team,
I've got the query working correctly against a SQLite DB in my local environment but the answer inserted keeps being incorrect. Any way of validating this? Getting more test data would be nice but also getting the versions of the DB and environment so I can try to replicate what's going on.
Regards
Hi, just checking, are you using substr() or substring() by any chance? There are small differencen between versions of SQLite.
Hi gardengnome,
Thanks for your reply. I am indeed using SUBSTR... Do you think this could cause an issue between versions? Do you know they version we are using in the Abbey?
Not sure about the version.
There is an earlier thread Couple problems on SQL - 244 and 245 that discusses some aspects of the version.
I asked about substring
in particular as that was a problem I had - substr
should work fine.
Hi gardengnome,
Kudos for the info. I already checked that entry but I am using SUBSTR and not SUBSTRING so I don't think it applies to my situation.
I get also the same error for task 245: "Your query is expected to start with SELECT keyword" It does, indeed, start with the "SELECT" keyword capitalized...
Hi Friend!
Your solution for #245 starts with
import sqlite3
from sqlite3 import Error
import os, sys
def create_connection(db_file):
""" create a database connection to the SQLite database
specified by
...
This is not exactly sql and doesn't start with "select" :)
For these problems you need only sent SQL query as solution.
As about versions - yep, the server version of sqlite is somewhat older. Not found good way to update it yet, sorry.
Hi Rodion,
Thanks a lot for your reply. It wasn't clear to me that I needed to put only the SQL in the code snippet reserved for the solution (Not the answer form, as a clarification in case anyone is reading this). With that information I was able to progress and solve 245.
Thanks a lot for your time and have a great weekend! (You too, gardengnome)
I'm still having a tough time figuring out how to submit the answer. Everything works fine on SQL Fiddle, but still getting "wrong answer"/more results than expected.
Hi Friend!
more results than expected.
This probably means that almost all is ok, just your filtering is probably not correct and your select returns, as said, more results than needed.
>.<
I realize now what I did wrong. I failed to read the statement closely enough. My apologies.
Oh, no problem with it :) I guess the error message could be improved to make meaning more clear - shall try to think about it!
I have the same problem I keep getting more results than expected. I read all the post in the forum about the problem. I use substr and everything runs fine on fiddle too and in the webpagge.
I have checked my logic multiple times, re read the stament and more. I can't realice what is wrong I tried my own tests and it works.
:( thank you for reading.