Previous/Next record

Hi,
Pls take a look at http://apex.oracle.com/pls/otn/f?p=30495:2:1313228760030470:::::
username is test
pwd is test
There are two buttons on it Previous and Next.
When I click on these buttons I want it to advance to next record (next button) . How can that be done? What kind of coding is requried?
Thanks
Munish

Hi,
For the next button you need a page process (conditional on the button ebing pressed ) something like:
select min(release_id) into :P1_RELEASE_ID from tpa_rel_releases
where
release_number = (select
                        min(release_number)
                  from  tpa_rel_releases
                  where release_status !='C'
                  and   release_number > (select release_number from tpa_rel_releases where release_id = :P1_RELEASE_ID));for the prev button use:
select min(release_id) into :P1_RELEASE_ID from tpa_rel_releases
where
release_number = (select
                        max(release_number)
                  from  tpa_rel_releases
                  where release_status !='C'
                  and   release_number < (select release_number from tpa_rel_releases where release_id = :P1_RELEASE_ID));Hope this helps,
Martin

Similar Messages

  • Get previous / next record

    Hi,
    I have a little problem with getting the previous / next record.
    Because build-in is not working, if user filters and sorts the table, I tried many things to get it managed. My last test was creating a query, returning the previous and next id. I have this PL/SQL statement
    DECLARE
    str_express varchar2(2000);
    str_order varchar2(500);
    str_where varchar2(500);
    BEGIN
    IF :F109_FILTER_PROJECT = 'N' THEN
    str_order := 'ORDER BY pro_id desc';
    ELSE
    str_order := :P250_SORT;
    IF :P250_WHERE != '0' THEN
    str_where := :P250_WHERE;
    END IF;
    END IF;
    str_express :=
    'SELECT DECODE(prev_id, 0, null,' || Chr(39) || 'value=' || prev_id || Chr(39) || ')
    FROM (
    SELECT pro_id,
    nvl(LAG(pro_id) OVER (' || str_order || '), 0) prev_id,
    nvl(LEAD(pro_id) OVER (' || str_order || '), 0) next_id
    FROM view_project ' ||
    str_where || ')
    WHERE pro_id = ' || :P251_PRO_ID;
    RETURN str_express;
    END;
    It should just show the previous id and if there is none, should show i.e. 'value=1'. If I let return only the prev_id (code: DECODE(prev_id, 0, null, prev_id) ) it is working fine, if I enter DECODE(prev_id, 0, null,' || Chr(39) || 'value=' || prev_id || Chr(39) || ') it's always showing the error, that prev_id is not declared.
    What's wrong?
    I thought, I can show buttons for prev and next id in the table with this code:
    DECODE(prev_id, 0, null,' || Chr(39) || '<input type="button" class="t10button" value="< Previous" onClick="javascript:html_GetElement(' || Chr(39) || 'P251_PRO_ID' || Chr(39) || ').value = '|| prev_id || ';doSubmit();" />' || Chr(39) || ') prev_id
    This is working fine without DECODE syntax, but then also a button is shown, if prev is none.
    Any ideas how to manage????
    Thanks

    Hi,
    I now understand why preV_id is not known ... it's way my fault in thinking ...
    but how can I set my prev and next ID ... has anybody an idea?
    It's very stupid, to move from table to form and back to table and form to get the next / prev record ...
    thanks
    chrissy

  • Serious problem with previous / next record in master-details relations

    I have master-details relations like this (if master is A) :
    A-B
    A-C and C-D
    When I move down with do_key('next_record') all values of all records in all blocks are OK. But when I move up, it doesn't work : all D block values are erased and I don't understand why ?
    Thank you for your help.
    Antoine LEFEBVRE.

    Blocks A and B are in the first canvas and blocks C et D are in the second canvas.
    On next_record action from A the B is updated, C too and D too. But on previous_record action, D is not updates.
    To display the second canvas I use a command button and into the WBP trigger there is :
    go_block(C);
    execute_query;
    to be sure to execute query, but it's null.
    What's your suggest ?
    Thank you,
    Antoine.

  • [ Previous]  [Next ]  and Sort Order

    Is there a way to make HTMLDB generate report and edit form in such way that [< Previous] [Next>] sequence on follows the reports SORT ORDER instead of PK ?
    e.g. a report on EMP and user sort on HIREDATE...
    so when user gets linked to Edit Form page and click Previous/Next buttons - the USER, totally oblivious to PK - from his perspective, he expects to see [< Previous], [Next>] brings up the Previous/Next record PER SORT ORDER

    Robert - I think it's supposed to work the way you
    want it to. Are you using the column sort options on
    the report attributes page?Scott,
    No, it's not doing that...
    Just now generated app on EMP - all default except no aggregations and sum to keep it simple.
    Test#1)
    Click HIREDATE column to sort DESC.
    KING
    MARTIN
    TURNER
    Click MARTIN record to edit. PREV/NEXT follows EMPNO order
    JONES
    MARTIN
    BLAKE
    Test#2) went into "Report Attributes"
    Under "Sort": Uncheck all except HIREDATE and made
    "Sort Sequence" = '1 desc'
    Result is same as Test#1
    http://htmldb.oracle.com/pls/otn/f?p=24949:1

  • Previous and next records in a table

    Let's say I have a table where I have
    item name sequence customer number
    I want to select these three fields where name = 'INSPECTION', but I'd also like to grab the record prior to this and the record after this, regardless of the name content. I need to do it for each customer number.
    Is it possible for a novice like me to do?
    Thank you

    What is "next record" and "previous record" for you in this context? A database table doesn't have records in any specific order. They have an arbitrary order.
    If for you, the records have the sequence as an ordering information, then you could use LAG and LEAD functions.

  • Previous and Next Record

    Is there any additional code needed to replicate the functionality of the previous and next record buttons in the standard toolbar other than the built-ins that are provided? I'm getting some weird results by just using the built-ins. Thanks!

    Well, to give you and example, when I query the first record and then press the button that uses the previous_record built-in I get the message: at first record (same as the toolbar button). However, when I press the next record button, I'll eventually get the message: field must be entered (whereas, the toolbar button will bring up the message: record must be entered or deleted first). I was wondering why the next_record built-in would bring up a different message, and how to get my button to function the same way as the one in the toolbar.

  • Navigate previous record,next record by entering key-up and key-down

    Hi ,
    JDeveloper11g_
    I am trying to solve of how to navigate previous record,next record by entering key-up and key-down in ADF Table.
    If any of you have this solution by JScript of Backing Bean please help me.
    Thanks
    zakir
    ===

    Hi zakir,
    I hope I understood your requirements correctly. You have an editable ADF table. You would like to use the up/down arrow keys to move from one row to the next/prev row of the same column. Since the Tab key moves the cursor to the right and Shift+Tab moves it to the left, now you want to implement the same thing but just up and down, correct? If so, try this.
    /** Javascript **/
    function detectKey(evt) {
        var inputText = evt.getSource();
        var id = inputText.getClientId();
        var start2 = id.indexOf(":") + 1;
        var end2 = id.lastIndexOf(":");
        var numValue = parseInt(id.substring(start2, end2));
        var evt2 = evt.getNativeEvent();
        arrows=((evt2.which)||(evt2.keyCode));
        switch(arrows) {
            // Up arrow
            case 38:
            numValue = numValue - 1;
            break;
            // Down arrow
            case 40:
            numValue = numValue + 1;
            break;
        var newStr = id.replace(/:\d:/, ':' + numValue + ':');
        var comp = AdfPage.PAGE.findComponent(newStr);
        if (comp != undefined) {
            comp.focus();
    /** Jspx. (Place a client listener on each inputText in the ADF table) **/
    <af:column .....>
      <af:inputText value="#{row.bindings.price.inputValue}" .....>
        <af:clientListener type="keyDown" method="detectKey"/>
      </af:inputText>
    </af:column>With this, you get to move Up/Right/Down/Left in the editable ADF table without using the mouse.
    References:
    http://thepeninsulasedge.com/blog/?cat=29
    af:clientListener attributes and methodes of event object in java script
    Regards,
    Chan Kelwin

  • How to implement JSF text input down-arrow key = next record navigation?

    Hi All,
    I've got a small query which you experts might be able to help me through. I would not be surprised if such questions would already have been raised in this forum.
    Formerly, I've created an Oracle Form that allow user to quickly insert data in bulk. It only has three 3 fields - first name, second name and address. Because of the flexibility of the Oracle Form, by pressing the down arrow key, user is able to create record when the last record is detected. And vice versa by hitting the up arrow key, it will move to the previous record when the current record is not the first record. So basically, the form is very 'key-driven' and without the use of the mouse, a lot of data can be inserted very quickly and efficiently.
    I've successfully converted such form to an ADF BC JSF page using the JHeadstart toolkit. But when I showed it to my users for comment, they were really disappointed with the number of mouse interactions they need to click every time to navigate between records as well as creating new records. My question is can I build some sort of ADF JSF event handler on any of the text items to perform the following tasks:
    1.) When 'down arrow key' is pressed AND not the last record THEN
    Go to the next record.
    2.) When 'down arrow key' is pressed AND is the last record THEN
    Go to the next blank record.
    3.) When 'up arrow key' is pressed AND not the first record THEN
    Go to the previous record.
    4.) When 'up arrow key' is pressed AND is the first record THEN
    Do nothing.
    If all the four above tasks are achievable in ADF JSF, can you please guide and brief me on the steps to implement them. Or these functionalities are already available somewhere in other open source toolkits. Your help is much appreciated. Thank you and have a nice day.
    Kind Regards,
    John

    Hi Steven,
    I've tried to incoporated attached link's codes with the JHeadstart generated code inside the jspx but I still cannot get it to work. There is a lot of Javascript error and is impossible to debug.
    Regards,
    John

  • First/Previous/Next/Last buttons not working in Applications Master Detail

    Jdeveloper version: fusiondrop5primeb26
    accessed through appstta.oraclecorp.com
    I attempted to create an Applications Master Detail UI by selecting Applications : Master Detail from the Applications Component Palette. I created the UI using my headers table (APPLCORE_SHIPMENT_HEADERS) as the master and the lines table (APPLCORE_SHIPMENT_LINES) as the detail. The master is shown as a form and the details are displayed as a table below. On the screen with the checkboxes to include First, Previous, Next, Last buttons, I checked all of them.
    On the backend, my headers table has two rows.
    When I ran the page:
    1. When the page comes up, it shows the data for shipment header 1 and the associated details in the table below. This is correct.
    2. However, the First and Previous buttons are enabled at the top. They should not be enabled since I am on the first record, and there is no previous record. This is incorrect.
    3. When I click Next, the data does not update to the the next header record (shipment header 2). The data is still for shipment header 1. This is incorrect.
    4. When I click Next once more, an Error window pops up:
    Messages for this page are listed below.
    ShipmentLineId     Error java.lang.NullPointerException
    ShipmentHeaderId Error java.lang.NullPointerException
    LineNumber Error java.lang.NullPointerException
    ItemName Error java.lang.NullPointerException
    (same error is shown for all other columns in the lines table)
    I was under the impression that we do not need to do anything special for the First/Previous/Next/Last buttons to work, other than checking the boxes in the page creation process.
    The application in question is here:
    /home/sheyu/jdevhome/descflexdemo/.
    The ui project specifically is in this folder:
    /home/sheyu/jdevhome/descflexdemo/mywork/descflexdemo/ui/
    I have tried to start from scratch several times to no avail. Please advise.
    Thanks,
    Sherry

    Sherry, please use the internal JDeveloper forum at http://www.oracle.com/technology/products/jdev/customers/index.html for questions like this.
    The OTN forum is meant for versions that are available for the public.

  • Next record button GUI & database

    hello,
    I have a GUI that connects to a database and in the GUI I have a file menu that has first, last, prev, next on it. I want the user to be able to select either one of these words or on the image of these that are in a tool bar. i have two classes. it is a lot of code but i just need to figure out how to get to the next record under the action performed. Thank you for your time!!!
    Brian
    package Assignment2;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import java.util.Vector;
    import java.io.*;
    public class GUIDatabase extends JFrame implements ListSelectionListener, ActionListener {
    private String path = "c:/temp/assn2Files/";
    private JButton first, last, next, prev, save;
    private JTextField fn, mi, ln, t, s, y;
    private String[] title = {"analyst", "executive", "programmer", "project leader "};
    private JComboBox titleCombo = new JComboBox(title);
    private String[] department = {"Applications", "Payroll", "Accounting", "Marketing "};
    private JComboBox departmentCombo = new JComboBox(department);
    private JList pd;
    private String myArray[] = {""};
    private DbSource source = new DbSource("empdb", true);
    String action, selectedQName, selectedQDSN, selectedQString;
    private Vector vc, vc2, vc3, pdNames;
    private DbSource dbs = new DbSource("empdb", true);
    private DbSource dbs2 = new DbSource("empdb", true);
    private DbSource dbs3 = new DbSource("empdb", true);
    private DbSource dbs4 = new DbSource("empdb", true);
    public GUIDatabase() {
    super("Employee Interface");
    //set up menus
    JMenuBar menuBar = new JMenuBar();
    JMenu navMenu = new JMenu("Navigation");
    menuBar.add(navMenu);
    navMenu.add(ListeningMenuItem("First"));
    navMenu.add(ListeningMenuItem("Prev"));
    navMenu.add(ListeningMenuItem("Next"));
    navMenu.add(ListeningMenuItem("Last"));
    navMenu.add(new JSeparator());
    navMenu.add(ListeningMenuItem("Update employee record"));
    JMenu statsMenu = new JMenu("Statistics");
    menuBar.add(statsMenu);
    statsMenu.add(ListeningMenuItem("Employees per Department"));
    statsMenu.add(ListeningMenuItem("Employees per Project"));
    //menu goes on the root pane
    setJMenuBar(menuBar);
    //instantiates buttons with images instead of text
    first = new JButton(new ImageIcon(path + "First.gif"));
    last = new JButton(new ImageIcon(path + "Last.gif"));
    next = new JButton(new ImageIcon(path + "Next.gif"));
    prev = new JButton(new ImageIcon(path + "Prev.gif"));
    save = new JButton(new ImageIcon(path + "save.gif"));
    //tooltips for buttons
    first.setToolTipText("Go to First Record");
    last.setToolTipText("Go to Last Record");
    next.setToolTipText("Go to Next Record");
    prev.setToolTipText("Go to Prev Record");
    save.setToolTipText("Save File");
    //register frame to listen for buttons' action events
    first.addActionListener(this);
    last.addActionListener(this);
    next.addActionListener(this);
    prev.addActionListener(this);
    save.addActionListener(this);
    //set up toolbar and add componenets to it
    JToolBar myToolBar = new JToolBar();
    myToolBar.add(first);
    myToolBar.add(prev);
    myToolBar.add(next);
    myToolBar.add(last);
    myToolBar.add(save);
    add(myToolBar, BorderLayout.NORTH);
    //text fields
    JTextField fn = new JTextField(30);
    JTextField mi = new JTextField(30);
    JTextField ln = new JTextField(30);
    JTextField t = new JTextField(30);
    JTextField s = new JTextField(30);
    JTextField y = new JTextField(30);
    y.setEditable(false);
    //create the pd Jlist
    pdNames = new Vector();
    JList pd = new JList(pdNames);
    LabelComponent pdText = new LabelComponent("Project Description", pd);
    pd.addListSelectionListener(this);
    // pd = new JList(myArray);
    pd.setFixedCellHeight(20);
    pd.setFixedCellWidth(90);
    // pd.addListSelectionListener(this);
    //labels
    LabelComponent fnText = new LabelComponent("First Name", fn);
    LabelComponent miText = new LabelComponent("MI", mi);
    LabelComponent lnText = new LabelComponent("Last Name", ln);
    LabelComponent tCombo = new LabelComponent("Title", titleCombo);
    LabelComponent tText = new LabelComponent("Telephone", t);
    LabelComponent sText = new LabelComponent("Salary", s);
    LabelComponent dCombo = new LabelComponent("Department", departmentCombo);
    LabelComponent yText = new LabelComponent("Years in Service", y);
    // LabelComponent pdText = new LabelComponent("Project Description", pd);
    JPanel p1 = new JPanel();
    p1.setLayout(new GridLayout(9, 2, 1, 15));
    p1.add(fnText);
    p1.add(miText);
    p1.add(lnText);
    p1.add(tCombo);
    p1.add(tText);
    p1.add(sText);
    p1.add(dCombo);
    p1.add(yText);
    pdText.add(pd);
    // pdText.setEditable(false);
    //set layout for frame
    setLayout(new BorderLayout());
    add(p1, BorderLayout.EAST);
    add(myToolBar, BorderLayout.NORTH);
    add(pdText, BorderLayout.SOUTH);
    //set up the frame properties
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(470, 550);
    setLocationRelativeTo(null);
    setVisible(true);
    if (dbs2.isConnected()) {
    boolean two = dbs2.processQuery("select e.FirstName, e.middlename, e.lastname, e.title, e.workphone, format(e.salary, 'currency'), d.departmentname, e.yearsinservice from employees e, departments d", false);
    if (two) {
    vc = new Vector();
    while (dbs2.nextRecord()) {
    vc.addElement(dbs2.getField(4));
    titleCombo = new JComboBox(vc);
    if (dbs3.isConnected()) {
    boolean three = dbs3.processQuery("select distinct(departmentname) from departments", false);
    if (three) {
    vc2 = new Vector();
    while (dbs3.nextRecord()) {
    vc2.addElement(dbs3.getField(1));
    departmentCombo = new JComboBox(vc2);
    if (dbs4.isConnected()) {
    boolean four = dbs4.processQuery("select projectdescription from projects", false);
    if (four) {
    vc3 = new Vector();
    while (dbs4.nextRecord()) {
    vc3.addElement(dbs4.getField(1));
    pd.setListData(vc3);
    if (dbs.isConnected()) {
    boolean one = dbs.processQuery("select * from employees, departments", false);
    if (one) {
    while (dbs.nextRecord()) {
    fn.setText(dbs.getField(2));
    mi.setText(dbs.getField(3));
    ln.setText(dbs.getField(4));
    titleCombo.setSelectedItem(dbs.getField(5));
    t.setText(dbs.getField(6));
    s.setText(dbs.getField(7));
    departmentCombo.setSelectedItem(dbs.getField(9));
    y.setText(dbs.getField(8));
    //project descriptions method
    /* public Vector getProjectDescription() {
    String pdSQL = "Select projectDescription from projects;";
    source.processQuery(pdSQL, true);
    //create new vector for list of project descriptions
    pdNames = new Vector();
    while (source.nextRecord()) {
    pdNames.addElement(source.getField(3));
    return pdNames;
    JMenuItem ListeningMenuItem(String label) {
    JMenuItem mi = new JMenuItem(label);
    mi.setActionCommand(label);
    mi.addActionListener(this);
    return mi;
    public void valueChanged(ListSelectionEvent e) {
    throw new UnsupportedOperationException("Not supported yet.");
    /*public void valueChanged(ListSelectionEvent e) {
    //set text boxes, state combo box
    String infoSQL = "select * from employees";
    if (source.processQuery(infoSQL, false)) {
    while (source.nextRecord()) {
    fn.setText(source.getField(1));
    mi.setText(source.getField(2));
    ln.setText(source.getField(3));
    t.setText(source.getField(4));
    // s.setSelectedItem(source.getField(5));
    y.setText(source.getField(6));
    // pd.setText(source.getField(7));
    throw new UnsupportedOperationException("Not supported yet.");
    // class for a labeled component*/
    class LabelComponent extends JPanel {
    JLabel l;
    public LabelComponent(String s, Component c) {
    setLayout(new BorderLayout());
    l = new JLabel(s);
    l.setHorizontalAlignment(SwingConstants.CENTER);
    add(l, BorderLayout.WEST);
    add(c, BorderLayout.EAST);
    public void actionPerformed(ActionEvent e) {
    //get command
    // String command = e.getActionCommand();
    // action = e.getActionCommand();
    try {
    if (e.getSource() == first){
    // new dialog(this);
    source.firstRecord();
    /*if (command.equals("Save")) {
    String updateSQL = "UPDATE Employees"
    + " SET first_name = '" + fn.getText() + "',"
    + " middle_name = '" + mi.getText() + "',"
    + " last_name = '" + ln.getText() + "',"
    + " title = '" + titleCombo.getSelectedItem().toString() + "',"
    + " work_phone = '" + t.getText() + "'"
    + " salary = '" + s.getText() + "'"
    + " department = '" + departmentCombo.getSelectedItem().toString() + "'"
    + " yearsinservice = '" + y.getText() + "'";
    // + " projectdescription = '" + pd.getSelectedItem().toString() + "'"
    // + " WHERE Customer_ID = " + IDText.getText();
    /* source.processUpdate(updateSQL);
    pd.setListData(getProjectDescription());
    } catch (Exception a) {
    System.out.println(a.toString());
    throw new UnsupportedOperationException("Not supported yet.");
    public static void main(String args[]) {
    DbSource dbs = new DbSource("empdb", true);
    if (!dbs.isConnected()) {
    System.out.println("Connection Error: " + dbs.getErrorMessage());
    System.exit(1);
    GUIDatabase m = new GUIDatabase();
    m.setVisible(true);
    m.setLocationRelativeTo(null);
    m.setDefaultCloseOperation(EXIT_ON_CLOSE);
    PHP Code:
    package Assignment2;
    import java.sql.*;
    public class DbSource {
    public ResultSet rs;
    public ResultSetMetaData rsmd;
    public String error;
    public Connection con;
    public DbSource(String b, boolean a) {
    try {
    String dataSource;
    // connect to ODBC database
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //Evaluate connection type
    if (a) {
    dataSource = "jdbc:odbc:" + b;
    } else {
    dataSource = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + b;
    //get connection
    con = DriverManager.getConnection(dataSource, null, null);
    } catch (Exception e) {
    error = e.toString();
    public boolean isConnected() {
    //test for connection validity
    boolean x;
    try {
    if (con == null || con.isClosed()) {
    x = false;
    } else {
    x = true;
    return x;
    } catch (SQLException e) {
    error = e.toString();
    return false;
    public boolean processQuery(String sqlSelect, boolean s) {
    //process sql statement passed along with whether to allow bidirectional scrolling
    try {
    Statement stmt;
    if (s) {
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    }else{
    stmt = con.createStatement();
    //Formulate ResultSet
    rs = stmt.executeQuery(sqlSelect);
    //ResultSet MetaData
    rsmd = rs.getMetaData();
    catch (SQLException e) {
    error = (e.toString());
    rs = null;
    return false;
    return true;
    public int processUpdate(String sqlStatement) {
    // process Update
    try {
    int nbr = 0;
    Statement stmt = con.createStatement();
    nbr = stmt.executeUpdate(sqlStatement);
    return nbr;
    } catch (SQLException e) {
    error = e.toString();
    return -1;
    public boolean nextRecord() {
    //proceed to next record
    try {
    if (rs.next()) {
    return true;
    } else {
    return false;
    } catch (SQLException e) {
    error = e.toString();
    return false;
    public boolean prevRecord() {
    //move cursor back one record
    boolean a = false;
    try {
    if (rs.previous()) {
    a = true;
    return a;
    } catch (SQLException e) {
    error = e.toString();
    System.out.println("Start of File");
    return false;
    public boolean firstRecord() {
    // move cursor to first record
    try {
    rs.first();
    return true;
    } catch (SQLException e) {
    error = e.toString();
    System.out.println("End of File");
    return false;
    public boolean lastRecord() {
    //move cursor to last record in result set
    try {
    rs.last();
    return true;
    } catch (SQLException e) {
    error = e.toString();
    System.out.println("End of File");
    return false;
    public String getField(int x) {
    //get field from result set
    try {
    String a = rs.getString(x);
    return a;
    } catch (Exception e) {
    error = (e.toString());
    return null;
    public String getFieldName(int x) {
    //get field name in result set
    try {
    String a = rsmd.getColumnName(x);
    return a;
    } catch (SQLException e) {
    error = e.toString();
    return null;
    public String getFieldType(int x) {
    //get field type from meta data in result set
    try {
    String a = rsmd.getColumnTypeName(x);
    return a;
    } catch (SQLException e) {
    error = e.toString();
    return null;
    public int getFieldCount() {
    //get count of columns from metadata result set
    try {
    int a = rsmd.getColumnCount();
    return a;
    } catch (SQLException e) {
    System.out.println(e.toString());
    return -1;
    public void close() {
    //close connection
    try {
    con.close();
    } catch (SQLException e) {
    public String getErrorMessage() {
    return error;
    public String[] getTables() {
    //get table metadata info
    try {
    DatabaseMetaData dbmd = con.getMetaData();
    String[] tables = {"TABLE"};
    rs = dbmd.getTables(null, null, null, tables);
    int nbrRows = 0;
    while (rs.next()) {
    nbrRows++;
    String[] tblNames = new String[nbrRows];
    rs = dbmd.getTables(null, null, "%", tables);
    nbrRows = 0;
    while (rs.next()) {
    tblNames[nbrRows] = rs.getString(3);
    nbrRows++;
    return tblNames;
    } catch (Exception e) {
    error = e.toString();
    return null;
    public String resultSetToXML() {
    //turn result set to XML formatting
    String rsToXML = "";
    try {
    rsmd = rs.getMetaData();
    // begin to write XML document
    rsToXML += ("<?xml version="1.0\"?>\r\n");
    // Root node
    rsToXML += ("<ResultSet>");
    // get metadata into XML document
    rsToXML += (" <MetaData>");
    for (int i = 1; i <= getFieldCount(); i++) {
    rsToXML += (" <Column>" + getFieldName(i) + "</Column>");
    rsToXML += (" </MetaData>");
    // get data into XML document
    rsToXML += (" <Data>");
    while (rs.next()) {
    rsToXML += (" <Row>");
    for (int i = 1; i <= getFieldCount(); i++) {
    rsToXML += (" <" + getFieldName(i) + ">"
    + rs.getString(i)
    + "</" + getFieldName(i) + ">");
    rsToXML += (" </Row>");
    rsToXML += (" </Data>");
    rsToXML += ("</ResultSet>");
    } catch (Exception e) {
    error = e.toString();
    return rsToXML;
    }

    805487 wrote:
    it is a lot of code but i just need to figure out how to get to the next record under the action performed. Thank you for your time!!!It's too much code and it's unformatted. Put tags on both sides of the code (check that it works with the preview button), then ask an exact question (none of those "I don't know what to do" ones).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Create NEXT RECORD button on form

    I want to create a NEXT RECORD and PREVIOUS RECORD button on my form. how do I do this so that the buttons are function.

    Review the discussions at
    http://forums.oracle.com/forums/search.jspa?threadID=&q=get+next+record+process&objID=f137

  • Next record on Business Document Forms

    Hi all,
    I would like to make some settings on Business Document Forms regarding the current showing record. How will I know another record is presented to the user in the form? (E.g. user clicks Next/Previous etc.)
    Version: 2004 C, PL 49
    Thank you for your suggestion
    Best regards,
    Daniel Martinec

    Hi Daniel,
    I'm not aware how the 2004 C version behaves. I'd never tried to use the datasource load (there must be datasources to load in order to let this work).
    I'd rather suggest to capture the menuclicks.
    <b>Code (C#):
    public void HandleMenuEvents(ref MenuEvent pVal, out bool BubblesEvent)
      /* Previous or next records */
      if(((pVal.MenuUID == "1288") || (pVal.MenuUID == "1289") || (pVal.MenuUID == "1290") || (pVal.MenuUID == "1291")) && !pVal.BeforeAction && (SBO_Application.Forms.ActiveForm.Type == YOUR_FORM_TYPE))
        /* ADD YOUR LOGIC HERE */
    Hope it helps...
    Rowdy

  • Move to next record / wildcard search

    Hi
    Hope you can understand this explanation..
    I have searchable database for Holiday & Residential
    property here
    http://www.roomtobreathesl.com
    (search facility in the navigation menu)
    The results page for this search works fine for when you
    specify a certain
    area, certain amount of beds etc as it only shows a small
    amount of
    properties.
    However when you do a search for any area / any amount of
    rooms / any type,
    the query brings up over 40 results, so a move to next record
    is used. This
    is where the problem lies. You cannot move to next record as
    the 'Next
    record' link is looking for another wildcard search (see
    status bar).
    Any ideas how to remedy this?
    Thanks for any help
    Gary

    oops!
    Sorry sent you the previous version that's online.
    I also tried doing a search and replace and changing all
    'Request.Form' to
    'Request'
    Still didn't work.
    This is how it was when it wasn't working.
    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/YotShop6.asp" -->
    <%
    Dim rsResults__MMColParam
    rsResults__MMColParam = "1"
    If (Request("yscon") <> "") Then
    rsResults__MMColParam = Request("yscon")
    End If
    %>
    <%
    Dim rsResults__ysbed
    rsResults__ysbed = "1"
    If (Request("ysbed") <> "") Then
    rsResults__ysbed = Request("ysbed")
    End If
    %>
    <%
    Dim rsResults__MMColParam3
    rsResults__MMColParam3 = "xyz"
    If (Request("type") <> "") Then
    rsResults__MMColParam3 = Request("type")
    End If
    %>
    <%
    Dim rsResults
    Dim rsResults_numRows
    Set rsResults = Server.CreateObject("ADODB.Recordset")
    rsResults.ActiveConnection = MM_YotShop6_STRING
    rsResults.Source = "SELECT * FROM YotStock WHERE Area LIKE '"
    +
    Replace(rsResults__MMColParam, "'", "''") + "' AND bedrooms
    LIKE '" +
    Replace(rsResults__ysbed, "'", "''") + "' AND type LIKE '" +
    Replace(rsResults__MMColParam3, "'", "''") + "' ORDER BY
    price ASC"
    rsResults.CursorType = 0
    rsResults.CursorLocation = 2
    rsResults.LockType = 1
    rsResults.Open()
    rsResults_numRows = 0
    %>
    "Julian Roberts" <[email protected]> wrote in message
    news:euj4if$ici$[email protected]..
    >>> Use Request instead of Request.Form for runtime
    parameters.
    >
    > You haven't done it :)
    >
    > --
    > Jules
    >
    http://www.charon.co.uk/charoncart
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >
    >
    >

  • User Interface : position for previous/next links when browsing spreadsheet

    Hello,
    When you have a reasonable number of columns to display the html page width can be quite large. So you have to scroll right to get the previous/next set of records hyperlinks controls because by default they are located at the bottom right corner of the spreadsheet. This is not very user friendly.
    Is there a mean to specify a different location for the previous/next set of records hyperlinks controls ?
    Thanks in advance for your response. It will considerably enhance my apex experience.

    Yes, the "Pagination Display Position" lets you control where the pagination shows up. So you could put it top left, top right, bottom left, bottom right. IMHO there are pros and cons to each position.
    Mike

  • Want to display Previous-Next on JspDynpage

    Hi All,
    I want to achieve following thing in JSPDYNPAGE.
    [Previous] [Next]
    I have already achieved for page numbers.
    Also to some extent Next is coming but it is directly taking me to the last page.
    the code i have used is:
    <tr>
         <td>
             <DIV class=rstats align=left>
             <P class=pn>
             Pages |
             <%if(myBean.getPageno()==0){%>
                <SPAN>1</SPAN>
             <%}else
                   String call=callPortalComponent1+"?tableid=0&cityid="+myBean.getCityid()+"&searchid="+myBean.getSerachid()+"&flag1=Y";
             %>
                  <A href="<%=call%>">1</A>
                  <%}%>
               <%
               for(int i=1;i<=liRecords/10; i++)
                   String call=callPortalComponent1+"?tableid="+(10*i)+"&cityid="+myBean.getCityid()+"&searchid="+myBean.getSerachid()+"&flag1=Y";
                    %>
                <A href="<%=call%>"><%=i+1%></A>
                <%
                } // end of for loop
                %>
               <!-- for next records -->
                <%
                        String call="";     
                     int i;
                          for (i=1;i<=liRecords/10;i++)
                               call = callPortalComponent1+"?tableid="+(10*i)+"&cityid="+myBean.getCityid()+"&searchid="+myBean.getSerachid()+"&flag1=Y";           
                             //out.println("Value of I:"+i);
               %>
                        <%
                             if(myBean.getPageno()==10)
                                  %>
                                  <A href="#"></a>
                                  <%
                                  break;
                             else
                        %>
                             <A href="<%=call%>">Next</a>
                        <%
                        %>              
                <!-- for Next -->
                <!--<A href="http://www.yellowpages.co.in/search_result2.php?category=Tours &amp; Travels - Automobile Hirers&amp;category_id=T15700&amp;city_id=18&amp;search_query=bus&amp;city=All+Cities&amp;page_no=2">Next</A> -->
                </P>
             <BR>
        </DIV>
        </td>
        </tr>
    looking for your answers....
    Regards,
    Dhruv Shah

    Hi,
    As the code is pasted you just have to take an Integer variable and has to play with it on the base of mybean.getPageNo()
    Hope now you will be satisfied.
    Regards,
    Dhruv

Maybe you are looking for