[Zope] (no subject)

Tom Deprez Tom.Deprez@uz.kuleuven.ac.be
Tue, 20 Apr 1999 15:39:48 +0200


Hi all,

I use PostGreSQL (if you need to know)

1) the SQL Method :

INSERT INTO list 
VALUES (<!--#sqlvar item_string type=string-->
       ,<!--#sqlvar vendorcode_int type=int-->
       ,<!--#sqlvar quantity_int type=int-->)

seems to work fine (new data is entered in database) It only gives the
result text of 'this was not a query'... how comes?

2) I've made DTML Document with :

<FORM METHOD="post" ACTION="???????">
<TABLE BORDER="0">
<TR>
<TD>New Item:</TD>
<TD><INPUT NAME="item_string"></TD>
</TR>
<TR>
<TD>Vendor:</TD>
<TD><INPUT NAME="vendor_string"></TD>
</TR>
<TR>
<TD>Quantity:</TD>
<TD><INPUT NAME="quantity_int"></TD>
</TR>
</TABLE>
<INPUT TYPE="submit">
</FORM>

3) How do I glue these together? So that when pressing submit the values
are inserted in the database??

I've putted the SQL Method in the ACTION, but this doesn't seem to work.

4) Actualy It should return a new page with inserting of ... succesfull
(inserting ... was not successfull)... how can this be done?

5) Instead of letting the user enter the vendorname (<INPUT
NAME="vendor_string">), I would like to give him a combobox (<SELECT>
NAME...). This combobox should be filled with the result of a query to all
vendors in the database. How can this be done? i.e. Putting the result set
of a query in a select box.

6) If I 5 can be done, the insert SQL should slightly change :

INSERT INTO list 
VALUES (<!--#sqlvar item_string type=string-->
       ,<!--#sqlvar vendorcode_int type=int-->
       ,<!--#sqlvar quantity_int type=int-->)

with the vendorcode_int comming from another sql :

select vendorcode
from vendors
WHERE <!--#sqltest vendor_name column=vendorname type=string-->

How can this be done???

Help, can somebody help me with these?

Really thanks in advance!

Tom.