Re: [sqlite] enforcing Foreign Keys

2007-01-25 Thread Dan McDaniel
Can someone tell me how to unsubscribe. I have sent
two messages to the link and have had no luck thank 
you.
--- Mag Gam <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
> I am new to sqlite, and liking it a lot so far. My
> only problem is there is
> no native foreign key/data integrity. Are there
> plans to include FKs in
> future releases? I have been reading,
>
http://www.rcs-comp.com/site/index.php/view/Utilities-SQLite_foreign_key_trigger_generator
> 
> But this is very tedious. Any anyone know an easier
> way? I am thinking more
> like postgresql's FKs
> 



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Thanks Alexander

2005-11-12 Thread Dan McDaniel
Yes!
This works Thanks very much Alexander.

--- Alexander Kozlovsky <[EMAIL PROTECTED]>
wrote:

> The second parameter of cursor.execute() accept
> **sequence** of
> bindings. Try this:
> 
>  c.execute(toDo, [s1])
>  
> 
> > from pysqlite2 import dbapi2 as sqlite
> > 
> > con = sqlite.connect("mydb.db")
> > c = con.cursor()
> > 
> > s1 =3
> > toDo ="Update ex set amount = ? where ex_id = 1"
> > c.execute(toDo,s1)
> > con.commit()
> > c.close()
> > 
> > 
> > Can anyone help?
>   
> 
> Best regards,
>  Alexander   
> mailto:[EMAIL PROTECTED]
> 
> 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


Re: [sqlite] qmark style updates

2005-11-11 Thread Dan McDaniel
Thanks for the suggestion. It did not help however.
My code is modified from the code that I found at the
following web site:
http://initd.org/tracker/pysqlite/wiki/basicintro
The difference is that the examples on the above
website use the x =raw_input =('enter a value) syntax

I tried this to and got some strange behavior, like if
I entered a value like "333" it would give me a
similar error message, counting out the number
individual tokens as the number of values supplied in
the error message. Only when I entered a single
character at the raw input prompt could I get it to
work.

What I am really trying to do is find a
straightforward way to update a datetime.date field of
a data base.

I will continue to search for an  answer. Any help
will be appreciated.

again thanks for your response.
Dan

--- Jay Sprenkle <[EMAIL PROTECTED]> wrote:

> the question mark is the indicator for a bound
> value.
> Escape it, I think like this
> > toDo ="Update ex set amount = '?' where ex_id = 1"
> or
> > toDo ="Update ex set amount = '\?' where ex_id =
> 1"
> 
> On 11/11/05, Dan McDaniel <[EMAIL PROTECTED]>
> wrote:
> > I am trying following a simple example shown in
> one of
> > the online tutorials on pysqlite.
> > The example shows how to input a value using
> qmarks in
> > the statement. I am getting an error message
> > like"Incorrect number of bindings supplied. The
> > current statement uses 1, and there are -1
> supplied."
> > my code is:
> >
> > from pysqlite2 import dbapi2 as sqlite
> >
> > con = sqlite.connect("mydb.db")
> > c = con.cursor()
> >
> > s1 =3
> > toDo ="Update ex set amount = ? where ex_id = 1"
> > c.execute(toDo,s1)
> > con.commit()
> > c.close()
> >
> >
> > Can anyone help?
> >
> > Dan
> >
> >
> >
> >
> > __
> > Yahoo! Mail - PC Magazine Editors' Choice 2005
> > http://mail.yahoo.com
> >
> 
> 
> --
> ---
> The Castles of Dereth Calendar: a tour of the art
> and architecture of
> Asheron's Call
> http://www.lulu.com/content/77264
> 




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


[sqlite] qmark style updates

2005-11-11 Thread Dan McDaniel
I am trying following a simple example shown in one of
the online tutorials on pysqlite. 
The example shows how to input a value using qmarks in
the statement. I am getting an error message
like"Incorrect number of bindings supplied. The
current statement uses 1, and there are -1 supplied."
my code is:

from pysqlite2 import dbapi2 as sqlite

con = sqlite.connect("mydb.db")
c = con.cursor()

s1 =3
toDo ="Update ex set amount = ? where ex_id = 1"
c.execute(toDo,s1)
con.commit()
c.close()


Can anyone help?

Dan




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


[sqlite] Figured out my autoincrement problem

2005-11-04 Thread Dan McDaniel
I originally had the "NULL" value as the first item in
the each row of newitems. I moved it down to the
values list as shown below and it works. thanks to all
who thought about this 'problem' with me.




newitems = (
(32,2,20,0,0,0),
(34,2,20,0,0,0)
  
   )

for items in newitems:
cur.execute("insert into budgets (budget_id,
cost_id, project_id, original_budget, \
revised_budget,committed,actual_spent) \
values (NULL, ?,?,?,?,?,?)", items)




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


[sqlite] can' t get autoincrement to work

2005-11-04 Thread Dan McDaniel
I have not been able to get autoincrement to work. I
downloaded latest version several days ago to home and
office machine. Can not get it to work on either.
Please help.
dan



__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com