I have a problem using a 'dtml-in' tag inside of  a Zsql method and I'm
wondering if anybody can help me

Im using a sequence  in  ORACLE  (called 'seq')  and I need to obtain the
following value of that sequence before execute other Zsql methods.
For that, I define a  Zsql method (called sql_select_nextval) that returns
the following  value of the sequence and other Zsql method (called sql_2 )
that executes another actions. The problem is that when I execute the Zsql
method 'sql_2' it seems to execute the sql_select_next_val method two times
because at the next time that I execute 'sql_2'  the value returned from
sql_select_next_val is incremented in 2 in comparison with last value
returned. I need it to be incremented in 1.

the code of  sql_select_nextval method is the following:

     SELECT seq.NEXTVAL  val
                                       FROM DUAL

the code of sql_2  method is the following:

    <dtml-in "sql_select_nextval">

            insert into anytable
                    (oid_anytable, name)
                     (<dtml-var val>,

           <dtml-var sql_delimiter>

            select * from anytable  where oid_anytable  = <dtml-var val>


The code used to create the sequence is the following:

             START WITH 1

Note: if I put the dtml-in outside of the Zsql method it seems to work

Alejandro Pancani

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to