Find a record in a database

Hi I am new to coldfusion
Got a database connected and displays first record
How do I index the records and how do I find a record
many thanks

Records are not indexed, fields are indexed.
Records are found using sql. If you don't know sql, I have
heard good things about about Ben Forta's book, Teach Yourself SQL
in 10 Minutes, by SAMS publishing.
If you are using an Access database, I can personally vouch
for the quality of the SAMS book, Teach Yourself Access (version)
in 24 Hours, because I bought one for Access 97 and did every
tutorial. It also includes some information on data modelling, a
topic where lack of knowlege really punishes many new
developers.

Similar Messages

  • How can i add & update records in a database by using text feild & buttons

    i ,ve a difficulty to make an application which should add,retreive,update,find&delete records to a database in SQL server2000.
    how can i do it easily plz reply me as soon as possible.

    Your question is WAY too broad. People are here to help with problems, not write programs for you. Do you know anything about AWT? Swing? JDBC? SQL? Databases? If not, I suggest you start working with the Tutorials to the left side of this page and come back when you have a specific question.

  • Database displaying all records when no records are in database

    SEARCH PAGE:
    <form id="searcMennuu" name="searcMennuu" method="post" action="VehicleListing.php">
    <select name="vehicles" id="vehicles">
    <option value="allCars" selected="selected">ALL</option>
    <option value="Sedan">Sedan</option>
    <option value="Jeep">Jeep</option>
    <option value="Motorbike">Motorbike</option> </select> <input name="radioVehicle" type="radio" id="searchSale" value="searchSale" />
    Vehicles for Sale</label>
    <label>
    <input type="radio" name="radioVehicle" id="searchRent" value="searchRent" />
    Vehicles for Rent</label> <input type="submit" name="searchButton" id="searchButton" value="Search" />
    </form> RESULTS PAGE:
    mysql_select_db($database_ddd, $ddd); $query_rsTest = "SELECT `year`, `model` FROM vehicles";
    if (isset ($_POST ['vehicles'])) {
    $parSearch = mysql_real_escape_string ($_POST['vehicles']);  if($_POST['vehicles'] == "Sedan"){
    $query_rsTest.= " WHERE vehicle_type LIKE '%$parSearch%'";
    } $rsTest = mysql_query ($query_rsTest, $ddd) or die(mysql_error());
    $row_rsTest = mysql_fetch_assoc ($rsTest);
    $totalRows_rsTest = mysql_num_rows ($rsTest); <div class="showPage"><?php echo $totalRows_rsTest ?></div><?php do { ?>
     <?php if ($totalRows_rsTest > 0) { // Show if  recordset not empty ?> 
    <div class="output" id="Results">
    <p><?php echo $row_rsTest['year']; ?></p>
    <p><?php echo $row_rsTest['model']; ?></p>
    </div>
    <?php } // Show if recordset empty ?>
    <?php } while ($row_rsTest = mysql_fetch_assoc($rsTest)); ?> 
    1. I think i found out why the hide region is not working, whenever i search for something that is not in my database or does not satisfy my search criteria the results page is displaying all records in the database. However i don't know how to fix that. Can someone please help me?
    2. Also i'm trying to find out how i would display ALL vehicles in my database either for rent or sale, i dont have a field in my database for "ALL" so i'm not sure where to start. Thanks in advance

    Which BOBJ version do you use?
    Which kind of data source are you retrieving data from?
    Regards,
    Stratos

  • How to find a record then edit using sql server management studio

    Hello,
    A very basic question:
    I want to find a record stored in MS SQL Server 2008 express database table then edit the record.
    I tried to do it using SQL Server 2008 management studio express because I have been using MS Access database all the time. I have right clicked the table in management studio, clicked the "Edit top 200 records" menu item then when records were
    displayed on the result pane, I pressed Ctrl + F key to find a student named Simon for example. Well, nothing happened. I couldn't see any dialog boxes for putting in the search criteria.
    I guess I cannot simply use Ctrl+F in SQL Server management studio to find / edit a record.
    Can someone please teach me how to find a record specifying a search criteria then edit the record in SQL server management studio?

    Hi ZKM128,
    I have not seen Ctrl+F to be used to look for desired rows in Sql server.
    On the result pane after you selected "Edit top 200 records", just right click , select
    PANE, SQL, you will get the T-Sql query t,here you need to mention the exact criteria which you are looking for, and then you will get the desired rows and then you can edit.
    Thanks
    Manish
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • Air - Sqlite with Adobe Air insert data in memory, but do not record on the database file

    I have the code:
    var statement:SQLStatement = new SQLStatement();
    statement.addEventListener(SQLEvent.RESULT, insertResult);
    statement.addEventListener(SQLErrorEvent.ERROR, insertError);
    statement.sqlConnection = sqlConnection;
    statement.text = "insert into table values('"+TINome.text+"','"+TISerial.text+"') ";
    statement.execute();
    This run without error and the data is inserted (i dont know where), but when i see into database with firefox sqlite manager, the database is empty! But the Air continue run for a time like the data was recorded on the database file. I dont know what is happen with it.
    Help please!

    Toplink In Memory was developed by our project to solve this problem. It allows us to run our test either in memory or against the database.
    In memory, we basically stub out the database. This allows us to speed up our tests about 75x (In memory we run 7600 tests in 200 secs, it takes about 5 hours against the database). However, it throws away things like transactions, so you can't test things like rollback.
    In database mode, it just uses toplink, Another benefit of it though is that it watches all the objects created allowing an automatic cleanup of created test objects - keeping your database clean and preventing test interactions.
    We used HSQL running in memory previously, it worked fine. However, we needed to write scripts to translate our Oracle SQL into HSQL. Also, we had to override things like the data function in HSQL, and a few of our queries behaved unexpectedly in HSQL. We later abandoned it, as it became a lot of maintenance. It was about 10x faster than running against Oracle.
    Interestingly, we install oracle on all our developers machines too, tests run way faster locally, and developers feel way more comfortable experimenting with a local instance than with a shared instance.
    You can find the toplink in memory stuff at:
    http://toplink-in-mem.sourceforge.net/
    I provide all support for it. Doc is sketchy but I'm happy to guide you through stuff and help out where I can with it.
    - ted

  • Error while saving the records in the database

    Hi,
    I am running into a wierd error.
    I have built a new page which contains the information about the employees. Some of the fields are updatable fields. The page shows the details of the person who logs into the page.
    I am not using EO in this page. The data is queried from the database from VO and displayed in the page and when the records are updated, they are saved in the databased using pl/sql procedure which is
    being called from AM. So i am basically not using VO to save the records in the database.
    The error which i am getting is,
    If 2 users are trying to update the page at the same time, user A's details are updated in user B's page.
    This is really causing the issue. Any help is greatly appreciated.
    Thanks in advance.
    PK

    I have posted the code used along with the dialog page. Please review.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Pavan, Start1",OAFwkConstants.STATEMENT);
    if (pageContext.getParameter("XYZBack")!=null)
    pageContext.setForwardURL("OA.jsp?OAFunc=OAHOMEPAGE"// OAWebBeanConstants.RETURN_TO_MENU_URL also tryed this , same error
    ,null
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null //not needed as we are retaining menu context
    ,null // no parameters are needed,true //retain AM,OAWebBeanConstants.ADD_BREAD_CRUMB_YES
    ,true
    ,null
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    if(pageContext.getParameter("XYZUpdate") !=null)//The fields and their values are loaded as soon as the update button is clicked. We do this before calling the oadialog page so that the values are not lost
    OAViewObject EmpDetailsVO3 = (OAViewObject)OAAppl.findViewObject("XYZPersInfoVO");
    OARow EmpDetailsRow3 = (OARow)EmpDetailsVO3.first(); //Bringing the control over to the first row which is nothing but the displayed row.
    if(EmpDetailsRow3 !=null)
    s_workphone = EmpDetailsRow3.getAttribute("WorkPhone").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"workphone is: "+s_workphone,OAFwkConstants.STATEMENT);
    s_fax = EmpDetailsRow3.getAttribute("WorkFax").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Fax is: "+s_fax,OAFwkConstants.STATEMENT);
    s_building = EmpDetailsRow3.getAttribute("Building").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Building is: "+s_building,OAFwkConstants.STATEMENT);
    s_room = EmpDetailsRow3.getAttribute("Room").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Room is: "+s_room,OAFwkConstants.STATEMENT);
    s_box = EmpDetailsRow3.getAttribute("Box").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Box is: "+s_box,OAFwkConstants.STATEMENT);
    s_preferedname = EmpDetailsRow3.getAttribute("KnownAs").toString();
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"Preferred name is: "+s_preferedname,OAFwkConstants.STATEMENT);
    OAException OAExcep1 = new OAException("PER","XYZ_UPDATE_DETAILS");
    OAException OAExcep2 = new OAException("PER","XYZ_UPDATE_MESSAGE");
    OADialogPage OADialogPG1 = new OADialogPage(OAException.WARNING,OAExcep1,OAExcep2,
    OADialogPG1.setOkButtonToPost(true);
    OADialogPG1.setNoButtonToPost(true);
    OADialogPG1.setOkButtonLabel("Yes");
    OADialogPG1.setNoButtonLabel("No");
    OADialogPG1.setOkButtonItemName("DoOk");
    OADialogPG1.setNoButtonItemName("DoNo");
    OADialogPG1.setPostToCallingPage(true);
    pageContext.releaseRootApplicationModule();
    pageContext.redirectToDialogPage(OADialogPG1);
    else if(pageContext.getParameter("DoOk") != null)
    OAApplicationModule EmpDetailsAM = pageContext.getApplicationModule(webBean);
    Class[] paramtypes = {String.class, String.class, String.class, String.class,String.class,String.class,String.class};
    Serializable[] params = {s_personid,s_workphone,s_fax,s_building,s_room,s_box,s_preferedname};
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"personid is :"+s_personid,OAFwkConstants.STATEMENT);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"workphone is :"+s_workphone,OAFwkConstants.STATEMENT);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"workfax is :"+s_fax,OAFwkConstants.STATEMENT);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"building is :"+s_building,OAFwkConstants.STATEMENT);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"room is :"+s_room,OAFwkConstants.STATEMENT);
    if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    pageContext.writeDiagnostics(this,"preferredname is :"+s_preferedname,OAFwkConstants.STATEMENT);
    pageContext.releaseRootApplicationModule();
    OAAppl.invokeMethod("TransactionCommit",params,paramtypes);
    OAAppl.invokeMethod("initDetails");
    throw new OAException("The Building and Phone Information have been saved successfully"
    ,OAException.INFORMATION);
    thank you

  • Error while inserting records in sqlLite database

    Hi all
    I am building a hybrid web app in SMP using phonegap and html.
    I am trying to insert records in sql database but i get an error with an undefined error code
    Please see below :
    function openDatabaseFoo() {
      db = window.openDatabase(clientDBName, clientDBVersion, clientDBDisplayName, clientDBMaxSize);
    function createDBTables() {
      db.transaction(function(tx) {
      // Create mine table
      var fooCreate = 'CREATE TABLE IF NOT EXISTS ' + fooTable+ ' (empNo, empName)';
      tx.executeSql(fooCreate , [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessfully created';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error creating table = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    the creation of tables is happening properly because i am getting a success message in the alerts.
    I am getting the error when i am trying to insert records in the above table
    function insertDataTable(){
    db.transaction(function(tx) {
    var insertSql = 'INSERT INTO ' + fooTable + ' (empNo, empName) VALUES ("1603","baker")';
    tx.executeSql(insertSql, [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessful insertingdata.';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error inserting data sql = " + insertSql + " Error code = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    can some one please help.Also guide me where can i check the sqlLite database logs to see more about the error.
    I would really appreciate the help.I have been onto this since past few days now
    Regards
    Shweta

    What is err.code, or the value of msg when the error occurs?
    Thanks,
    Andrew.

  • How to delete the child record from the database

    how to delete a parent and child record from the database can we do it in the servlet and my database is oracle

    I'm not sure I understand the question but you could certainly use the JDBC API from within your servlet to access and modify a DB. You could also use an EJB layer to access your DB and accomplish the same tasks.

  • Can you use ESB to insert multiple records into a Database

    We have an XML file that has a Parent/Child relationship.
    In situation 1 we have a single parent record in the xml file. We can insert the record into the database successfully.
    In situation 2 we have a parent and a an associated child record. By using a filter expression to identify the existence of the child record we can route to the first DB Adapter to insert the parent then to the second DB Adapter to insert the child.
    Is this final scenario logical and also possible.
    Situation 3 we have multiple child records associated to a single parent. So we would first insert the parent record then insert all the child records.
    Thanks

    I use PL/SQL for this if you are using Oracle.
    Have a look at this post, it is for AQ but the concept can be used for PL/SQL
    Re: Can I pass a pl/sql table as a parameter from a database adaptor
    I will send you an example
    cheers
    James

  • How to find a record in PSA

    hi all,
    tell me the steps how to find a record in PSA.suppose there are >20 data packages..how can i find out that specific record from those datapackages with out knowing datapackage..
    thanks,
    jack

    Hi Jack,
    It so happens that when data is pulled into the PSA there will be no specific order. Hence it is impossible to know which record is present in which data package.
    But if you want to know how many error records are there and what are those there are always options of selecting all the packets and display only erraneous records.
    Regards,
    Pramod

  • How to find out  Locks on the database objects

    how to find out Locks on the database objects

    The following notes should be helpful:
    Note: 200590.1 - bde_session_locks.sql - Locks for given Session ID
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=200590.1
    Note: 1039273.6 - SCRIPT: VIEWING LOCKS ON OBJECTS HELD BY SPECIFIC USER
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1039273.6
    You can also search Metalink, there are many notes/scripts published there which would be also helpful.

  • I need the code to delete record in the database not in the form???

    I need the code to delete record in the database not in the form...
    because when i execute a form always insert the datas in the data base but i want insert value on a text file and delete in the data base the record whith this value of text file.
    i'm spanish an my english is bad sorry.
    thank, javier

    Well, I fail to understand why you want to complicate easy things, but anyway you can do that by using TEXT_IO within Forms to create text file (see Forms builder help), and UTL_FILE package to read it within Pl/Sql : you could create a stored procedure, and call it from Forms passing the file name as parameter. See UTL_FILE documentation

  • How to fetch records from the database into a combo box?

    Hi:
    I&acute;m really new with ABLBPM and I&acute;m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I&acute;m using a dynamic method with this code:
    <em>for each row in SELECT campo1, campo2 from TABLE</em>
    <em>do</em>
    <em>solicitudes[] = [row.campo1, row.campo2]</em>
    <em>end</em>
    <em>return solicitudes
    </em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
    Do you know another way to do it?
    P.D. Sorry for my terrible english
    Greetings

    Hi Steve,
    Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
    fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
    Motivo: 'java.lang.NullPointerException'.
         at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
         at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
         at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
         at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
         at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    Any ideas??
    Thanks and greetings

  • Journal Import finds no records in GL_INTERFACE for processing.

    Hi,
    I'm using the Oracle Web ADI (11i) to upload journal entries form a spreedsheat to GL.
    When the request is finished, this message is shown on the out put :
    Journal Import finds no records in GL_INTERFACE for processing.
    Check SET_OF_BOOKS_ID, USER_JE_SOURCE_NAME, and GROUP_ID of import records.
    If no GROUP_ID is specified, then only data with no GROUP_ID will be retrieved.  Note that most data
    from the Oracle subledgers has a GROUP_ID, and will not be retrieved if no GROUP_ID is specified.
    Can you help me to reslove it.
    Thx.

    Hi Msk;
    You have below errors,
    LEZL0008: Found no interface records to process.
    LEZL0009: Check LEDGER_ID, GROUP_ID, and USER_JE_SOURCE_NAME of interface records.Journal Import Finds No Records in gl_interface for Processing [ID 141824.1]
    Journal Import Finds No Records in GL_INTERFACE For Processing For AX and AP Sources [ID 360994.1]
    GLMRCU does not populate GL_INTERFACE to produce journal for reporting sob [ID 1081808.6]
    Regards
    Helios

  • Validation check to see if Record already in database

    I want a validation rule that will eliminate duplicate records in the database. So I want to check to see if the Account number already exists in the database. I would check this when the CREATE button is pushed.
    Help with the query would be most appreciated.
    The ITEM Name is :P10_ACCT_NO
    The oracle select statement would be
    select acct_no from admission_review

    And don't forget to create a UNIQUE CONSTRAINT on acct_no. Because if you have two users who entering the same account no and press submit at the same time, both will pass the exists check. So you would end up having two records with the same account no in your table.
    The unique constraint checks makes sure that this wrong data doesn't go into the table in such a rare situation.
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com

Maybe you are looking for

  • I cannot route to remote subnets from cisco vpn client and pptp client

    Hi guys, I've a big problem, I configured a 877 cisco router as a cisco vpn server (the customer use it to connect to his network from pc) and a pptp vpn server (he use it to connet to the network from a smartphone). In this router I created 2 vlan,

  • How to define calculated key figure for more summerized level ?

    Hi, I'm new with Query and client ask me Ito calculate  % of WorkHrs / Plan Hrs.   I was able to calculate the % for all selected employees.  There're no problem . But when user drill on Time Code, they lost the % calculation because plan hrs is not

  • What is wrong in this simple scritp? ORA-00936

    Hi, I created this simple script (for an Oracle 10g Express Application process) where I'm trying to copy one row from table EMPRESAS_ORGANISMOS to the table EMPRESAS_REVISADAS. Both tables have the same fields. ":P15_ID_EMP" is the text field that c

  • Itunes keeps skipping, still not answered again!!!!!

    i asked this question a few days ago, but no one answered and im wondering why. now all i want to do is downgrade to an earlier version of itunes because i never had these problems with itunes 6. plus i was able to organize my library from 0-9,a-z. n

  • What are cookie domains used for?

    there is a choice, can someone give me some suggestion? What are cookie domains used for? A/ to be easily recognizable by digital certificates that are also based on domains B/ to instruct the browser that the cookie should be send only to the domain