>> Please advise how to create multiple rows insert by usung SQL form .

You have to create a form with multiple rows and then loop through multiple 
records when the form is accepted.

To give you a better idea,  here is a snippet from some code I used in the 
distant past. It updates multiple records from a custom form. You could 
also use this same technique using update_or_insert 
<http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#update_or_insert>.
 
I hope you can figure it out.

---- controller ------ 
myrecords=db(query).select(db.table.ALL) 
if form.accepts ... 
    for r in myrecords: 
        if request.vars.has_key('id%i_price' % r.table.id): 
            r.table.update_record(price=request.vars['id%i_price'% 
r.table.id]) 

----- view ------ 
<table>.... 
{{for record in myrecords:}} 
  <tr> 
    <td>{{=record.carprice.id}}</td> 
    <td><INPUT type="text", name="id{{=record.table.id}}_price", 
value={{=record.table.price}}/></td> 
  </tr> 
{{pass}} 
...</table> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2d772d6e-7de6-4a01-bc5a-72d389f01d3eo%40googlegroups.com.

Reply via email to