From: Joe Riopel on
On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi <victorsubervi(a)gmail.com> wrote:
> Hi;
> I have this code snippet:
>
>     sql '''create table if not exists %sCustomerData (

I think you may have forgotten the "=" after sql.
From: Chris Rebert on
On Mon, Jan 4, 2010 at 9:28 AM, Victor Subervi <victorsubervi(a)gmail.com> wrote:
> Hi;
> I have this code snippet:
>
>     sql '''create table if not exists %sCustomerData (

You're missing an equal sign there to start with (i.e. sql = ''').

Cheers,
Chris
--
http://blog.rebertia.com
From: MRAB on
Victor Subervi wrote:
> Hi;
> I have this code snippet:
>
> sql '''create table if not exists %sCustomerData (
> ID tinyint(8) unsigned primary key auto_increment,
> Email varchar(120) not null,
> PhoneNumber varchar(20) not null,
> BillingName varchar(80) not null,
> BillingAddress1 varchar(100) not null,
> BillingAddress2 varchar(100) null,
> BillingCity varchar(50) not null,
> BillingState varchar(2) not null,
> BillingPostalCode varchar(8) not null,
> ShippingName varchar(80) not null,
> ShippingAddress1 varchar(100) not null,
> ShippingAddress2 varchar(100) null,
> ShippingCity varchar(50) not null,
> ShippingState varchar(2) not null,
> ShippingPostalCode varchar(8) not null,
> TypeOfCard set("VISA", "MasterCard", "AmEx", "Discover", "PayPal")
> null,
> CreditCardNumber tinyint(8) unsigned null,
> CreditCardExpMonth tinyint(2) unsigned null,
> CreditCardExpYear tinyint(4) unsigned null
> );''' % store
>
> It throws this error:
>
> [Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] File
> "/var/www/html/angrynates.com/cart/cart2.py
> <http://angrynates.com/cart/cart2.py>", line 62, referer:
> http://angrynates.com/cart/cart.py
> [Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] );''' %
> store, referer: http://angrynates.com/cart/cart.py
> [Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] ^,
> referer: http://angrynates.com/cart/cart.py
> [Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] SyntaxError:
> invalid syntax, referer: http://angrynates.com/cart/cart.py
> [Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] Premature end of
> script headers: cart2.py, referer: http://angrynates.com/cart/cart.py
>
> Variable "store" is defined. How is my syntax invalid? Total code follows.
>
If it was complaining that "store" wasn't defined, the exception would
have been NameError.

It's a SyntaxError because of the missing "=".
From: alex23 on
On Jan 5, 3:40 am, Joe Riopel <goo...(a)gmail.com> wrote:
> On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi <victorsube...(a)gmail.com> wrote:
> > Hi;
> > I have this code snippet:
>
> >     sql '''create table if not exists %sCustomerData (
>
> I think you may have forgotten the "=" after sql.

Jesus wept. How long is this list going to continue to finish Victor's
project for him?

These questions _clearly_ belong on python-tutor.
From: MRAB on
alex23 wrote:
> On Jan 5, 3:40 am, Joe Riopel <goo...(a)gmail.com> wrote:
>> On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi <victorsube...(a)gmail.com> wrote:
>>> Hi;
>>> I have this code snippet:
>>> sql '''create table if not exists %sCustomerData (
>> I think you may have forgotten the "=" after sql.
>
> Jesus wept. How long is this list going to continue to finish Victor's
> project for him?
>
> These questions _clearly_ belong on python-tutor.

Who is this "Jesus" person? You should remember that this is a
predominantly Guido-worshipping list! :-)