python - SQLite: INSERT INTO column inserts at bottom of previous column -


Rows of rows in multiple columns in one row in the most document on the SQL INSERT statement Includes inserting. There is little difference in my workflow that there is no connection between the columns of my table. I am making bulk of each column in this way: when someone is done, I take it to the next column to populate it.

The problem is that I do not know how the INSERT of the second column goes to column2 data to be column1 Adding to the last line of> How do I reset the cursor position to start at the beginning of the column2 ?

Screenshot of table output :

code:

  conn = sqlite3.connect ('testDB.sqlite') C = conn.cursor () c.execute ('Create table when creating table' (column 1 text, column 2 text) ') get get (): c.execute (' table name (column1) values ​​(INSERT) INSERT '(?)', (Data_values,) c.execute ('Table Name (column2) values ​​(INSERT IN-column2) VALUES (?)', (Data_values,))  

The INSERT statements insert a whole line into the table, the null values ​​will be included in any of the inserted columns. It is assuming that the columns in your insert statement can accept zero values. If they are not set to enter you, then throws an error.

For example Table 1 (column1) value ('value1') and I enter in the nsert table 1 (column 1) value ('value 2' ) will do it as below (------ only indicates zero / empty value):

Table1

  column1 column2 value1 ------ ------ value2  

If you want to insert some columns into existing rows, then you get UPDATE Statement should be used. If you use the update as below, instead of putting the second instead, in the above example, it will update the same line.

  update table 1 set column2 = 'value2' where column 1 = 'value1'  

Table 1 < / P>

  column1 column2 value1 value2  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -