Re: Foreign Key Error

2011-02-14 Thread Victor Subervi
gt; -Original Message- > From: Victor Subervi [mailto:victorsube...@gmail.com] > Sent: Monday, February 14, 2011 3:09 PM > To: mysql@lists.mysql.com > Subject: Foreign Key Error > > Hi; > I have this command: > > create table if not exists categoriesRelationships (ID

Foreign Key Error

2011-02-14 Thread Victor Subervi
| NULL|| | Category | varchar(40) | YES | | NULL|| | Parent | varchar(40) | YES | | NULL|| +--+-+--+-+-++ 4 rows in set (0.00 sec) Please advise. TIA, Victor

Too Strange for Words

2010-09-18 Thread Victor Subervi
| no | n/a | ++---+-+--+--++---++--+--+---+ 4 rows in set (0.00 sec) mysql> select p.weight from Passengers p; ++ | weight | ++ | NULL | | NULL | | NULL | |155 | ++ 4 rows in set (0.00 sec) TIA, Victor

Re: Complex Select Query

2010-08-24 Thread Victor Subervi
s *way* too complex for my needs. I just thought I'd make my presentation of data a little cleaner but frankly it ain't worth going through all that learning and experimentation to do it. If there isn't another way I'll just forget about it. Any other suggestions would be n

Complex Select Query

2010-08-24 Thread Victor Subervi
the results such that after stacking the data for all results for a certain category, that the next results to be stacked should be those whose parent = the former category, then move on to the next category, etc. How do I do this? TIA, Victor

Join Problem

2010-08-16 Thread Victor Subervi
---+-++ My goal is to exclude results in which in_service !=1; however, the filter isn't working. Please advise. TIA, Victor

Re: Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
On Thu, Jul 22, 2010 at 9:09 AM, John Daisley wrote: > Sorry, my bad! Must learn to read the whole message!! > > > This can be caused because when a foreign key is created mysql adds an > index key to the column in addition to the foreign key. Why I'm not sure, > but I'm guessing its for performan

Re: Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
e. How? TIA, V > > Regards > > John Daisley > > Microsoft SQL Server 2005/2008 Database Administrator > Certified MySQL 5 Database Administrator > Certified MySQL 5 Developer > Cognos BI Developer > > Telephone: +44 (0)7918 621621 > Email: john.dais...@butterflysyste

Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
) | NO | | NULL || +---+--+--+-+++ 13 rows in set (0.00 sec) How drop it? TIA, Victor

Creating a Data Dictionary

2010-07-12 Thread Victor Subervi
ke to create the equivalent of an enum in which I could utilize data like that. Of course, I could lump the whole key-value pairs into one data and create an enum like that, then parse them later. I'm just wondering if there's a more elegant way to do this. TIA, Victor

Re: Two Primary Keys

2010-06-29 Thread Victor Subervi
2010/6/29 João Cândido de Souza Neto > I think the best, or may be the right way is to use picture_id as primary > key and a unique index to product_sku. > Yes, sounds good. So the purpose, then, is to speed lookups on fields commonly accessed. I'd forgotten that. Thanks, V

Re: Two Primary Keys

2010-06-29 Thread Victor Subervi
2010/6/29 João Cândido de Souza Neto > As far as I know, if you have an auto_increment primary key, you cant have > any other field in its primary key. > Makes sense. Actually, I was just copying what someone else gave me and adding the auto_increment, then I got to wondering, what is the purp

Two Primary Keys

2010-06-29 Thread Victor Subervi
n two fields. How do? TIA, Victor

Re: Foreign Key Problem

2010-06-22 Thread Victor Subervi
On Tue, Jun 22, 2010 at 11:53 AM, jayabharath wrote: > Hi Victor, > > The actual problem is with the key field. > > Flights.pilot_id is set to INT NOT NULL and you had specified Pilots.id to > INT NULL. > > You have to change both the columns to NULL or else NOT N

Re: Foreign Key Problem

2010-06-22 Thread Victor Subervi
Problem solved. I tried everything that *should* have worked and didn't. Then I just wiped the test database and started with everything *fixed* (all engine=innodb, all keys of same type, etc.) and it all worked. V

Foreign Key Problem

2010-06-22 Thread Victor Subervi
| int(11) | NO | | NULL|| +-+-+--+-+-++ 5 rows in set (0.00 sec) Please advise how to alter Flights to take the foreign key. TIA, Victor

