How to update database with a select box

I'm hoping someone can/will help me with a new feature I'm
trying to add to my web site. I'll summarize what I'm working with
and then proceed to what I'd like to do. This is the web site I'm
working on: www.truckerstoystore.net
I have a database for the Truck of the Week set up with the
information that is output on each page in the left column and
on the Truck of the week page itself. I add new Truck of the
Week (TOW) entries via a form I've put together. Right now, in
order to change the current TOW, I have to manually go into my
template and change the ID (which is automatically assigned when
the record is created, and thus makes it unique) in my SQL which
currently reads
SELECT *
FROM truckofweek
WHERE ID="4"
to the ID of the current TOW.
What I want to be able to do is create a new form that will
allow me to select the TOW entry that I want to be displayed from a
select box (drop down box). I have a good idea of how to populate
my select box, but don't know how to get it to work. My first idea
was to update the table in the database (Access) manually with a
new column called currentTOW, with values set to a Yes/No type,
with default values set to "No". Then I would use my form to set
the value for one of them to "Yes" so I could set my SQL to 'WHERE
currentTOW ="yes" ' I would also make a <cfif> statement that
checks for entries marked "Yes" and changes them to "No" when the
form loads to avoid setting 2 entries to "Yes" and my page thus
attempting to load 2 TOW entries.
My problem is, I don't know how to do any of this. I hope
I've described this situation well enough. I know there has to be
at least one guru on here that can help me. Any assistance would be
greatly appreciated.

Hey,
Thanks for replying. That sounds like a good idea, but I
don't know how to do it.
I started working on a new idea, where I have a second table
in the same datasource set up called currentTOW, with one field
called currentTOW and only one record. The idea is to send the
string of the "owner" field from the select box, which is populated
from the table called truckofweek to this one cell in the
currentTOW table.
This way, in my page which will display the data, I have 2
querys. The first pulls the data in the single cell from currentTOW
and outputs its string into the second query. I've attached the
code below. I get an error when I try to display the page, see the
error here:
www.truckerstoystore.net/currentTOW2.cfm.
However, the SQL looks like I want it to look, as "WHERE Owner =
Craig Carp" is essentially the same record that it displays now in
the live page "/currentTOW.cfm" only the SQL currently reads "WHERE
ID = 4" (4 and Craig Carp are part of the same record).
Here is the link to my form:
Form

