473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PySQLite Table indexing inside a functions

Hello Everyone,

I'm using PySQLite and would like to index this insert
statement with the 'tablename'. Can anyone offer a
suggestion?

Also, this is a shot in the dark. Has anyone done
anything with nested fields. I would like each vertex
to have 3 points. currently, I'm just making 3
fields.

Regards,
Kevin

def PARSE2DB(data,tablename):
i = j = k = 0
cadu = GETdb().cursor()
FacetNum = len(data [1])
while i < FacetNum:
cadu.execute("""
insert into table = 'tablename'( V1_x, V1_y, V1_z,
V2_x, V2_y, V2_z,
V3_x, V3_y, V3_z, N_x, N_y, N_z)
values(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f,
%f, %f)
""",
(data [1][i][1][0][0], data [1][i][1][0][1],data
[1][i][1][0][2],
data [1][i][1][1][0], data [1][i][1][1][1],data
[1][i][1][1][2],
data [1][i][1][2][0], data
[1][i][1][2][1],data [1][i][1][2][2],
data [1][i][0][0], data
[1][i][0][1], data [1][i][0][2])
)
i = i + 1

return


__________________________________
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com
Jul 18 '05 #1
0 839

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: achrist | last post by:
Have hit a problem with PySQLite and python 2.3. The new bool type doesn't want to get written properly to a database. I was expecting this to break when I started using True and False in python...
0
by: Irmen de Jong | last post by:
Hello I'm having some troubles with PySqlite (0.4.3, windows/linux). I want to store unicode strings in the database. So I open a connection with the client_encoding="UTF-8" parameter. When I...
0
by: Kevin | last post by:
Hello Everyone, I'm using PySQLite and would like to index this insert statement with the 'tablename'. Can anyone offer a suggestion? Also, this is a shot in the dark. Has anyone done...
1
by: DurumDara | last post by:
Hi ! I have this code in my program. Before this I use APSW, but that project's connection object doesn't have close method... .... crs.execute(*'''create table files (*f_id integer not null...
1
by: Thomas | last post by:
Hi there! Installing TurboGears out-of-the-box (egg-based) on Windows doesn't work because I can't compile the extensions needed for the required pysqlite (also egg- based): Installed...
14
by: Nader Emami | last post by:
I have installed "TurboGears" and I would install 'pysqlite' also. I am a user on a Linux machine. If I try to install the 'pysqlite' with 'easy_install' tool I get the next error message. The...
3
by: rustyhowell | last post by:
I'm trying to store binary data in a sqlite database and call into the db using pysqlite 3. What I've got so far is this: import sqlite con = sqlite.connect(DB_PATH) cur = con.cursor() query...
5
by: =?ISO-8859-1?Q?Gerhard_H=E4ring?= | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 pysqlite 2.5.0 released ======================= I'm pleased to announce the availability of pysqlite 2.5.0. This is a release with major new...
4
by: Tilman Kispersky | last post by:
I am trying to install sqlite for use with python on cygwin. I have installed the sqlite packages from cygwin (that is libsqlite3-devel and libsqlite3_0). When attempting to easy_install pysqlite...
4
by: Astley Le Jasper | last post by:
I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.