New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Comments
I have loaded a custom function TESTFUNC
and used db.exec()
to execute a SQL query using it.
I have an exception on this line, which is basically the only line I have using the API after loading the func.
index.js:9
db.exec(«SELECT TESTFUNC(‘CREATE TABLE foo(bar TEXT)'»);
incomplete input
SqliteError: incomplete input
at /home/nasa/sql1te/compiledshit/myapp/routes/index.js:9:8
at Layer.handle [as handle_request] (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/layer.js:95:5)
at next (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/layer.js:95:5)
at /home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/index.js:335:12)
at next (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/index.js:174:3)
at router (/home/nasa/sql1te/compiledshit/myapp/node_modules/express/lib/router/index.js:47:12)
What’s the right syntax to execute any SQL query? Is it db.exec?
Yeah that’s the right syntax. I don’t know why you’re getting an incomplete input
error, but even if you somehow avoided that error, you’d get an error saying This database connection is busy executing a query
, unless TESTFUNC
executes the SQL on a different database connection.
Why would I receive that other error?
TESTFUNC is basically a eval() function?
Is my error related to quotes syntax or something?
I can perfectly execute it on sqlite3 shell.
through load_extension too, like you have to load a shared lib.
.loadExtension on your api that’s what Im using to load TESTFUNC
Ahhh I see. My guess is that there’s some assumption that the extension is making, which better-sqlite3
doesn’t abide by. But without knowing the extension, it’s impossible to debug.
Is that a feature you implemented yourself to verify the extension? If so, there’s a quick way to disallow that feature so that we can see if that’s the problem?
There’s no special logic behind db.loadExtension()
. It’s a minimalistic wrapper that simply executes the underling sqlite3 C API.
This is my TESTFUNC — https://dpaste.org/uBt8
It doesn’t do anything too fancy. You can even create an extension yourself to do whatever and you might go through the same error.
I believe the quotes on the query are breaking the SQL somehow?
Please try load an extension yourself. Im not sure if I need to register the function as said in custom function
api?
That’s all that I have:
const Database = require('better-sqlite3');
const db = new Database('foobar.db', {verbose: console.log});
db.loadExtension('./myfunc3');
db.exec("SELECT TESTFUNC('CREATE TABLE foo(bar TEXT)'");
I do not know what that error Incomplete input is about.
I honestly think is an issue with the double quotes» » and then the inner ‘
Any other way I can format this?
um, to me, that query simply misses closing «)» parentneses
doh! I can’t believe I didn’t see that. @wizzard0 is right.
Содержание
- Sql logic error incomplete input
- Вопрос
- SqliteException: SQLite Error 1: ‘incomplete input’.
- Все ответы
- I am getting (sqlite3.OperationalError: incomplete input) error in Python
- Answer by Braylee Hughes
- Answer by Giovanna Howard
- Answer by Cash Stevenson
- Answer by Ethan Wilkinson
- Answer by Zachary Vazquez
- ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input #38066
- Comments
- Steps to reproduce
- Expected behavior
- Actual behavior
- System configuration
- ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input #38066
- Comments
- Steps to reproduce
- Expected behavior
- Actual behavior
- System configuration
Sql logic error incomplete input
Вопрос
SqliteException: SQLite Error 1: ‘incomplete input’.
This error on the phrase
using (SqliteDataReader dr = com.ExecuteReader())
Now this exact code worked on another MVC view page and i’m clueless. Im new so I do not know what else information to give you.
Im using mac OS
Все ответы
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
—————————-
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page
Although you might get lucky here, this forum is for Microsoft SQL Server Express Edition. SqlLite is an entirely different product.
Источник
I am getting (sqlite3.OperationalError: incomplete input) error in Python
Answer by Braylee Hughes
This is the error I am getting:, Electrical reason for the minimum altitude (-50 feet) in the computer specs? ,Asking for help, clarification, or responding to other answers.,Traceback (most recent call last): File «/Users/My Documents/Independent Learning/BBA Coding Related Work/Creating a Database with SQLite3 for Python/MarketCo1.py», line 89, in »’); sqlite3.OperationalError: incomplete input
You are missing a closing brace, as mentioned by glibdud in the comments:
Answer by Giovanna Howard
What’s the right syntax to execute any SQL query? Is it db.exec?,I have loaded a custom function TESTFUNC and used db.exec() to execute a SQL query using it. I have an exception on this line, which is basically the only line I have using the API after loading the func.,@baptistapedro I was under the assumption that TESTFUNC was a custom function. How can you execute a custom function from the sqlite3 shell?,Please try load an extension yourself. Im not sure if I need to register the function as said in custom function api? That’s all that I have:
Answer by Cash Stevenson
These are the two lines where the error is shown I did read an answer here on stackoverflow but the error wasnt rectified., Save my name, email, and website in this browser for the next time I comment.,Your email address will not be published. Required fields are marked *
Answer by Ethan Wilkinson
Answer by Zachary Vazquez
What is it that I am getting wrong? The following is the code:,I am fairly new to python and am writing a code to read imagery and insert them into an SQLite database but I get the following error ,First, the name index is reserved by SQLite ( SQLite: create Index ). ,Connect and share knowledge within a single location that is structured and easy to search.
It’s not %s in your SQL prepared statements, it’s ? .
Источник
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input #38066
Hi everyone,
I did setup a fresh rails project (—api)
Rails 5.2.4
wrote some routes,
wrote some assert_routing tests,
everything was fine.
generated a model «releases»
all tests immediately did fail with:
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input: INSERT INTO «releases»
The culprit was fixtures/releases.yml
When I removed that file, that error messages vanished.
I’d like to suggest to improve the error messages of running «rails test»
to make it more easy to diagnose the root causes of the problems.
My error message must have come from deep down of the sqlite adapter as an exception.
But it was triggered from some rails code working with fixtures.
I’d suggest to catch exceptions and wrap them,
so to annotate where they where invoked from.
the breaking fixture was:
one: <>
two: <>
I never needed fixtures, yet.
I don’t even know what they are good for, yet.
So why was that code generated in the first place?
to only break my workflow and all my tests?
Again, that bad thing for me was the error message:
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input
I’m sure we can improve on that.
Let’s make it a test case first,
so that we can reliabably trigger that error message again.
I have to go on,
my workaround was to delete the fixtures/ file
Steps to reproduce
generate a fresh rails project
cz
generate a model
(obviously some of my intermediate steps which I can not yet reproduce made this fails)
x
Expected behavior
Actual behavior
System configuration
Rails version:
Ruby version:
The text was updated successfully, but these errors were encountered:
Источник
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input #38066
Hi everyone,
I did setup a fresh rails project (—api)
Rails 5.2.4
wrote some routes,
wrote some assert_routing tests,
everything was fine.
generated a model «releases»
all tests immediately did fail with:
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input: INSERT INTO «releases»
The culprit was fixtures/releases.yml
When I removed that file, that error messages vanished.
I’d like to suggest to improve the error messages of running «rails test»
to make it more easy to diagnose the root causes of the problems.
My error message must have come from deep down of the sqlite adapter as an exception.
But it was triggered from some rails code working with fixtures.
I’d suggest to catch exceptions and wrap them,
so to annotate where they where invoked from.
the breaking fixture was:
one: <>
two: <>
I never needed fixtures, yet.
I don’t even know what they are good for, yet.
So why was that code generated in the first place?
to only break my workflow and all my tests?
Again, that bad thing for me was the error message:
ActiveRecord::StatementInvalid: SQLite3::SQLException: incomplete input
I’m sure we can improve on that.
Let’s make it a test case first,
so that we can reliabably trigger that error message again.
I have to go on,
my workaround was to delete the fixtures/ file
Steps to reproduce
generate a fresh rails project
cz
generate a model
(obviously some of my intermediate steps which I can not yet reproduce made this fails)
x
Expected behavior
Actual behavior
System configuration
Rails version:
Ruby version:
The text was updated successfully, but these errors were encountered:
Источник
Sql logic error incomplete input
Вопрос
SqliteException: SQLite Error 1: ‘incomplete input’.
This error on the phrase
using (SqliteDataReader dr = com.ExecuteReader())
Now this exact code worked on another MVC view page and i’m clueless. Im new so I do not know what else information to give you.
Im using mac OS
Все ответы
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
—————————-
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page
Although you might get lucky here, this forum is for Microsoft SQL Server Express Edition. SqlLite is an entirely different product.
Источник
SQLite error: incomplete input #333
Comments
baptistapedro commented Dec 19, 2019
I have loaded a custom function TESTFUNC and used db.exec() to execute a SQL query using it.
I have an exception on this line, which is basically the only line I have using the API after loading the func.
index.js:9
db.exec(«SELECT TESTFUNC(‘CREATE TABLE foo(bar TEXT)’»);
The text was updated successfully, but these errors were encountered:
baptistapedro commented Dec 19, 2019
What’s the right syntax to execute any SQL query? Is it db.exec?
JoshuaWise commented Dec 19, 2019
Yeah that’s the right syntax. I don’t know why you’re getting an incomplete input error, but even if you somehow avoided that error, you’d get an error saying This database connection is busy executing a query , unless TESTFUNC executes the SQL on a different database connection.
baptistapedro commented Dec 19, 2019
Why would I receive that other error?
TESTFUNC is basically a eval() function?
Is my error related to quotes syntax or something?
I can perfectly execute it on sqlite3 shell.
JoshuaWise commented Dec 19, 2019
@baptistapedro I was under the assumption that TESTFUNC was a custom function. How can you execute a custom function from the sqlite3 shell?
baptistapedro commented Dec 19, 2019
through load_extension too, like you have to load a shared lib.
baptistapedro commented Dec 19, 2019
.loadExtension on your api that’s what Im using to load TESTFUNC
JoshuaWise commented Dec 19, 2019
Ahhh I see. My guess is that there’s some assumption that the extension is making, which better-sqlite3 doesn’t abide by. But without knowing the extension, it’s impossible to debug.
baptistapedro commented Dec 19, 2019
Is that a feature you implemented yourself to verify the extension? If so, there’s a quick way to disallow that feature so that we can see if that’s the problem?
JoshuaWise commented Dec 19, 2019
There’s no special logic behind db.loadExtension() . It’s a minimalistic wrapper that simply executes the underling sqlite3 C API.
baptistapedro commented Dec 19, 2019
This is my TESTFUNC — https://dpaste.org/uBt8
It doesn’t do anything too fancy. You can even create an extension yourself to do whatever and you might go through the same error.
I believe the quotes on the query are breaking the SQL somehow?
baptistapedro commented Dec 19, 2019
Please try load an extension yourself. Im not sure if I need to register the function as said in custom function api?
That’s all that I have:
I do not know what that error Incomplete input is about.
baptistapedro commented Dec 19, 2019
I honestly think is an issue with the double quotes» » and then the inner ‘
Any other way I can format this?
wizzard0 commented Jan 7, 2020
um, to me, that query simply misses closing «)» parentneses
JoshuaWise commented Jan 7, 2020
doh! I can’t believe I didn’t see that. @wizzard0 is right.
Footer
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
I am getting (sqlite3.OperationalError: incomplete input) error in Python
Answer by Braylee Hughes
This is the error I am getting:, Electrical reason for the minimum altitude (-50 feet) in the computer specs? ,Asking for help, clarification, or responding to other answers.,Traceback (most recent call last): File «/Users/My Documents/Independent Learning/BBA Coding Related Work/Creating a Database with SQLite3 for Python/MarketCo1.py», line 89, in »’); sqlite3.OperationalError: incomplete input
You are missing a closing brace, as mentioned by glibdud in the comments:
Answer by Giovanna Howard
What’s the right syntax to execute any SQL query? Is it db.exec?,I have loaded a custom function TESTFUNC and used db.exec() to execute a SQL query using it. I have an exception on this line, which is basically the only line I have using the API after loading the func.,@baptistapedro I was under the assumption that TESTFUNC was a custom function. How can you execute a custom function from the sqlite3 shell?,Please try load an extension yourself. Im not sure if I need to register the function as said in custom function api? That’s all that I have:
Answer by Cash Stevenson
These are the two lines where the error is shown I did read an answer here on stackoverflow but the error wasnt rectified., Save my name, email, and website in this browser for the next time I comment.,Your email address will not be published. Required fields are marked *
Answer by Ethan Wilkinson
Answer by Zachary Vazquez
What is it that I am getting wrong? The following is the code:,I am fairly new to python and am writing a code to read imagery and insert them into an SQLite database but I get the following error ,First, the name index is reserved by SQLite ( SQLite: create Index ). ,Connect and share knowledge within a single location that is structured and easy to search.
It’s not %s in your SQL prepared statements, it’s ? .
Источник
[Solved] sqlite3.OperationalError: incomplete input on my code
Stephen Martinez
Guest
Stephen Martinez Asks: sqlite3.OperationalError: incomplete input on my code
Can someone help me understand what’s incomplete about my code, no matter what I try I keep getting the sqlite3.OperationalError: incomplete input. My code is
The line that sublime is referring to is the one I’ve drawn an arrow to, if anyone could help that would be great!
Unreplied Threads
NLP vs Keyword-Search. which one is the best?
- Lakshitha Samod
- 27 minutes ago
- Computer Science
- Replies: 0
Lakshitha Samod Asks: NLP vs Keyword-Search. which one is the best?
I have constructed a natural language processing (NLP) model with the aim of identifying technology keywords within text. The model is trained on a large dataset that contains over 400,000 phrases and has been annotated with approximately 1000 technology keywords, of which only the keywords that I provided in the dataset, can be identified. The annotations within the training dataset include specific locations of technology keywords in the phrases, like for example in the below example, the technology keyword «php» is located at positions 0-3 and 43-46.
An alternative very simple approach that I considered is to manually search for the technology keywords within the text, by using a set of predefined keywords and checking the text in a loop. However, I am wondering of which approach would be more efficient and effective. Given the large dataset and a vast number of keywords, I wonder which of these two methods would yield the best results and would be more appropriate.
Encoder-Decoder performance time
- Sabrina
- 27 minutes ago
- Computer Science
- Replies: 0
Sabrina Asks: Encoder-Decoder performance time
I have two encoder-decoder models.
When I check the performance of the models I get approximately the same performance time (First model
42 sec, Second model
40 sec). I train my model on GPU and check performance on CPU. I test it only on one large image where the size is 12348×12348. I was expecting the larger model that has more parameters to train (second model) to give me longer run time. Anyone can help me to understand why it is not the case here? Am I doing something wrong?
[Solved] How GEE align pixels and projection when reduce resolution?
- hydro9
- 27 minutes ago
- Geography
- Replies: 0
424, larger than the theoretical value. When implemented in arcgis, the sum zonal statistics returns 272
289, which makes more sense considering the actual MODIS pixel size is
What is ds=dr/cos(theta)
- user355484
- 27 minutes ago
- Physics
- Replies: 0
user355484 Asks: What is ds=dr/cos(theta)
I am currently learning about work applied to moving charges closer and have been able to follow so far, but towards the end of the section I was confronted by —Fds, ds=dr/cos(theta) and Fds=Fdr and I am unsure what ds is referring to. For reference, I am using «Electricity and Magnetism 3rd Edition» by Purcell and Morin
What’s happening to the potential energy of electrons after they left battery?
- nam ko
- 27 minutes ago
- Physics
- Replies: 0
nam ko Asks: What’s happening to the potential energy of electrons after they left battery?
friends. I am new in the electrical field so I must show my guided point of sides that related to my question before I ask it, for understanding how I think. first, let’s begin with the battery, I learned that after chemical interactions the battery will produce electrons so these electrons will be get accumulated in the same wherein negative terminal of the battery so after that and because they have the same charge so, therefore, they will get energy(electric potential energy ) because that the charged particle they will get electric potential energy if they are in electric field that produced by other charged particle so because the electrons are accumulated then they will get a lot of electric potential energy because they are in an electric field that created by other electrons at the same place so they will try to use this energy to push other electrons and so electrons will use this energy to push other electrons to the circuit but after they do this I heard that electric potential energy will convert to the kinetic energy but how this will work because (the kinetic energy=mass0.5velocity^2) and because these electrons have constant drift velocity. and its thermal velocity is affected by the thermal energy of the substance nor the voltage. so haw the electric potential energy will convert to the kinetic energy and there is the velocity of electrons is not changing cause voltage and the velocity of electrons are called by the thermal velocity that caused by the thermal energy nor the voltage so what happens to this electric potential energy?
I learned that the speed of electrons is very high but are random and we call it thermal velocity because it is caused by thermal energy(temperature of material) and is affected by temperature
also drift velocity is just moving electrons(electrons are moving randomly and the electric field are push them but the electrons still in random motion) toward the positive terminal(depending on the electric field). so the electrons are in random motions and because the electric field makes them go toward the positive terminal and the moving electrons toward positive we call it drift velocity and it is constant
now, what happens to these electrons’ electric potential energy after they leave the battery? it is converted to kinetic energy but how and the speed of electrons isn’t depending on the voltage(thermal velocity..)
does it remain electric potential energy because of the other electrons in the conductor? but after the electrons go through the loads then they lost the energy and there are still electrons in a conductor because there are electrons there and I mentioned that if a charged particle is in the electric field of another charged particle then it has electric potential energy but here they lost the energy and the electric field still here
sorry for my English(I am not English). I searched a lot about this but I didn’t get anything. I hope u understand what I am meaning also there are many things in my head but I can’t translate them to English because there is no translation yet for my native language
Источник
Sql Logic Error Incomplete Input Best Recipes
Recently Recipes
Cute chocolate «cauldrons» hold a cool, creamy orange-flavored yogurt in this recipe. The unfilled cups.
Provided by Taste of Home
Provided by Catherine McCord
This is my technique for veal demi-glace, and there’s not much to it. I’m going for a pure veal stock.
Provided by Chef John
OMG. I had to make this cake this past Sunday for my Mary Kay party.. It was a huge hit. It was also.
Provided by vicky hunt
Good food doesn’t always have to cost a fortune! Your family will love this. Full of flavor and easy.
Provided by Melissa Baldan
This is a very good potato dish , I stem baby red potatoes and smother them in real butter and parsley.
Provided by Karla Everett
Provided by á-174942
Try this Instant Pot®-friendly variation of a traditional bean stew from the Portuguese region of Azores.
Provided by Ryan C Mathews
Provided by Florence Fabricant
A unique twist on a classic white chocolate fudge recipe! While quick and easy to prepare, Bruce’s®.
Provided by Bruce’s Yams
Sure you can make a quick Chicken Pot Pie using already made pie crust, canned soups, vegetables and.
Provided by Julia Ferguson
This delicious red velvet pound cake is the perfect combination of flavors. Make sure the cake has cooled.
Provided by Taste of Home
Dis is da toe curlin Texicajun hybrid of a classic dish. This will put a smile on everyone’s face that’s.
Provided by Lupe Boudreaux
Provided by Kemp Minifie
This is a tender and delicious baked pork chop recipe, with an Italian flair.
Источник
Hello, I am new to SQLite3 and I wanted help with an error I am getting. When I run the gui I made, I get an error that says:
c.execute(‘SELECT * FROM Info WHERE oid = ‘ + variable)
sqlite3.OperationalError: incomplete input
I was following a tutorial on youtube, while also using classes to access the other frames. When I try to get the information from the database by having the user input what id they are, I get an error. I would appreciate the help as this stuff is really new to me and I would like to understand why I got this error.
Here is my code:
import tkinter as tk
from tkinter import font as tkfont
import sqlite3
with sqlite3.connect('user_info.db') as db:
c = db.cursor()
#c.execute('CREATE TABLE Info(
# Name text,
# Passcode text
# )')
db.commit()
db.close()
class SampleApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
self.title_font = tkfont.Font(family = 'Garamond', size = 18, weight = "bold", slant = "italic")
self.frame_data = {"userID": " ",
"address": " "
}
#container we'll stack frames on top of each other, then the one we want to
#visible will be raised above the others
container = tk.Frame(self)
container.pack(side = "top", fill = "both", expand = "True")
container.grid_rowconfigure(0, weight = 1)
container.grid_columnconfigure(0, weight = 1)
self.frames = {}
for F in (StartPage, Account, EditUser):
page_name = F.__name__
frame = F(parent = container, controller = self)
self.frames[page_name] = frame
#put all of the pages in the same location;
#the one on the top of the stacking order
#will be the one that is visible
frame.grid(row = 0, column = 0, sticky = "nsew")
self.show_frame("StartPage")
def show_frame(self, page_name):
'''Show a frame for the given page name'''
frame = self.frames[page_name]
frame.tkraise()
frame.configure(background = 'teal')
class StartPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
label = tk.Label(self, text = "Sample App", font = controller.title_font)
label.pack(side = "top")
button1 = tk.Button(self, text = "Go to Page One", bg = "green", fg = "white", width = 15, height = 3,
command = lambda: controller.show_frame("PageOne"))
button2 = tk.Button(self, text = "Account",
command = lambda: controller.show_frame("Account"))
height = 4, command = lambda: controller.show_frame("PageTwo"))
Exitbutton = tk.Button(self, text="Exit", width = 8, height = 3, command = self.Exit)
button1.place(x = 200, y = 200)
button2.place(x = 600, y = 200)
Exitbutton.place(x = 350, y = 330)
def Exit(self):
self.controller.destroy()
class Account(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
#Labels
u_name_label = tk.Label(self, text = "Enter User's name")
u_name_label.place(x = 200, y = 200)
p_code_label = tk.Label(self, text = "Enter Passcode")
p_code_label.place(x = 200, y = 300)
#Text Box
self.u_name = tk.Entry(self)
self.u_name.place(x = 350, y = 200)
self.p_code = tk.Entry(self)
self.p_code.place(x = 350, y = 300)
self.userID = tk.Entry(self, textvariable = self.controller.frame_data["userID"])
self.userID.pack()
submit = tk.Button(self, text = "Submit", command = lambda: self.submit())
submit.place(x = 400, y = 350)
show = tk.Button(self, text = "Show Info", command = lambda: self.query())
show.place(x = 300, y = 100)
select = tk.Button(self, text = "Edit User", command = lambda: controller.show_frame("EditUser"))
select.pack()
def submit(self):
with sqlite3.connect('user_info.db') as db:
c = db.cursor()
#insert into table
c.execute("INSERT INTO Info VALUES (:u_name, :p_code)",
{
'u_name': self.u_name.get(),
'p_code': self.p_code.get()
})
#commit changes
db.commit()
#close connection
db.close()
#clear textboxes
self.u_name.delete(0, tk.END)
self.p_code.delete(0, tk.END)
def query(self):
with sqlite3.connect('user_info.db') as db:
c = db.cursor()
c.execute("SELECT *, oid FROM Info")
records = c.fetchall()
#print(records)
#Loop through results
print_records = ''
for record in records:
print_records += str(record[0]) + " " + str(record[1]) + 'n'
query_label = tk.Label(self, text = print_records)
query_label.place(x = 600, y = 200)
db.commit()
db.close()
class EditUser(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
with sqlite3.connect('user_info.db') as db:
c = db.cursor()
variable = self.controller.frame_data["userID"]
#record_id = variable
c.execute('SELECT * FROM Info WHERE oid = ' + variable)
records = c.fetchall()
u_name_label = tk.Label(self, text = "User's name")
u_name_label.place(x = 200, y = 200)
p_code_label = tk.Label(self, text = "User's Passcode")
p_code_label.place(x = 200, y = 300)
self.u_name_edit = tk.Entry(self)
self.u_name_edit.place(x = 350, y = 200)
self.p_code_edit = tk.Entry(self)
self.p_code_edit.place(x = 350, y = 300)
print('Value in Account = %s' % value)
#Loop through results
for record in records:
self.u_name_edit.insert(0, record[0])
self.p_code_edit.insert(0, record[1])
if __name__ == "__main__":
app = SampleApp()
app.title("Sample App")
app.geometry("800x500")
app.mainloop()