Re: Foreign Key Problem

2010-05-22 Thread Victor Subervi
This is just for the sake of future googlers of this thread. The correct mysql command is: ursor.execute('create table if not exists Passengers (id int(11) auto_increment primary key, flights_id int(11) not null, customer_id int(11) not null, foreign key (flights_id) references Flights (id), forei

Re: Another Foreign Key Problem

2010-05-21 Thread Victor Subervi
I'm canceling this thread. It belongs in the Python list. Sorry! V On Fri, May 21, 2010 at 1:24 PM, Victor Subervi wrote: > Hi; > When I try to execute this code from my Python script, I get this error: > > Traceback (most recent call last): > File > "/var/www/

Another Foreign Key Problem

2010-05-21 Thread Victor Subervi
light/Baggage`, CONSTRAINT `Baggage_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `Customers` (`id`))') However, when I try from the MySQL prompt after duly printing it out from the code, it works. Why? TIA, Victor

Re: Foreign Key Problem

2010-05-20 Thread Victor Subervi
On Wed, May 19, 2010 at 12:02 PM, Shawn Green wrote: > Victor Subervi wrote: > >> On Wed, May 19, 2010 at 10:59 AM, Shawn Green > >wrote: >> >> Shawn Green wrote: >> >> > look again closely at your FK definitions. The pattern should be >>

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Wed, May 19, 2010 at 10:59 AM, Shawn Green wrote: > Shawn Green wrote: > > AH! that's your mistake. You think that creating the FK will also create > the column. That does not happen. You have to define the table completely > before you can associate the columns on this table (the child table)

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Tue, May 18, 2010 at 2:23 PM, Shawn Green wrote: > Shawn Green wrote: > I may be confused but how can the ID of the Passengers table be both the ID > of the Flight they are taking and their Customer ID at the same time? > > http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.h

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
On Tue, May 18, 2010 at 1:09 PM, Shawn Green wrote: > Johan De Meersman wrote: > > For additional details about failed FK attempts, check the error details in > the SHOW INNODB STATUS report. > I get this: 100518 10:26:22 Error in foreign key constraint of table seaflight/Passengers: constrain

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
light/Passengers.frm' (errno: 150) So apparently it didn't like my foreign key. Do I need to do something with the table I'm referencing or what? TIA, V > > > On Tue, May 18, 2010 at 3:44 PM, Victor Subervi > wrote: > >> Hi; >> mysql> create table if not

Foreign Key Problem

2010-05-18 Thread Victor Subervi
|| | weight | tinyint(3) | YES | | NULL|| ++--+--+-+-++ 3 rows in set (0.01 sec) So, why didn't the foreign key get created? It exists as a primary key in Customers. Please advise. TIA, Victor

Re: tmp tables

2010-01-15 Thread Victor Subervi
On Thu, Jan 14, 2010 at 1:35 AM, Chris W <4rfv...@cox.net> wrote: > I think the reason the other poster was so harsh is because others have > suggested the right way to do it, if not in a lot of detail, and you have > just argued with them. > I don't recall anyone doing that. I don't recall argui

Re: tmp tables

2010-01-13 Thread Victor Subervi
On Wed, Jan 13, 2010 at 2:33 PM, Johnny Withers wrote: > No one designs a shopping cart system this way. > > http://www.google.com/search?q=shopping+cart+database+table+design > > If you are dead set on this crazy design it doesn't matter if you put the > temp tables in the main database or anothe

Re: tmp tables

2010-01-13 Thread Victor Subervi
On Mon, Jan 11, 2010 at 3:21 PM, mos wrote: > At 09:56 AM 1/11/2010, Johnny Withers wrote: > >> Victor, >> >> The temporary table solution is not a good one. Use a single table and >> store >> each item put into a cart identified by the session ID of the user

Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 11:38 AM, Keith Murphy wrote: > Victor, > > Don't want to butt in, and not trying to be rude, but he gave you advice. > You don't seem inclined to take it. How else can he, or anyone else, help > you? Clearly you don't understand some fund

Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz wrote: > Victor, > > > That strikes me as messy. Each tmp table has as many rows as necessary > for > > the products that are to be bough. To do as you say I would have to > create a > > table with a zillion ro

Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 10:35 AM, Baron Schwartz wrote: > Victor, > > On Sun, Jan 10, 2010 at 1:20 PM, Victor Subervi > wrote: > > Hi; > > I have a shopping cart that will spawn a tmp table for every shopping > cart > > instance. Would it be better to cre

