Hi,

I'd like to know if this thing makes sense:

I'm using a sql view like that:

CREATE VIEW view_item AS
SELECT
   i.itemid,
   i.name,
   i.itemtypeid,
   it.name AS itemtypename,
   i.sku,
   i.indate,
   i.online,
   i.isnew,
   i.price,
   i.categoryitemid,
   i.thumbnail,
   i.image,
   i.description,
   ci."path"
FROM
   (item i JOIN categoryitem ci ON ((i.categoryitemid = ci.categoryitemid))
           JOIN itemtype     it ON ((i.itemtypeid = it.itemtypeid)))
ORDER BY
   ci."path", i.name;


to perform joins to obtain an unique table where the (non-key) fields containing 
id values are replaced by the related description values (obtained from the 
joined tables).

I'd like to use the view_item as the main dbforms table to display informations 
into a jsp page; then I'd like to have the insert and delete buttons to:

- insert a new record into the original table (item, not view_item)
- delete a selected record from the original table

If the sql view and its "parent table" have got the same key field/s (same 
field/s name and values), I suppose it could be possible to specify into the
<db:dbform> element, a "targetTable" attribute that specifies the name of the 
real table for the insert / delete operations.

Example:

<db:dbform tableName   = "VIEW_ITEM"
            targetTable = "ITEM"
            ...
/>

I suppose I should modify the controller servlet code...

I know that there is the possibility to use "tableList" within dbforms, but I 
prefer to use views because I use them elsewhere.

Any suggestion ?

Thank you,
Luca



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to