[Tutor] string assignment
Carla Attianese
c.attianese@cib.na.cnr.it
Thu Nov 14 14:33:18 2002
This is a multi-part message in MIME format.
------=_NextPart_000_01BD_01C28B2F.95D8C390
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi everybody,
I'm writing a python script that tries to connect to informix DB. I got =
an error in assigning a SQL Create Table statement to a variable. This =
is how I did it:
CREATE_STATEMENT_TABLE =3D """
CREATE TABLE rdf_statement (......
.......)
"""
This is the error I got:
SyntaxError: invalid syntax
File "C:\Documents and Settings\carla\a.py", line 258
CREATE_STATEMENT_TABLE=3D"""
^
I tried with single quote, getting the same error.It seems not to accept =
an assignment of a string to a variable. I'm using Python 2.1.1 on =
WIndows XP. Am I doing something wrong with the syntax?
Thank you and best regards
Carla
__________________________
Carla Attianese
c.attianese@cib.na.cnr.it
CNR - Cybernetics Institute
Via Campi Flegrei, 34 I-80072
Pozzuoli (Naples), Italy
+39818675157
------=_NextPart_000_01BD_01C28B2F.95D8C390
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hi everybody,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm writing a python script that tries =
to connect=20
to informix DB. I got an error in assigning a SQL Create Table statement =
to a=20
variable. This is how I did it:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>CREATE_STATEMENT_TABLE =3D =
"""</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CREATE TABLE rdf_statement =
(......</FONT></DIV>
<DIV> =
=20
.......)</DIV>
<DIV> =
=20
"""</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>This is the error I got:</DIV>
<DIV> </DIV>
<DIV>SyntaxError: invalid syntax<BR> File "C:\Documents and=20
Settings\carla\a.py", line 258<BR> =20
CREATE_STATEMENT_TABLE=3D"""<BR>  =
; =
=20
^</DIV>
<DIV><FONT face=3DArial size=3D2>I tried with single quote, getting the =
same=20
error.It seems not to accept an assignment of a string to a variable. =
I'm using=20
Python 2.1.1 on WIndows XP. Am I doing something wrong with the=20
syntax?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thank you and best regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Carla</FONT></DIV>
<DIV></FONT></FONT><FONT face=3DArial =
size=3D2></FONT> </DIV></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>__________________________</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Carla Attianese<BR><A=20
href=3D"mailto:c.attianese@cib.na.cnr.it">c.attianese@cib.na.cnr.it</A><B=
R>CNR -=20
Cybernetics Institute<BR>Via Campi Flegrei, 34 I-80072<BR>Pozzuoli =
(Naples), Italy<BR>+39818675157</FONT></DIV></BODY></HTML>
------=_NextPart_000_01BD_01C28B2F.95D8C390--