[Zope] Convert Help

Paula Mangas pamm@students.fct.unl.pt
Tue, 26 Feb 2002 18:38:39 +0000 (WET)


Hi,

I think that someone tell you before, but...

sql_statement_list = []
for elem in ['1', '2', '3']:
	sql.append("insert into table values ('"+elem+"')")

doing something like this, at the end, you have a list with the strings 
you want.


Result:
["insert into table values ('1')", "insert into table values ('2')", 
"insert into table values ('3')"]

I hop this help,
Paula Mangas



On Tue, 26 Feb 2002, Todd Loomis wrote:

> All:
> 
> I need to take the elements in the list ['1', '2', '3'] and make them 
> separate SQL Statements:
> 
> insert into table values ('1')
> insert into table values ('2')
> insert into table values ('3')
> 
> how can i do this?
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Todd Loomis
> SAIC - DMSO Support
> 1901 N. Beauregard Street, Suite 500
> Alexandria, VA 22311
> Office: 703.824.3407 Fax: 703.379.3778
> tloomis@dmso.mil
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 

-- 
====================================================================
 "Everything should be made as simple as possible, but not simpler" 
 -- Albert Heinstein
--------------------------------------------------------------------
Paula Mangas

e-mail: pamm@students.fct.unl.pt
URL: 	http://students.fct.unl.pt/~pamm/
TMV:    (+351) 96 2559034
====================================================================