You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tom Place <ps...@nottingham.ac.uk> on 2003/02/11 12:36:14 UTC

Retrieving a String from the database in XSP

I am trying to retrieve a string from the database an place it into a
variable (should be simple I know)
However I am getting a compilation error
 
I am trying to insert the string value correctly? 
 
String myString = null;
   
 <esql:connection><esql:pool>autorevs_pool</esql:pool>
      <esql:execute-query>
        <esql:query>select * from user_info where
USERNAME='<xsp:expr>username</xsp:expr>' and
PASSWORD='<xsp:expr>password</xsp:expr>'</esql:query>
        <esql:results>
              <xsp:logic>
                style = "<esql:get-string column="STYLE"/>";
              </xsp:logic>
        </esql:results>
        <esql:no-results>
          <xsp:logic> 
            style = "";
          </xsp:logic>
        </esql:no-results>
      </esql:execute-query>
    </esql:connection>
 
Cheers
 
Tom
 
 

Re: Retrieving a String from the database in XSP

Posted by Leszek Gawron <ou...@vip.net.pl>.
On wto, lut 11, 2003 at 11:36:14 -0000, Tom Place wrote:
> I am trying to retrieve a string from the database an place it into a
> variable (should be simple I know)
> However I am getting a compilation error
>  
> I am trying to insert the string value correctly? 
>  
> String myString = null;
>    
>  <esql:connection><esql:pool>autorevs_pool</esql:pool>
>       <esql:execute-query>
>         <esql:query>select * from user_info where
> USERNAME='<xsp:expr>username</xsp:expr>' and
> PASSWORD='<xsp:expr>password</xsp:expr>'</esql:query>
>         <esql:results>
>               <xsp:logic>
>                 style = "<esql:get-string column="STYLE"/>";
>               </xsp:logic>
>         </esql:results>
>         <esql:no-results>
>           <xsp:logic> 
>             style = "";
>           </xsp:logic>
>         </esql:no-results>
>       </esql:execute-query>
>     </esql:connection>
You forgot to use esql:row-results tag, check out the esql reference on cocoon
site
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>