you may be missing db.commit(). When you do insert, update, etc.. you call commit() to make the changes stick.-skOn 7/28/06, Kent Johnson <
[EMAIL PROTECTED]> wrote:Ron Phillips wrote:> I am trying to write a script that adds data to a table using
> MySQLdb.py. For some reason, "INSERT" seems to w
That was it all right! Thanks, Kent! Ron___Ron Phillips wrote:
> I am trying to write a script that adds data to a table using
> MySQLdb.py. For some reason, "INSERT" seems to work temporarily. I
> run a command to insert a row, and then do a select query, and it's
> there. Aft
Ron Phillips wrote:
> I am trying to write a script that adds data to a table using
> MySQLdb.py. For some reason, "INSERT" seems to work temporarily. I
> run a command to insert a row, and then do a select query, and it's
> there. After the program shuts down, though, it's gone. No rows are
>
I am trying to write a script that adds data to a table using MySQLdb.py. For some reason, "INSERT" seems to work temporarily. I run a command to insert a row, and then do a select query, and it's there. After the program shuts down, though, it's gone. No rows are permanently created. SELECT wor
On 4/15/06, Patty <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a data structure in a python file that looks something like this:
>
> my_map= { "host1": {"target1", "target2", "target3" },
>"host2": {"target4", "target5", "target6" },
> }
>
> I have a method that has two parame
>
> for ahost,target in my_map:
> cursor.execute("""SELECT %s FROM targets
> WHERE target_name in (%s) """ % (ahost, ",".join(target)))
>
Hi again,
I'm confused :-(
I'm using an old version of python (2.3.4). In my database, target_name is the
name of a column, not the name of
Patty wrote:
>I have a data structure in a python file that looks something like this:
>
>my_map= { "host1": {"target1", "target2", "target3" },
> "host2": {"target4", "target5", "target6" },
> }
>
>cursor.execute("""SELECT %s FROM targets
>WHERE target_name = %s """ %
I think you can wrap the select sql command with a function which return a string.this function receive a particular hostname in a string format and return the whole 'SELECT ... FROM.. WHERE' style including the hostname from the function argument.
Cheers,pujoOn 4/14/06, Patty <[EMAIL PROTECTED]> w
Hi,
I have a data structure in a python file that looks something like this:
my_map= { "host1": {"target1", "target2", "target3" },
"host2": {"target4", "target5", "target6" },
}
I have a method that has two parameteres (ahost, atarget), which I want to use
to retrieve dat