Hi, sorry for the troubles but I am here again !

Could somebody tell how can I use FP tags in order to save my XML resulted from query ?  Here my code.

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>

<xsp:page
  xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
  xmlns:request="http://www.apache.org/1999/XSP/Request"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
>

<page>

<xsp:logic>
    Date now = new Date();
</xsp:logic>

<esql:connection>
  <esql:driver>oracle.jdbc.driver.OracleDriver</esql:driver>
  <esql:dburl>jdbc:oracle:thin:@My_IP:1521:cta</esql:dburl>
  <esql:username>user</esql:username>
  <esql:password>password</esql:password>
  <esql:execute-query>
 
     <esql:query>
         select * from employee
         where empno=<esql:parameter type="string"><request:get-parameter name="EMP_CLVE"/></esql:parameter>
         or sex=<esql:parameter type="string"><request:get-parameter name="EMP_SEX"/></esql:parameter>
         or sex=<esql:parameter type="string"><request:get-parameter name="EMP_SEX2"/></esql:parameter>
         or birtdate=TO_DATE(<esql:parameter type="string"><request:get-parameter name="EMP_BIR"/></esql:parameter>,'DD/MM/YYYY')
         order by empno
     </esql:query>
 
    <esql:results>
      <header>Prueba ESQL para el CTA Fecha de hoy : <xsp:expr>now</xsp:expr></header>
      <esql:row-results>
        <empleado>
          <empno><esql:get-int column="empno"/></empno>
          <fisrtname><esql:get-string column="fisrtname"/></fisrtname>
          <lastname><esql:get-string column="lastname"/></lastname>
          <salary><esql:get-int column="salary"/></salary>
          <job><esql:get-string column="job"/></job>
          <sexo><esql:get-string column="sex"/></sexo>
          <fecha><esql:get-date column="birtdate"/></fecha>
          <phone><esql:get-string column="phoneno"/></phone>
          <esql:connection>
            <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
            <esql:dburl>JDBC:ODBC:SQL</esql:dburl>
            <esql:username>user</esql:username>
            <esql:password>password</esql:password>
            <esql:execute-query>
              <esql:query>
                   select * from Departamento
                   where empno = <esql:parameter type="int"><esql:get-int ancestor="1" column="empno"/></esql:parameter>
              </esql:query>
              <esql:results>
                <esql:row-results>
                  <depto><esql:get-int column="Departamento"/></depto>
                </esql:row-results>
              </esql:results>
              <esql:no-results>
                <depto>No hay depto</depto>
              </esql:no-results>
            </esql:execute-query>
          </esql:connection>
         </empleado >
      </esql:row-results>
      <footer>Aqui puede ir un pie de pagina</footer>
    </esql:results>
  </esql:execute-query>
</esql:connection>

</page>

</xsp:page>
 

Thanks a lot !

Gustavo
 
 

Gustavo Mejia wrote:

And, also, how can I save this results into an specific file automataclly ??

Any Idea.. ?? I really appreciate all your help !!!

Gustavo

Gustavo Mejia wrote:

> Hi !
>
> I am here again !
>
> I have a question, I have a very small application that makes a query to
> my database, when I make the request I got the result in other XML
> document but in my same page (well y the same browser) the question is,
> how can I redirect the results, in order that this results appear in the
> URL that I define, is it posiible, ?? how can I do that ?
>
> Please !! help me !!!
>
> Thanks a lot !!!
> Gustavo
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to