Hello

My goal is to select records using the meta character (* or %).
I have try * and % characters in the query field by is not working.
I send you my JSP, XSL  in the attachment.

Rgds,

Said

----- Original Message -----
From: "Henner Kollmann" <
[EMAIL PROTECTED]>
To: "'Bouhaik Said'" <
[EMAIL PROTECTED]>
Sent: Monday, October 03, 2005 7:28 PM
Subject: RE: [dbforms] Help


> Oh, i only saw your screendump. There you inserted a * into the query
> field.
> Just exchanged this by an *
>
> Henner
>
>> -----Original Message-----
>> From: Bouhaik Said [mailto:[EMAIL PROTECTED]
>> Sent: Monday, October 03, 2005 6:39 PM
>> To: Henner Kollmann
>> Subject: Re: [dbforms] Help
>> Importance: High
>>
>>
>> ok for the % character but I dont know how to make it in
>> dbforms? I mean should I declare a new request like:
>> <db: dbform table=.....
>>
>> Rgds,
>>
>> Said
>>
>> ----- Original Message -----
>> From: "Henner Kollmann" <
[EMAIL PROTECTED]>
>> To: "'Bouhaik Said'" <
[EMAIL PROTECTED]>
>> Sent: Monday, October 03, 2005 6:18 PM
>> Subject: RE: [dbforms] Help
>>
>>
>> >* is not a meta character in sql! Use % instead!
>> >
>> > Regards
>> > Henner
>> >
>> >> -----Original Message-----
>> >> From: Bouhaik Said [mailto:[EMAIL PROTECTED]
>> >> Sent: Monday, October 03, 2005 6:10 PM
>> >> To: Henner Kollmann
>> >> Subject: Re: [dbforms] Help
>> >>
>> >>
>> >> Thanks to reply to my email.
>> >> Before sending my email I have changed the XSL
>> >> "C:\dbforms_2.5\xsl-stylesheets\generate_list.xls" like this:
>> >>
>> >>    <xsl:for-each select="field">
>> >>    <td>
>> >>            <xsl:text disable-output-escaping="yes">
>> >>            <INPUT type="text" name="<%=
>> >> searchFieldNames_"$tableName".get("@name") %>" size="10"
>> >> class="clsInputStyle" />
>> >>    </td>
>> >>    </xsl:for-each>
>> >>
>> >> ===> is not working (servlet error....)
>> >>
>> >>
>> >> and after I have found an example:
>> >> "C:\dbforms_2.5\xsl-stylesheets\viewTable.xsl", so I have
>> >> adapt my changes like this:
>> >>
>> >>    <xsl:for-each select="field">
>> >>    <td>
>> >>                                 <xsl:text
>> >> disable-output-escaping="yes">
>> >>                                    &lt;INPUT type="text"
>> >> name="&lt;%= searchFieldNames_</xsl:text><xsl:value-of
>> >> select="$tableName"/>
>> >>                                 <xsl:text
>> >> disable-output-escaping="yes">.get("</xsl:text><xsl:value-of
>> >> select="@name"/>
>> >>                                 <xsl:text
>> >> disable-output-escaping="yes">") %&gt;" size="10"
>> >> class="clsInputStyle" &gt;</xsl:text>
>> >>    </td>
>> >>    </xsl:for-each>
>> >>
>> >>
>> >> Now is working.
>> >> The generated JSP page is:
>> >>
>> >> <td><INPUT type="text" name=
>> >> "<%= searchFieldNames_DFA2_IF_DR_LIST_VAL.get("ENTITY_CODE") %>"
>> >>  size="10" class="clsInputStyle" ></td>
>> >>
>> >>
>> >> Now my problem is to search records with "meta character"
>> >> like "*". See the attachment file.
>> >>
>> >> Thanks a lot.
>> >>
>> >> Rgds,
>> >>
>> >> Said Bouhaik
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> ----- Original Message -----
>> >> From: "Henner Kollmann" <
[EMAIL PROTECTED]>
>> >> To: "'Bouhaik Said'" <
[EMAIL PROTECTED]>
>> >> Cc: <
[email protected]>
>> >> Sent: Monday, October 03, 2005 5:40 PM
>> >> Subject: RE: [dbforms] Help
>> >>
>> >>
>> >> > Hello,
>> >> >
>> >> >> I introduce myself. I'm Mr. bouhaik Said, and I work in
>> >> >> Capgemini company France. Initially I execuse if there are
>> >> >> errors in my English.
>> >> > No problem - i will have errors in my English too.
>> >> >
>> >> >
>> >> > What error do you get?
>> >> >
>> >> >>  the name of my table is: "DFA2_IF_DR_LIST_VAL"  It seems to
>> >> >> me that the fact of having "_" character in the name of my
>> >> >> table that causes problems. What you think about this? Can
>> >> >> you help me?
>> >> > Yes, that could be because dbforms use the _ to maskarde
>> >> some special
>> >> > values. Could you build a view in your database without _?
>> >> >
>> >> > Regards
>> >> > Henner
>> >>
>> >>
>> >> This message contains information that may be privileged or
>> >> confidential and is the property of the Capgemini Group. It
>> >> is intended only for the person to whom it is addressed. If
>> >> you are not the intended recipient,  you are not authorized
>> >> to read, print, retain, copy, disseminate,  distribute, or
>> >> use this message or any part thereof. If you receive this
>> >> message in error, please notify the sender immediately and
>> >> delete all  copies of this message.
>> >>
>>
>>
>> This message contains information that may be privileged or
>> confidential and is the property of the Capgemini Group. It
>> is intended only for the person to whom it is addressed. If
>> you are not the intended recipient,  you are not authorized
>> to read, print, retain, copy, disseminate,  distribute, or
>> use this message or any part thereof. If you receive this
>> message in error, please notify the sender immediately and
>> delete all  copies of this message.
>>

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Attachment: DFA2_IF_DR_REP_VAL_list.jsp
Description: Binary data

<?xml version='1.0'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0" xmlns:db="http://www.wap-force.com/dbforms";>

<!--
**
**   STYLESHEET FOR GENERATION OF JSP VIEWS FOR DBFORMS
** 
**   This stylesheet will make JSP views that list table content. The
**   data in the list can not be updated ("read only")
**  
-->

<xsl:output method="html" indent="yes"/>

<!--
definition of variables
choose appropriate values that fit your needs
-->

<xsl:variable name="maxRows">*</xsl:variable>

<xsl:template match="table">
<!-- origTableName is the original table name -->
<xsl:variable name="origTableName"><xsl:value-of select="@name"/></xsl:variable>
<!-- tableName is the name with schema name corrected -->
<xsl:variable name="tableName">
	<xsl:choose>
		<!-- contains '.' means we have tables from other schema (owner) but only one '.' or the stylesheet will not work -->
		<xsl:when test="contains(@name, '.')">
			<xsl:value-of select="substring-before(@name, '.')"/>
			<xsl:value-of select="'_'"/>
			<xsl:value-of select="substring-after(@name, '.')"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="@name"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="fileName"><xsl:value-of select="$tableName"/><xsl:text disable-output-escaping="yes">_list.jsp</xsl:text></xsl:variable>
<xsl:variable name="fileName_New"><xsl:value-of select="$tableName"/><xsl:text disable-output-escaping="yes">_single.jsp</xsl:text></xsl:variable>
//--file "<xsl:value-of select="$fileName"/>" ------------------------------------------------
<xsl:text disable-output-escaping="yes">&lt;%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %&gt;
&lt;% int i=0; %&gt;
</xsl:text>
<html>
	<head>
		<db:base/>
		<title>List --- file: <xsl:value-of select="$fileName"/></title>
		<link rel="stylesheet" href="dbforms.css" />
    </head>
<body class="clsPageBody" >
<table class="clsMainMenuTable" cellpadding="1" cellspacing="0" width="100%" border="0" align="center">
	<tr>
		<td>
			<table class="clsMainMenuTable" cellpadding="3" cellspacing="0" width="100%" border="0">
				<tr class="clsMainMenuTableRow">
					<td><span class="clsMainMenu"><xsl:value-of select="$origTableName" /></span></td>
					<td align="right" class="clsMainMenu">
						<a href="{$fileName}" class="clsMainMenu">[List]</a>
						<a href="menu.jsp" class="clsMainMenu">[Menu]</a>
						<a href="logout.jsp" class="clsMainMenu">[Log out]</a>		
		</td>
	     </tr>
	   </table>
	   </td></tr>	 		   
</table>

<table align="center" border="0" width="100%" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="right">
        <input type="button" value="Search!" onclick="javascript:document.dbform.submit()" />
      </td>
      <td>
        
      </td>
   </tr>   
</table>

<!-- check for multipart fields like blob, image and diskblob -->
<xsl:variable name="allblobs" select="[EMAIL PROTECTED]'blob' or @fieldType='image' or @fieldType='diskblob']"></xsl:variable>
<xsl:variable name="countMultipart">
	<xsl:value-of select="count($allblobs)"></xsl:value-of>
</xsl:variable>
<xsl:variable name="MultiPart">
	<xsl:choose>
		<xsl:when test="$countMultipart > 0">
			<xsl:text disable-output-escaping="yes">true</xsl:text>
		</xsl:when>
		<xsl:otherwise>
			<xsl:text disable-output-escaping="yes">false</xsl:text>
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

<xsl:variable name="dbConnectionName"><xsl:value-of select="@dbConnectionName"/></xsl:variable>

<db:dbform tableName="{$origTableName}" maxRows="{$maxRows}" followUp="/{$fileName}" autoUpdate="false" multipart="{$MultiPart}" dbConnectionName="{$dbConnectionName}">
<!-- so now multiparts are ok -->

<db:header>
	<db:errors />
	<xsl:text disable-output-escaping="yes">  &lt;table align="center" &gt;
		</xsl:text>	
		<tr class="clsHeaderDataTableRow">
			<xsl:for-each select="field">
				<xsl:text disable-output-escaping="yes">&lt;td class="clsHeaderDataTableCell"&gt;</xsl:text>
				<db:message><xsl:attribute name="key"><xsl:value-of select='@name'/></xsl:attribute></db:message>
				<xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
			</xsl:for-each>
		</tr>


		<tr class="clsHeaderDataTableRow">
			<xsl:for-each select="field">
				<xsl:text disable-output-escaping="yes">&lt;td class="clsHeaderDataTableCell"&gt;</xsl:text>
				               <db:sort fieldName='[EMAIL PROTECTED]'/>				
				<xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
			</xsl:for-each>
		</tr>
		<tr class="clsHeaderDataTableRow">
			<xsl:for-each select="field">
			<td>
                                <xsl:text disable-output-escaping="yes">
                                   &lt;INPUT type="text" name="&lt;%= searchFieldNames_</xsl:text><xsl:value-of select="$tableName"/>
                                <xsl:text disable-output-escaping="yes">.get("</xsl:text><xsl:value-of select="@name"/>
                                <xsl:text disable-output-escaping="yes">") %&gt;" size="10" class="clsInputStyle" &gt;</xsl:text>
			</td>
			</xsl:for-each>
		</tr>

		
</db:header>

<db:body allowNew="false">
	<xsl:text disable-output-escaping="yes">&lt;tr class="&lt;%= (i++%2==0) ? "clsOddDataTableRow" : "clsEvenDataTableRow" %&gt;"&gt;</xsl:text>
    <xsl:for-each select="field">
       <xsl:text disable-output-escaping="yes">&lt;td&gt;</xsl:text>
	       <xsl:choose>
	             <xsl:when test="@fieldType='date'">
                          <db:dateLabel fieldName="[EMAIL PROTECTED]" />
                     </xsl:when>
	            <xsl:otherwise>
		        <xsl:text disable-output-escaping="yes">&lt;%= currentRow_</xsl:text>
		        <xsl:value-of select="$tableName"/>
		       <xsl:text disable-output-escaping="yes">.get("</xsl:text>
		       <xsl:value-of select="@name"/>
		       <xsl:text disable-output-escaping="yes">") %&gt;</xsl:text>
	          </xsl:otherwise>
	      </xsl:choose>
        <xsl:text disable-output-escaping="yes">&amp;nbsp;&lt;/td&gt;&#xD;&#xA;</xsl:text>
     </xsl:for-each>

    <xsl:text disable-output-escaping="yes">&lt;/tr&gt;&#xD;&#xA;</xsl:text>
	</db:body>
        <db:footer>
             <xsl:text disable-output-escaping="yes">&lt;/table&gt;     </xsl:text>          
        </db:footer>
       </db:dbform>
      </body>
     </html>

</xsl:template>
</xsl:stylesheet>

Reply via email to