You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "p@zdzior" <pa...@interia.pl> on 2003/08/08 23:47:31 UTC

How to add two integer using tag libs?

Hi,

I am trying to add two integer values obtained from the database,
here is what I am doing:

<sql:transaction dataSource="${jazda}">
  <sql:query var="seeks">
    SELECT COUNT(*) AS SEEKS FROM REQUEST_SEEK WHERE RS_FK_RS_ID = 'SMS_AUTH' || RS_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
  <sql:query var="offers">
    SELECT COUNT(*) AS OFFERS FROM REQUEST_OFFER WHERE RO_FK_RS_ID = 'SMS_AUTH' || RO_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
</sql:transaction>

<c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS} + ${seeks.rows[0].SEEKS}" />

but I am receiving only string for example "34 + 65".
Is it possible to add these values and print the result?

I would be gratefull for any help,

regards,
Lukasz

Re: How to add two integer using tag libs?

Posted by "p@zdzior" <pa...@interia.pl>.
Works now :)

Thank you very much Matt,

Lukasz

----- Original Message ----- 
From: "Sgarlata Matt" <sg...@bah.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 11:51 PM
Subject: Re: How to add two integer using tag libs?


> Try
> 
> <c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS +
> seeks.rows[0].SEEKS}" />
> 
> Matt
> ----- Original Message -----
> From: "p@zdzior" <pa...@interia.pl>
> To: <ta...@jakarta.apache.org>
> Sent: Friday, August 08, 2003 5:47 PM
> Subject: How to add two integer using tag libs?
> 
> 
> Hi,
> 
> I am trying to add two integer values obtained from the database,
> here is what I am doing:
> 
> <sql:transaction dataSource="${jazda}">
>   <sql:query var="seeks">
>     SELECT COUNT(*) AS SEEKS FROM REQUEST_SEEK WHERE RS_FK_RS_ID =
> 'SMS_AUTH' || RS_FK_RS_ID = 'WWW_AUTH'
>   </sql:query>
>   <sql:query var="offers">
>     SELECT COUNT(*) AS OFFERS FROM REQUEST_OFFER WHERE RO_FK_RS_ID =
> 'SMS_AUTH' || RO_FK_RS_ID = 'WWW_AUTH'
>   </sql:query>
> </sql:transaction>
> 
> <c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS} +
> ${seeks.rows[0].SEEKS}" />
> 
> but I am receiving only string for example "34 + 65".
> Is it possible to add these values and print the result?
> 
> I would be gratefull for any help,
> 
> regards,
> Lukasz
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 
> ----------------------------------------------------------------------
> Super konta pocztowe! >>> http://link.interia.pl/f1753
> 
> 
> 


Re: How to add two integer using tag libs?

Posted by "p@zdzior" <pa...@interia.pl>.
Works now :)

Thank you very much Matt,

Lukasz

----- Original Message ----- 
From: "Sgarlata Matt" <sg...@bah.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 11:51 PM
Subject: Re: How to add two integer using tag libs?


> Try
> 
> <c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS +
> seeks.rows[0].SEEKS}" />
> 
> Matt
> ----- Original Message -----
> From: "p@zdzior" <pa...@interia.pl>
> To: <ta...@jakarta.apache.org>
> Sent: Friday, August 08, 2003 5:47 PM
> Subject: How to add two integer using tag libs?
> 
> 
> Hi,
> 
> I am trying to add two integer values obtained from the database,
> here is what I am doing:
> 
> <sql:transaction dataSource="${jazda}">
>   <sql:query var="seeks">
>     SELECT COUNT(*) AS SEEKS FROM REQUEST_SEEK WHERE RS_FK_RS_ID =
> 'SMS_AUTH' || RS_FK_RS_ID = 'WWW_AUTH'
>   </sql:query>
>   <sql:query var="offers">
>     SELECT COUNT(*) AS OFFERS FROM REQUEST_OFFER WHERE RO_FK_RS_ID =
> 'SMS_AUTH' || RO_FK_RS_ID = 'WWW_AUTH'
>   </sql:query>
> </sql:transaction>
> 
> <c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS} +
> ${seeks.rows[0].SEEKS}" />
> 
> but I am receiving only string for example "34 + 65".
> Is it possible to add these values and print the result?
> 
> I would be gratefull for any help,
> 
> regards,
> Lukasz
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 
> ----------------------------------------------------------------------
> Super konta pocztowe! >>> http://link.interia.pl/f1753
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: How to add two integer using tag libs?

Posted by Sgarlata Matt <sg...@bah.com>.
Try

<c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS +
seeks.rows[0].SEEKS}" />

Matt
----- Original Message -----
From: "p@zdzior" <pa...@interia.pl>
To: <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 5:47 PM
Subject: How to add two integer using tag libs?


Hi,

I am trying to add two integer values obtained from the database,
here is what I am doing:

<sql:transaction dataSource="${jazda}">
  <sql:query var="seeks">
    SELECT COUNT(*) AS SEEKS FROM REQUEST_SEEK WHERE RS_FK_RS_ID =
'SMS_AUTH' || RS_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
  <sql:query var="offers">
    SELECT COUNT(*) AS OFFERS FROM REQUEST_OFFER WHERE RO_FK_RS_ID =
'SMS_AUTH' || RO_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
</sql:transaction>

<c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS} +
${seeks.rows[0].SEEKS}" />

but I am receiving only string for example "34 + 65".
Is it possible to add these values and print the result?

I would be gratefull for any help,

regards,
Lukasz



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: How to add two integer using tag libs?

Posted by Sgarlata Matt <sg...@bah.com>.
Try

<c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS +
seeks.rows[0].SEEKS}" />

Matt
----- Original Message -----
From: "p@zdzior" <pa...@interia.pl>
To: <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 5:47 PM
Subject: How to add two integer using tag libs?


Hi,

I am trying to add two integer values obtained from the database,
here is what I am doing:

<sql:transaction dataSource="${jazda}">
  <sql:query var="seeks">
    SELECT COUNT(*) AS SEEKS FROM REQUEST_SEEK WHERE RS_FK_RS_ID =
'SMS_AUTH' || RS_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
  <sql:query var="offers">
    SELECT COUNT(*) AS OFFERS FROM REQUEST_OFFER WHERE RO_FK_RS_ID =
'SMS_AUTH' || RO_FK_RS_ID = 'WWW_AUTH'
  </sql:query>
</sql:transaction>

<c:set var="all_active" scope="page" value="${offers.rows[0].OFFERS} +
${seeks.rows[0].SEEKS}" />

but I am receiving only string for example "34 + 65".
Is it possible to add these values and print the result?

I would be gratefull for any help,

regards,
Lukasz