[Tutor] Syntax Question

Rich Shepard rshepard at appl-ecosys.com
Wed Feb 8 22:02:46 CET 2006


On Wed, 8 Feb 2006, Danny Yoo wrote:

> Odd.  Can you show us that complaint?  Show us the error string.  There are
> several possibilities here, but I hate guessing. *grin* Show us the exact
> error message you're getting, and that'll hint at what's really going on.
>
> Normal string literals can't span lines, but triple-quoted string literals
> can:

Danny,

   True. I thought that triple-quoted strings were valid only as docstring
comments.

[rshepard at salmo /data1/eikos]$ python eikos.py
   File "eikos.py", line 545
     self.cur.execute("CREATE TRIGGER fki_comp_cat BEFORE INSERT ON component
FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'insert on table "category"
violates foreign key constraint "fk_comp_cat"') WHERE NEW.comp_cat IS NOT
NULL AND (SELECT cat_name FROM category WHERE cat_name = NEW.comp_cat) IS
NULL END")
          ^
SyntaxError: invalid syntax

   I will try it with triple quotes because it's so much easier to read that
way.

Thanks,

Rich

-- 
Richard B. Shepard, Ph.D.               |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com>     Voice: 503-667-4517         Fax: 503-667-8863


More information about the Tutor mailing list