Similar Messages

  • How to update database table !!!

    hi all,
    Please advice how to update database table with certain cndition needs to be checked.
    Please consider below scenario.
    have used enqueu and dequeue function to lock entries  and also i have used BAPI so considering that return parameter . i want to update table
    /tdk/st0027.
    1. I want to update database table
    2. there are certain condition needs to be checked like ,
       loop at it_final into wa_final.
    th_return-type = 'S'.
               if th_final-vbeln = /tdk/st0027-vbeln and
                  th_final-posnr = /tdk/st0027-posnr and
                  th_final-etenr = /tdk/st0027-sdslno.
    above condition which i need to check .and need to append below system fields need to be appended in table.
              th_final-prstsind = '20'.
              th_final-chgdate  = g_date.
              th_final-chgtime  = g_uzeit.
              th_final-chgprog  = g_cprog.
              th_final-chguser  = g_uname.
              append th_final to td_final.
              update /tdk/st0027 FROM th_final.
              endif.
    endloop.
    but i am getting error saying that  "The type od database table and work area (TH_FINAL)  are not unicode convertible"?
    I am not able to understandwhat would be the solution for this ?
    Thanks and regards,
    Prasad K. NAralkar

    The error occurs in the UPDATE statement included in the code. In this statement it is seen that there is a mismatch of structure defined for the DDIC table /tdk/st0027 and that of your work area th_final.
    try to create a structure w.r.t the DDIC table.
    Eg: DATA: wa_temp TYPE /tdk/st0027.
    MOVE-CORRESPONDING th_final TO wa_temp.
    Then try to UPDATE using the temporary work area i.e wa_temp which has structure similar to that of the database table.

  • How to create parameter with multiple selection in a query (SQ02) ?

    Hi Exports
    Do you know how to create parameter with multiple selection in a query (transaction SQ02)?
    thanks.

    Hi
    i know how to create user parameter at SQ02,
    the question is how to create multiple selection parameter?

  • How to create database with ASM

    HI
    How to create database with ASM?
    I install vmware workstation on window XP .On virtual machine install Linux 5 enterprise (Oracle) install.
    I install oracle DB software only. Also make 3 disk for ASM .
    1 -- When I want to install oracle DB with ASM . In this process candidate disks not show . Why?
    How I can see disks ..
    so I simple install oracle DB software only.
    2 -- Now I want to create database with ASM by DBCA .
    What process I will follow ?
    Please guide me
    Thanks

    Hi
    Steps to create database with ASM.
    1.Install oracle binary with active CRS(For single node installation CRS is activated when you run root.sh) .
    2.Create disk without file ssytem.
    3.Assign disk to raw .
    4.Change owner and permission to raw devices.
    5.Configure ASM manually or USing DBCA.
    Manually ASM Configuration.
    a.Create initialization parameter file and password file.
    b.Mandatory parameter is "instance_type=asm" as per your need configure rest of parameter like db_cache_size,large_pool_size,processes,remote_login_passwordfile,shared_pool_size etc..
    c.To discover disk configure "asm_diskstring=/dev/raw/raw*"
    Using DBCA to configure ASM.
    1.In storage type section choose ASM.It will ask for password of sysdba in 10g.
    2.ASM configuration window will open -> here it create disk group -> it shows all available ASM candidate disk automatical -> choose normal redundancy,external redundancy or high redundancy.
    ASM disk also can be conbfigured with ASMLIB .
    If ASM disk is configured you can start asm instance in nomount state and query to v$asm_disk to see all candidate disk.V$asm_disk only shows disk which is configured in asm_diskstrings.
    Hope this will help U,
    Tinku

  • How can I validate a multi-select box to have at least 1 option

    How can I validate a multi-select box to have at least 1 option
    selected in struts?

    thanks i will try that other then that if I want to create single drop down list and pass multiple values associated to that drop list value how would i do that....

  • For for updating database with referential integrity

    Hi:
    Here is the essence of the problem:
    I have created an Access database that I want the fire chiefs
    to update. The database is a one to many structure with referential
    integrity set. One fire truck has many capabilities. So if Fort
    Myers has a truck named 'FM101' and it has several capabilities
    such as 1.) pumper, 2.) extrication 3.) Advanced Life Support.
    My problem is how to set up a form to do that. In particular,
    how do I set up the form so that it will allow the fire chiefs to
    input several capabilities at a time for a truck.
    I can build a form showing the truck which was obtained from
    a pick-list. And I can show another field showing a pick-list for
    the capability of that truck (pumper, extrication, ALS, etc). My
    question is how do I set up the form to allow the chiefs to input
    multiple lines for the many capabilities of that one truck? Right
    now I have one input for the truck and one input for the capability
    - but I want to enable the user to input as many capabilities as
    they feel necessary.
    How do I do that?
    thanks

    You put the capabilities in a multi-select box.
    <select name="capabilities" multiple="true">
    <option value="capability1">Capability 1</option>
    </select>

  • 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 update iphone3 with ios 4.3

    how can i update my iphone3 with ios 4.3

    See the chart below to determine whether you can upgrade your device and what you can upgrade to. If you do not have a Software Update option present on your iDevice, then you are trying to upgrade to iOS 5 or higher. You will have to connect your device to your computer and open iTunes in order to upgrade.
    IPhone, iPod Touch, and iPad iOS Compatibility Chart
         Device                                       iOS Verson
    iPhone 1                                      iOS 3.1.3
    iPhone 3G                                   iOS 4.2.1
    iPhone 3GS                                 iOS 6.1.x
    iPhone 4                                      iOS 6.1.x
    iPhone 4S                                    iOS 6.1.x
    iPhone 5                                      iOS 6.1.x
    iPod Touch 1                               iOS 3.1.3
    iPod Touch 2                               iOS 4.2.1
    iPod Touch 3                               iOS 5.1.1
    iPod Touch 4                               iOS 6.1.x
    iPod Touch 5                               iOS 6.1.x
    iPad 1                                          iOS 5.1.1
    iPad 2                                          iOS 6.1.x
    iPad 3                                          iOS 6.1.x
    iPad 4                                          iOS 6.1.x
    iPad Mini                                     iOS 6.1.x
    =====================================
    Select the method most appropriate for your situation.
    Upgrading iOS
       1. How to update your iPhone, iPad, or iPod Touch
       2. iPhone Support
       3. iPod Touch Support
       4. iPad Support
         a. Updating Your iOS to Version 6.0.x from iOS 5
              Tap Settings > General > Software Update
         If an update is available there will be an active Update button. If you are current,
         then you will see a gray screen with a message saying your are up to date.
         b. If you are still using iOS 4 — Updating your device to iOS 5 or later.
         c. Resolving update problems
            1. iOS - Unable to update or restore
            2. iOS- Resolving update and restore alert messages

  • How to retreive mutiple values from select boxes in jsp

    <select name="indices" style="width:180" size="6">
                             <option value=F_ARCHIVEDATE> F_ARCHIVEDATE </option>           
                   <option value=F_DELETEDATE> F_DELETEDATE </option>           
                   <option value=F_DOCCLASSNUMBER> F_DOCCLASSNUMBER </option>           
                   <option value=F_DOCFORMAT> F_DOCFORMAT </option>           
                   <option value=F_DOCLOCATION> F_DOCLOCATION </option>           
                   <option value=F_DOCNUMBER> F_DOCNUMBER </option>           
                   <option value=F_DOCTYPE> F_DOCTYPE </option>           
                   <option value=F_ENTRYDATE> F_ENTRYDATE </option>           
                   <option value=F_PAGES> F_PAGES </option>           
                   <option value=F_RETENOFFSET> F_RETENOFFSET </option>           
                   <option value=date1> date1 </option>
    <option value=id> id </option>
    <option value=name> name </option>
              </select>..
    hi iam having a select box with above option values..when we submitt the page i want retreive all these option values in anohter jsp called retreive.jsp..how can i do that..i want to put all these values in array in that jsp page..
    regards,
    sam

    Hi
    In ur code u cant select multiple values. Alter ur code like this
    <select name="indices" style="width:180" size="6" multiple> // multiple added here
    <option value=F_ARCHIVEDATE> F_ARCHIVEDATE </option>
    <option value=F_DELETEDATE> F_DELETEDATE </option>
    <option value=F_DOCCLASSNUMBER> F_DOCCLASSNUMBER </option>
    <option value=F_DOCFORMAT> F_DOCFORMAT </option>
    <option value=F_DOCLOCATION> F_DOCLOCATION </option>
    <option value=F_DOCNUMBER> F_DOCNUMBER </option>
    <option value=F_DOCTYPE> F_DOCTYPE </option>
    <option value=F_ENTRYDATE> F_ENTRYDATE </option>
    <option value=F_PAGES> F_PAGES </option>
    <option value=F_RETENOFFSET> F_RETENOFFSET </option>
    <option value=date1> date1 </option>
    <option value=id> id </option>
    <option value=name> name </option>
    </select>..
    in retrieve.jsp write like this
    <% String[] mv =request.getParameterValues("indices"); %>
    <% for(int i=0; i<mv.length;i++)
    {     %>
    <br>
    <%= mv[i] %>
    <% }
    %>
    I hope it will satisfy u :)

  • How to update database in update task

    Hi everyone,
      I have a question: I need to update database in a SAP LUW. And I develop a method in my class
    to update the database.how can I update database in SAP LUW.

    Use can use "COMMIT WORK " and Database operate command SQL
    Within an LUW, database changes are not made until after a database commit. Prior to this, any database change can be canceled by a database rollback.
    In the R/3 System, a database commit is triggered either automatically or by the ABAP/4 command COMMIT WORK or the appropriate Native SQL command for the database system.
    Similarly, a database rollback is triggered either automatically or by the ABAP/4 command ROLLBACK WORK or the appropriate Native SQL command for the database system.
    After the COMMIT WORK has been executed, the event RAISE_TRANSACTION_FINISHED of the class CL_SYSTEM_TRANSACTION_STATE with parameter value CL_SYSTEM_TRANSACTION_STATE=>COMMIT_WORK is triggered. However, this does not apply to the COMMIT WORK at the end of the update.
    Edited by: Jack Wu on Dec 16, 2008 11:13 AM

  • How to query Database with Parameters  and configure null value response?

    Hi,
    1.When capture attributes from forms & after applying several logics, passing to a DB table using an API, how to get relevant values for a given parameter in another DB table ?
    2.When a DB table is queried, if the value does not exist, how to configure the response message ?
    Thanks.

    Okay, you've provided exactly what John S. asked for - and no more. This is helpful, but not enough. I think we're going to need a use case to understand exactly what you are asking. What should the user see? What does the user do next? What should happen in the database and in the application when the user does this?
    However, I'll try to read between the lines a bit, and get you part of the way there. To query the database with parameters in ADF BC, you need a View Object (VO). The simplest thing to do is create the SELECT command behind the VO with some bind variables and add the bind variables to your VO. At that point, you will get an ExecuteWithParameters operation in the Data Control. You can drag that operation onto a JSF page and it will give you an option to create a parameter form to let the user fill in the parameters to set the bind variables, and a button to execute the query with these values. Any table or form based on that same VO will show the selected data.
    A Trinidad or ADF Rich Faces table will have an attribute to let you define some text to show the user if no data was retrieved by the query. But there are other ways to determine if data was retrieved which you can use to control other ways to display this information. For instance, I have a page that has an outputText component that has a "rendered" attribute to show the text only when there was no data retrieved by a query.

  • How to update software with E71 directly?

    I checked the instructions on the net but I dont understand them (see below).
    Can some one help with this?
    I have a Apple OSX so PC Suite is out.
    Bluetooth connection between E71 & Apple laptop gets quite often into an endless disconnecting loop and I have to reboot both E71 and Apple laptop. Does newest E71 update help with that? 
     How do I use my device to update?Tip: It is always recommended to backup your data before updating your software. However, updating using your device does not necessitate a full backup.Step 1 Step 2 Step 3 Key *#0000# into your phone's home screen or go to Device manager(consult your user guide if necessary) Select Options > Check for updates. Follow the on-screen prompts until your update is complete!The above instructions may not apply to all devices. For detailed instructions on updating your particular device, please select your model on the Device software update page. 

    FOTA is not available on the E71 so it cannot be updated directly.
    On paper the E71 is compatible with FOTA but no FOTA updates have ever been released for an FP1 based device.
    The only options are to do the update on a friends windows based PC or get it updated at a nokia care point. Nokia has never offered mac support for updates so it is not possible to update using the mac OS.
    Care points/service centres and repair info:
    UK • Europe • Asia-Pacific • USA •
    Canada • Middle East and Africa
    Elsewhere: Click here, select your country, go to the support section, then select repair. 
    Message Edited by psychomania on 20-Aug-2009 10:19 PM

  • 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

  • Unable to fetch records from database with huge selection screen

    Hi all,
    I have 20 fields from selection screen.
    I have a z table with these 20 fields .
    Now with the values entered in the selection screen i have to fetch the records from the z table.
    All fields in the selection screen are not mandatory, the user may or may not enter the values.
    I have to fetch the records based on the values entered.
    I wrote a select with where condtion to all those 20 fields. but its not retreving the records.
    All the fields in the selection screeen are parameters.
    Could you help me on this, please. I wrote in the where conditon with field1 = value AND field 2 = value.. etc... field20 = value.
    Please guys help me out.
    KV.
    Edited by: Nithin Kumar on Mar 18, 2008 8:48 AM

    Guys,
    I have a problem with the select query.
    as i said i have 20 fields, ranges are working for few fields.
    But i have couple of fields as descriptions. So i have to fetch the records for pattenr as well.
    Means, user can enter in the description............. like    "ab". So in the description if there is anything   with 'ab' it should fetch.
    it works with a LIKE statement with % symbols.
    but it doenst work with   ranges and patterns in same select. I mean the below is not working.
      SELECT  *
             FROM crmd_orderadm_h
             INTO table itab
             WHERE object_id IN r_obj AND
                   process_type IN r_pro AND
                   description LIKE s_des.
    r_obj, r_pro are ranges  and s_des is the pattern, ex: %ab%.              so in this case how it has to be done... could you please help me on this.. the other fields could be blank( r_obj and r_pro).. 
    kindly help me out......
    KV

  • How to update database using Service in 11g

    Please some one provide the knowledge, how i will update database from a form and form is having multiple rows and column and and all are having different or same value.
    e.g. we have having clientName table and having column(clientname, legalContact, selfservice,usertype,details),
    We can search the data from clientName, now user can change other information except clientName can not be change but other information can change. now how i will update users changed value.

    Hi ,
    If you are looking to update the fields for a user such as description , telephone number etc then the following service needs to be used :
    UPDATE_USER_META_TABLE
    Details for this are available in : http://docs.oracle.com/cd/E23943_01/doc.1111/e11011/c04_core.htm#CSSRG2503
    Hope this helps .
    Thanks,
    Srinath

Maybe you are looking for