tmp tables

2010-01-10 Thread Victor Subervi
Hi; I have a shopping cart that will spawn a tmp table for every shopping cart instance. Would it be better to create a separate database for these instead of having them in the same database as all the other tables for the shopping cart? TIA, Victor -- The Logos has come to bear http://logos

Re: Another Inserting Multiple Values with Set Problem

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 9:29 AM, Thiyaghu CK wrote: > Hi Victor, > > Take out the double quotes from[ "('Small,Medium,XSmall')", > "('teal_E2725B,black_FF,yellow_9ACD32')"]. Its working fine for me. > > mysql> insert into produ

Re: Another Inserting Multiple Values with Set Problem

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 2:26 AM, Thiyaghu CK wrote: > Hi Victor, > > You have given space after the comma(shown here: ('Small, Medium, > XSmall')). Take out the space and try, it will work. > > Example: > > mysql> insert into products(sizes) values ('Smal

Re: Another Inserting Multiple Values with Set Problem

2010-01-07 Thread Victor Subervi
OK, guys, I'm totally confused: mysql> insert into products (SKU, Category, Name, Title, Description, Price, SortFactor, Availability, OutOfStock, Weight, ShipFlatFee, ShipPercentPrice, ShipPercentWeight, sizes, colorsShadesNumbersShort) values ("prodSKU1", "prodCat1", "name1", "title1", "descr",

Re: Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 2:40 PM, Michael Dykman wrote: > How about you show us the schema for the table so we know what is > defined as what? > Done in last email. > > Also, as the update does succeed, it would be interesting to see what > value actually got stored. After you have accounted for

Re: Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 2:34 PM, Hassan Schroeder wrote: > On Wed, Jan 6, 2010 at 1:25 PM, Victor Subervi > wrote: > > > mysql> update products set SKU="prodSKU2", Category="prodCat1", > > Name="name2", Title="title2", Descripti

Re: Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 2:18 PM, Hassan Schroeder wrote: > On Wed, Jan 6, 2010 at 11:39 AM, Victor Subervi > wrote: > > > Here's my example again. Syntactically correct. From my original post: > > > > update products set SKU="prodSKU2", Category=&

Re: Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 12:14 PM, Michael Dykman wrote: > so you dropped the quotes around the unneccessarily bracketed > expression? It's hard to diagnose when your example isn't even what > you think is syntactically correct. > Here's my example again. Syntactically correct. From my original p

Re: Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
; colorsShadesNumbersShort='aqua:7FFFD4, blue:99, gray:465945, > navy-blue:CC7722, black:FF, maroon:B03060, > purple:50404D,yellow:9ACD32, fuchsia:FF77FF' > where ID="2"; > > watch for the line-wraps in the SET data specifications.. I did both >

Another Inserting Multiple Values with Set Problem

2010-01-06 Thread Victor Subervi
arge', 'XXXLarge')", colorsShadesNumbersShort="('aqua:7FFFD4', 'blue:99', 'gray:465945', 'navy-blue:CC7722', 'black:FF', 'maroon:B03060', 'purple:50404D', 'yellow:9ACD32', 'fuchsia:FF77FF')" where ID="2"; Everything inserts but the sets which throw warnings. What am I missing? TIA, Victor -- The Logos has come to bear http://logos.13gems.com/

Re: How Set Up This Table

2010-01-04 Thread Victor Subervi
On Mon, Jan 4, 2010 at 10:40 AM, Arthur Fuller wrote: > The ProductPackages table is what is known as an associate table, and is > used to implement a many-to-many relationship. You only need it if a given > product can be in multiple packages. If not, then you can eliminate the > associative tabl

Re: How Set Up This Table

2010-01-02 Thread Victor Subervi
On Sat, Jan 2, 2010 at 11:20 AM, Arthur Fuller wrote: > Hi Victor. > > I think that the first thing you need to consider is whether a product can > be in more than one package, and second is whether a package can be in > another package. Also, I don't know why you need to aut

Re: How Set Up This Table

2010-01-02 Thread Victor Subervi
On Sat, Jan 2, 2010 at 12:03 PM, prabhat kumar wrote: > primary key Oh! PK is primary key! > a compound key is a key that consists of 2 or more attributes that uniquely > identify an entity occurrence. Thanks. V

Re: How Set Up This Table

2010-01-02 Thread Victor Subervi
On Sat, Jan 2, 2010 at 11:20 AM, Arthur Fuller wrote: > Hi Victor. > > I think that the first thing you need to consider is whether a product can > be in more than one package, and second is whether a package can be in > another package. Also, I don't know why you need to aut

Re: Inserting Multiple Values with Set

2010-01-01 Thread Victor Subervi
On Fri, Jan 1, 2010 at 4:34 PM, Don Read wrote: > On Fri, 1 Jan 2010 14:34:48 -0500 Victor Subervi said: > > > Hi; > > > > The following insert chokes when I try to insert multiple values from the > > sets: > > > > insert into products (SKU,

Inserting Multiple Values with Set

2010-01-01 Thread Victor Subervi
| +-+--+---+ | Warning | 1265 | Data truncated for column 'colorsShadesNumbersShort' at row 1 | +-+--+---+ 1 row in set (0.00 sec) Please advise. TIA, Victor -- The Logos has come to bear http://logos.13gems.com/

How Set Up This Table

2010-01-01 Thread Victor Subervi
that one association may have 2 products and another 20. What is the best way to MySQL this? TIA, Victor -- The Logos has come to bear http://logos.13gems.com/

Re: last_insert_id

2009-12-27 Thread Victor Subervi
On Sun, Dec 27, 2009 at 1:30 PM, Gary Smith wrote: > Victor Subervi wrote: > >> On Sun, Dec 27, 2009 at 12:00 PM, Michael Dykman >> wrote: >> >> >> >>> last_insert_id() returns the last id auto-incremented in *the current >>> session*. If

Re: last_insert_id

2009-12-27 Thread Victor Subervi
On Sun, Dec 27, 2009 at 12:00 PM, Michael Dykman wrote: > last_insert_id() returns the last id auto-incremented in *the current > session*. If you disconnect and reconnect, it can not be retrieved. > Ahah! So how do I retrieve the last id inserted irrespective of connection? TIA, V

Re: last_insert_id

2009-12-27 Thread Victor Subervi
On Sun, Dec 27, 2009 at 11:27 AM, Mattia Merzi wrote: > 2009/12/27 Victor Subervi : > > mysql> select * from products; > [...] > > mysql> select last_insert_id() from products; > [...] > > Now, I was expecting 1, not 0! What up? > > [...] LAST_INSER

last_insert_id

2009-12-27 Thread Victor Subervi
+ 1 row in set (0.00 sec) mysql> select last_insert_id() from products; +--+ | last_insert_id() | +--+ |0 | +--+ 1 row in set (0.00 sec) mysql> Now, I was expecting 1, not 0! What up? TIA, Victor

Re: Join Statement

2009-12-14 Thread Victor Subervi
On Mon, Dec 14, 2009 at 1:04 PM, Peter Brawley wrote: > ...on t.ProdID-p.ID... _subtracts_ the two IDs. To match them use '=' > rather than '-'. > Thank you for all of you that caught that. V

Re: Join Statement

2009-12-14 Thread Victor Subervi
On Mon, Dec 14, 2009 at 12:37 PM, Peter Brawley wrote: > > ... on t.ProdID-p.ID; > > Your join clause subtracts the two IDs, so it's on IDs that differ, and > apparently there aren't any. > I beg to differ: mysql> select SKU, Quantity, Name, Price, p.sizes, p.colorsShadesNumbersShort from tem1

Join Statement

2009-12-14 Thread Victor Subervi
he above select join statement fails. Please advise. TIA, Victor

Re: Duplicate Entry, But Table Empty!

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 12:21 PM, Pinter Tibor wrote: > Victor Subervi wrote: > >> Hi; >> >> mysql> insert into *tem126072414516* (ProdID, Quantity) values ("2", "2"); >> mysql> select * from *tem126072385457*; >> > > mys

Duplicate Entry, But Table Empty!

2009-12-13 Thread Victor Subervi
|| | Quantity | int(3) unsigned | YES | | NULL|| +--+-+--+-+-++ 3 rows in set (0.00 sec) Please advise. TIA, Victor

Re: inserting sets of data

2009-12-12 Thread Victor Subervi
On Sat, Dec 12, 2009 at 10:58 AM, David Giragosian wrote: > On Sat, Dec 12, 2009 at 9:54 AM, Victor Subervi > wrote: > >> Hi; >> I have a column defined as a set. How do I insert data into that column? >> Please give me an example. >> TIA, >> Victor

inserting sets of data

2009-12-12 Thread Victor Subervi
Hi; I have a column defined as a set. How do I insert data into that column? Please give me an example. TIA, Victor

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 8:43 AM, Johan De Meersman wrote: > On Fri, Dec 11, 2009 at 11:19 AM, Mark Goodge > wrote: > > > Jørn Dahl-Stamnes wrote: > > > >> On Friday 11 December 2009 10:38, Victor Subervi wrote: > >> > >>> Hi; > >&g

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 5:33 AM, wrote: > > On Fri, 11 Dec 2009 05:28:41 -0500, Victor Subervi > > wrote: > > On Fri, Dec 11, 2009 at 5:13 AM, wrote: > > > >> > >> On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi > >> > >>

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 5:13 AM, wrote: > > On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi > > wrote: > > > mysql> update products set sizes="('Small', 'Large')" where > SKU='prodSKU1'; > > Query OK, 0 rows af

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:43 AM, wrote: > > On Fri, 11 Dec 2009 04:38:01 -0500, Victor Subervi > > wrote: > > Hi; > > > > mysql> update products set sizes="('Small', 'Large')" where ID=0; > > Query OK, 0 rows affect

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:48 AM, Jørn Dahl-Stamnes wrote: > On Friday 11 December 2009 10:38, Victor Subervi wrote: > > Hi; > > > > mysql> update products set sizes="('Small', 'Large')" where ID=0; > > Query OK, 0 rows affected, 1 war

Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:48 AM, Jørn Dahl-Stamnes wrote: > On Friday 11 December 2009 10:38, Victor Subervi wrote: > > Hi; > > > > mysql> update products set sizes="('Small', 'Large')" where ID=0; > > Query OK, 0 rows affected, 1 war

Update Doesn't Update!

2009-12-11 Thread Victor Subervi
+--+ | sizes | colorsShadesNumbersShort | +---+--+ | | | +---+--+ 1 row in set (0.00 sec) Huh? TIA, Victor

Re: Second Request: Challenging Select Statement

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 8:08 AM, Tom Worster wrote: > On 12/7/09 5:26 AM, "Victor Subervi" wrote: > > > Hi; > > I posted this Saturday. Perhaps it's too challenging for those who read > it > > to answer. I hope someone can. > > > > I need

Second Request: Challenging Select Statement

2009-12-07 Thread Victor Subervi
ect column_type from information_schema.columns where table_name='products' and column_name='Categories'; will give me the column and its enumerations. How do I supply one of the enumerations from a column 'Categories' and get the ID? TIA, Victor

Re: Select Problem

2009-12-07 Thread Victor Subervi
On Sun, Dec 6, 2009 at 2:42 PM, Steve Edberg wrote: > At 1:26 PM -0500 12/6/09, Victor Subervi wrote: > >> Hi; >> I have the following: >> >> mysql> select * from categoriesProducts as c inner join >> relationshipProducts >> as r on c.ID = r.Child i

Select Problem

2009-12-06 Thread Victor Subervi
ect * from categoriesProducts; ++--++ | ID | Category | Parent | ++--++ | 1 | prodCat1 | None | | 2 | prodCat2 | None | ++--++ 2 rows in set (0.00 sec) So I'm at a loss. No, 'prodCat2' isn't a column, but I don't understand how I specified that in my query. Please advise. TIA, Victor

Re: Auto Increment Problem

2009-12-05 Thread Victor Subervi
Oops. Never mind. V On Sat, Dec 5, 2009 at 1:19 PM, Victor Subervi wrote: > Hi; > > mysql> insert into categories (Category, Parent) values ('test', NULL); > ERROR 1062 (23000): Duplicate entry '0' for

Auto Increment Problem

2009-12-05 Thread Victor Subervi
---+---+ 3 rows in set (0.00 sec) Why the error? TIA, Victor

Challenging Select Statement

2009-12-05 Thread Victor Subervi
ories'; will give me the column and its enumerations. How do I supply one of the enumerations from a column 'Categories' and get the ID? TIA, Victor

Re: Like Syntax

2009-12-05 Thread Victor Subervi
On Sat, Dec 5, 2009 at 11:09 AM, Michael Dykman wrote: > show tables like 'categories%'; > Thanks. V

Like Syntax

2009-12-05 Thread Victor Subervi
Hi; I remember vaguely how to do this but don't know how to google it: show tables like categories$; such that it will return tables such as: categoriesProducts, categoriesPrescriptions, etc. TIA, Victor

Re: Creating Table Through Union

2009-11-22 Thread Victor Subervi
On Sun, Nov 22, 2009 at 9:29 PM, Gavin Towey wrote: > The form would be like: > > CREATE TABLE products > SELECT b0basics, b0fieldValues, s0prescriptions, > s0prescriptions0doctors, s0prescriptions0patient, pics FROM table1 > UNION > SELECT b0basics, b0fieldValues, s0prescriptions, > s0prescripti

Creating Table Through Union

2009-11-22 Thread Victor Subervi
. TIA, Victor

Re: Foreign Keys Problem

2009-11-20 Thread Victor Subervi
On Thu, Nov 19, 2009 at 9:34 PM, Ye Yuan wrote: > Hi Victor, > > It looks to me the foreign key syntax is wrong. Can you create the > Relationship table on your database by using below ddl? > > create table if not exists Relationship > (ID integer auto_increment primary key,

Foreign Keys Problem

2009-11-19 Thread Victor Subervi
eptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign key references categories (ID),\\n Child integer not null foreign key' at line 3") Please advise. TIA, Victor

Re: Grant Privileges Problem

2009-11-09 Thread Victor Subervi
Never mind. Had to add @'localhost' On Mon, Nov 9, 2009 at 4:20 PM, Victor Subervi wrote: > Hi; > I created a user and then granted privileges: > grant all to victor identified by 'pw'; > Looked good. Tried to log in as victor an no go. Please advise. > Victor >

Grant Privileges Problem

2009-11-09 Thread Victor Subervi
Hi; I created a user and then granted privileges: grant all to victor identified by 'pw'; Looked good. Tried to log in as victor an no go. Please advise. Victor

Re: Inserting an Image

2009-10-16 Thread Victor Subervi
and the only differences between them are that the first have the strings in quotes AND there is a % sign between the string widgets and the variables that replace them. That's it! Wonder what the *#&^%( difference that makes. V On Thu, Oct 15, 2009 at 4:54 PM, Michael Dykman wro

Inserting an Image

2009-10-15 Thread Victor Subervi
Kd6áÛã5 3...@„4Òwrœ’n ¤“í¢-º I dEŒÓOJP[î!8SŠ ¨õáA“E P QE H»QÙë Ò ^Œ[bï $0ò‡ Ïq~ â BOy§ª(8®óg¸Øç. Ú#±d ñCƒŸˆ<ˆñ *FûŸ, ŸªÝ»¸Ùò{sGu];U Ð?˾ eH»vü ¦¯å5] ~@'õ§?‚h$Š(¢€¢Š( (¢€¢©U (ªUh (¢ƒÿÙ', '', '', '', '', '', '') MySQL complains about the image in string form. I'm sure the solution is simple, but I don't know what it is. TIA, Victor

Re: No tuples, but AttributeError about tuple!

2009-10-05 Thread Victor Subervi
4, pic5, pic6) values('1', 'name1', > 'title1', 'descr1', '1.1', '2', '1', 'New', '1.5', 'new', 'princesse', > 'princesse', '123 princesse', 'Not furnishe

Re: No tuples, but AttributeError about tuple!

2009-10-05 Thread Victor Subervi
think is the 2 param form of cursor.execute() which > takes a string statement and a tuple of arguments: > > cursor.execute('insert into products values(%s, %s, %s, %s, %s, %s, %s, %s, > %s, > %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' , (id, name, title, > description,

No tuples, but AttributeError about tuple!

2009-10-04 Thread Victor Subervi
, 'New', '1.5', 'new', 'princesse', 'princesse', '123 princesse', 'Not furnished', '', '', '', '', '', ''); which I can enter into the database directly. However, when I try to do it through the script, I get the following error: AttributeError: 'tuple' object has no attribute 'encode' Why is that? There are no tuples here!! Nothing but strings!! TIA, Victor

Re: Another Join Problem

2009-10-02 Thread Victor Subervi
Thanks V On Fri, Oct 2, 2009 at 11:08 AM, Mark Goodge wrote: > Victor Subervi wrote: > >> Hi; >> I get the following error: >> >> *SQL query:* >> >> SELECT ID, Item >> FROM products >> JOIN categories ON categories.ID = products.Category &g

Another Join Problem

2009-10-02 Thread Victor Subervi
Hi; I get the following error: *SQL query:* SELECT ID, Item FROM products JOIN categories ON categories.ID = products.Category LIMIT 0 , 30; *MySQL said:* #1052 - Column 'ID' in field list is ambiguous Please note the error is about ambiguity. "products" has an ID field and so does "categorie

Re: Nested Joins

2009-10-02 Thread Victor Subervi
Thanks! Got it! I was missing the word "from"... select * FROM %s c ... Thanks again ;) V On Thu, Oct 1, 2009 at 5:08 PM, Gavin Towey wrote: > Victor, > > > > Just noticed, the join condition from client to productions should be > changed: > > > > se

Re: Nested Joins

2009-10-01 Thread Victor Subervi
Well, your syntax is *exactly* what I had (with a few cosmetic changes). I've been over the MySQL manual on joins with no luck. I'll read over your resources tonight. Any other ideas would be appreciated. Thanks, V On Thu, Oct 1, 2009 at 4:49 PM, Gavin Towey wrote: > Victor, >

Re: Nested Joins

2009-10-01 Thread Victor Subervi
On Thu, Oct 1, 2009 at 4:03 PM, Gavin Towey wrote: > Joins aren't nested like that, unless you use a subquery. I think you just > need to remove the parens around the second join. > I tried that and no go :( > > For better help: > 1. show the real SQL -- echo the statement. Most people here d

Nested Joins

2009-10-01 Thread Victor Subervi
Hi; I'm new to join statements. Here's my python syntax: cursor.execute('select * from %s left join products on %s.Item=products.Item (left join categories on products.Category=categories.ID);' % (client, client)) I believe it's clear how I want to nest, but I don't know how to repair my syntax

Re: Create Syntax (easy)

2009-09-29 Thread Victor Subervi
That's it! Thanks, V On Tue, Sep 29, 2009 at 12:13 PM, David Giragosian wrote: > On Tue, Sep 29, 2009 at 11:09 AM, Victor Subervi >wrote: > > > Hi; > > Please give me the syntax below such that I can force the insert > statements > > to use only select

Create Syntax (easy)

2009-09-29 Thread Victor Subervi
Hi; Please give me the syntax below such that I can force the insert statements to use only selected values ("item1", "item2", "item3"): create table (field SOMETHING_HERE item1 item2 item3, ... ) TIA, Victor

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
together. Hence the need > for a mysql dump tool ;-) > > Mysql dump is the better way to go in either situation. > > > -Original Message- > > From: Victor Subervi [mailto:victorsube...@gmail.com] > > Sent: Wednesday, September 02, 2009 1:43 PM > > To:

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
t; > > -Original Message- > > From: news [mailto:n...@ger.gmane.org] On Behalf Of Emile van Sebille > > Sent: Wednesday, September 02, 2009 7:18 AM > > To: mysql@lists.mysql.com > > Cc: python-l...@python.org > > Subject: Re: Problem w/ mysqldump > > >

Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
e some way to do the same thing from within MySQL? Can I at least print everything to screen and copy it? Where would I find my database in Windoze? TIA, Victor

Re: Suppressing Warnings

2009-08-31 Thread Victor Subervi
Right. Perhaps you could enlighten me as to what I should code to prevent that warning? It repeats 2,400 times and makes finding the real errors a pain in the behind. Victor On Tue, Aug 25, 2009 at 12:42 AM, peng yao wrote: > Warning: Can't create database 'spreadsheets'

Suppressing Warnings

2009-08-24 Thread Victor Subervi
rsor.execute('use spreadsheets;') Warning: Can't create database 'spreadsheets'; database exists What do? TIA, Victor

Re: Update Syntax

2009-07-26 Thread Victor Subervi
Perfect. Thank you. Victor On Sun, Jul 26, 2009 at 2:18 PM, Darryle Steplight wrote: > Hi Vicor, >Look into INSERT ON DUPLICATE or REPLACE statements. You need to > have a primary key or unique key for these too work. > > On Sun, Jul 26, 2009 at 1:11 PM, Victor Subervi > wr

  1   2   3   4   5   6   7   8   >