Create a link in a table calls sql statement

Hello,
I'm very new to htmldb but need to complete a project within a tight timeline. I created a sql report in a region. On each row, I have an on/off link, which used to trigger a sql statement. It turns a flag on and off in a table. Key needs to be passed with the link to be used in sql. How do I passed the key in the link and how can I call the sql statement? Where can I put the sql statement? Can someone give me some tips?
Your help is greatly appreciated!
Jun

if you take a look at the "Understanding URL Syntax" section in chapter 6 of our User Guide, you'll see that you can set item values in html db via the URL by passing name/value pairs through the url. to see it in action, use our "Report with links to form on a table (2 Pages)" wizard to generate a form and a report on some table of yours. when you run that report page and click an edit link on it, you'll see how it passes its values to the form page using our URL syntax. in your case you'd want to create an item like MY_PROD_KEY_ITEM and set its value via your link. you'd then run your pl/sql block referring to the value of that item. when doing so, you'd probably want to use the bind variable syntax that's also explained in chapter 6, "Referencing Session State".
--raj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to call SQL statements in InDesign CS6?

    Hi,
         My plug-in needs to interact with the database, and update the database content, how should I do, can I call SQL statements in InDesign CS6?
         Thanku very much.

    The same way you'd call them from any C++ program. You don't mention which platform, and that probably makes a difference.
    I'm accessing an SQL database in InDesign CS6 on Windows. I'm using the ODBC interface to SQL database that Windows provides, via the nanodbc wrapper. So I'm linking to odbc32.lib and odbccp32.lib, and including the nanodbc.cpp and nanodbc.h files. (See http://lexicalunit.github.io/nanodbc/ )
    Paul.

  • How to create hyper link to normal table field in webdynpro ABAP

    HI Experts,
    I am working on one Webdynpro Application where I am displaying Vendor information in normal table.
    But I wanted to make LIFNR field of the table as Hyper Link and when I click on that particular LIFNR  I wanted navigate that to XK03 transaction. Please help me out from this...
    When I searched in SDN I am geeting examples to create Hyper Links in ALV but I wanted to create that for normal table field.
    Thanks
    Basanagouda

    Hi,
    As you kept the Link to action.. Go to the Outline of the view and navigate to the to the newly inserted Link to action UI element in the View. Now see the properties window. In the properties you will find the category Events and in this you will have OnAction. You can create a new on action by clikcing on the button which is next to the input filed.
    This will create a method and in this implementaion you can write the logic to navigate to the Transaction.
    Regards,
    Raju Bonagiri

  • How to Create file link from dynamic table.

    Howdy -
    I have MySQL database over PHP containing a simple table that lists a group of documents, including their file system address (contained within the site).
    I've successfully created a recordset showing this table, and attached that to a dynamic table on a .php page.  The display is correct, except I can't get the column contents to link to the document.  The column just shows the text (title) of the document.
    I've consulted article tn_15364 (http://kb2.adobe.com/cps/153/tn_15364.html), but that doesn't seem to work...
    Any thoughts would be appreciated.  I'm sure this is pretty simple, but I'm coming up snake eyes.
    Charles Andrews

    To clarify:
    My site has a folder where uploaded files (.doc, .xls, .pdf, etc.) are stored after having been uploaded by a user.  During this upload process, the location of these files is stored, along with other identifying data, in a simple database table.
    I have a dynamic table created in Dreamweaver that pulls from this database, listing the document name, etc. I would like the document name shown in a column to automatically link to the actual file so a user could just click on it and open the file.
    I hope I'm not making sound more complicated than it is -
    Thanks,
    CWA

  • Creating a DataTable from the results of SQL statement

    I am relatively new to VB 2005, ADO and Oracle db. I have perfected an SQL statement that joins 6 tables in an Oracle 10i database and the resulting set retunrs the correct data. I am having difficulty creating and inserting this resulting set into a datatable that could be used in my application. Could someone detail the steps needed to create and fill this table

    http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a89856/06_ora.htm#1604
    The link above points to Oracle's documentation on using cursor variables. In a nutshell, you want to create a package that defines the cursor type and contains the procedure to open the cursor.
    create package my_package as
    type my_cursor_type is ref cursor;
    procedure my_procedure (out_cursor out my_cursor_type);
    end;
    create package body my_package as
    procedure my_procedure (out_cursor out my_cursor_type) is
    begin
         open my_cursor for
              select ...;
    end;
    end;Now you need to set up your .NET application to read the data.
    OracleConnection con = new OracleConnection("User Id=myuser;Password=mypassword;Data Source=mydatabase");
    OracleParameter[] parms = new OracleParameter[1];
    parms[0] = new OracleParameter("table1_cursor", OracleDbType.RefCursor, ParameterDirection.Output);
    OracleCommand cmd = new OracleCommand("my_package.my_procedure", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(parms);
    DataTable myTable = new DataTable();
    OracleDataAdapter da = new OracleDataAdapter(cmd);
    da.Fill(myTable);

  • Populating JTable table from sql statement.

    Trying to teach myself a combanation of things. Since Oracle is my background java to oracle is only a natural. Now this code I'm trying to select some rows and then display those rows in a table. Simple concept as a teaching aid to me. I won't go into what I went through to get this far, just say there have been quite a few fall starts. Now this code works; however it returns ten rows (one for each tablespace) and displays row 1 ten times. Not quite what I had in mind.
    I have got a simple select statment in my code:
    select tablespace_name,initial_extent,next_extent,pct_increase, status
    from dba_tablespaces order by tablespace_name
    package TableTest;
    // java imports
    import java.util.Vector;
    import java.awt.event.*;
    import java.awt.Toolkit;
    import java.awt.*;
    import javax.swing.*;
    // sql imports
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    public class TableTest extends JFrame
      Connection conn;  // database connection object
      Statement stmt;   // statement object
      ResultSet rslt;   // result set object
      //private vars
      private String userName         = "bubbalouie";
      private String password         = "helpmeimsinking";
      private String sid              = "rob";
      private String port             = "1521";
      private String server           = "w2sd001";
      private String connectString    = "jdbc:oracle:thin:@"+server+":"+port+":"+sid;
      private int numCols             = 5;
      private String sqlStmt          = null;
      private String status           = null;
      public TableTest()
        // Get content pane
        Container contentPane = getContentPane();
        // set layout manager
        contentPane.setLayout(new BorderLayout());
        // create some places to put dat
        Vector data    = new Vector();
        Vector columns = new Vector();
        Vector colHeads = new Vector();
        colHeads.addElement("tablespace name");  // this is ugly fix later
        colHeads.addElement("initial extent");
        colHeads.addElement("next extent");
        colHeads.addElement("pct increase");
        colHeads.addElement("status");
        // construct a simple sql statement
        sqlStmt = "select  tablespace_name, initial_extent, next_extent, pct_increase, status";
        sqlStmt = sqlStmt+" from dba_tablespaces order by tablespace_name";
        try
          // connect to database
          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
          Connection conn = DriverManager.getConnection(connectString, userName, password);
          // select data into object
          stmt = conn.createStatement();
          rslt = stmt.executeQuery(sqlStmt);
          while (rslt.next())
            for ( int i=0; i<numCols; i++ )
              columns.addElement(rslt.getObject(i+1));  // get the i+1 object
            }  // end for
            data.addElement(columns);
          }    // end while
          // create the table
          JTable table = new JTable(data,colHeads);
          // add table to scroll pane
          int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
          int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
          JScrollPane jsp = new JScrollPane(table,v,h);
          // Add scroll pane to content pane
          contentPane.add(jsp, BorderLayout.CENTER);
        } catch (SQLException ex)
          String msg = "SQL error: "+ex.toString();
        } catch (Exception ex)
          String msg = "Error: "+ex.toString();
      }                                     // end constructor
      public static void main(String[] args) {
          TableTest frame = new TableTest();
          frame.setSize(500, 400);
          frame.setTitle("TableTest");
          frame.setVisible(true);
    }  // TableTest end class

    if you are interested here is a generic table model for displaying ResultSets in a JTable. The resultset needs to support calling resultset meta data and the basic methods in there but then it should support anything you give it.
    import java.sql.*;
    import java.util.*;
    import javax.swing.table.*;
    public class ResultSetTableModel extends AbstractTableModel{
      Vector rows;          
      int[] types;          
      String[] names;     
      public ResultSetTableModel(ResultSet rs)throws SQLException{
        ResultSetMetaData rsmd = rs.getMetaData();          
        types = new int[rsmd.getColumnCount()];          
        names = new String[rsmd.getColumnCount()];          
        for(int n=0;i<types.length;n++){               
          types[n] = rsmd.getColumnType(n+1);
          names[n] = rsmd.getColumnName(n+1);     
        rows = new Vector();
        while(rs.next()){
          Vector aRow = new Vector();
          for(int j=0;j<types.length;j++){
               switch(types[j]){
              case Types.TINYINT:
                aRow.addElement(new Byte(rs.getByte(j+1)));
                break;
              case Types.SMALLINT:
                aRow.addElement(new Short(rs.getShort(j+1)));
                break;
                 case Types.INTEGER:
                   aRow.addElement(new Integer(rs.getInt(j+1)));
                   break;
                 case Types.BIGINT:
                   aRow.addElement(new Long(rs.getLong(j+1)));
                   break;
                 case Types.REAL:
                   aRow.addElement(new Float(rs.getFloat(j+1)));
                   break;
                 case Types.FLOAT:
                   aRow.addElement(new Double(rs.getDouble(j+1)));
                   break;
                 case Types.DOUBLE:
                   aRow.addElement(new Double(rs.getDouble(j+1)));
                   break; 
                 case Types.DECIMAL:
                   aRow.addElement(rs.getBigDecimal(j+1));
                   break;
                 case Types.NUMERIC:
                   aRow.addElement(new Long(rs.getLong(j+1)));
                   break;
                 case Types.BIT:
                   aRow.addElement(new Boolean(rs.getBoolean(j+1)));
                   break;
                 case Types.BINARY:
                   aRow.addElement(rs.getBytes(j+1));
                   break;
                 case Types.DATE:
                   aRow.addElement(rs.getDate(j+1));
                   break;
                 case Types.TIME:
                   aRow.addElement(rs.getTime(j+1));
                   break;
                 case Types.TIMESTAMP:
                   aRow.addElement(rs.getTimestamp(j+1));
                   break;           
                 default:
                   aRow.addElement(rs.getString(j+1));
          rows.addElement(aRow);           
      public Class getColumnClass(int column){
        switch(types[column]){
          case Types.BIT:
            return Boolean.class;
          case Types.DATE:
            return java.sql.Date.class;
          case Types.TIME:
            return java.sql.Time.class;
          case Types.TIMESTAMP:
            return java.sql.Timestamp.class;
          default:
            return Object.class;     
      public int getRowCount(){
        return rows.size();     
      public int getColumnCount(){
        return types.length;     
      public Object getValueAt(int row, int column){
        Vector aRow = (Vector) rows.elementAt(row);
        return aRow.elementAt(column);
      public String getColumnName(int column){
        return names[column];
    }

  • Self referencing table and SQL statement

    In my database, I have a self-referencing table, the table itself is for projects, and it allows users to get a hierarchical view of the company.
    Here is the SQL (modifier is the term we use for project code, BBCI is the top project)
    SELECT
    modifier, modifierDescription, level
    FROM
    modifier
    WHERE
    level <= 2
    CONNECT BY PRIOR
    modifier = parentModifier
    START WITH modifier = 'BBCI'
    ORDER BY level
    That perticular query gets the first two levels in the structure. I use this information to produce a tree structure in a web app.
    But users have requested it would be good if in the tree structure is showed an + or - depending on whether there were anymore children under each parent, or better still the number of children under it, for example
    BBCI
    + BBCI_CHILD
    + BBCI_CHILD2
    - BBCI_CHILD3
    or
    BBCI
    + BBCI_CHILD (3 projects underneath)
    + BBCI_CHILD2 (2 projects underneath)
    - BBCI_CHILD3 (0 projects underneath)
    I am really stumped on this issue, and I am sure there is a way to do this in the web app, so for example do a query for each child node to see how many child nodes are underneath, but I figure it would be a lot tidier and faster if I could do it from a single SQL statement. Unfortunately I have tried to do this and am very much stuck.
    If you need more information please let me know
    Thanks!
    Jon

    You may be able to do this using analytical functions but it depends on the Oracle version you are using. It can also be done with standard SQL - you just need to count the number of child rows for each modifier/project first and supply that list as an in-line view:
    SELECT decode(modifier,'X',null,decode(child_rows,null,'-','+')),
    m.modifier,
    decode(modifier,'X',null,'('||nvl(cq.child_rows,0)||' projects underneath)')
    FROM modifier m,
    (select parentModifier,
         count(parentModifier) child_rows
    from modifier
    where parentModifier is not null
    group by parentModifier) cq
    WHERE m.modifier=cq.parentModifier(+)
    AND level <= 2
    CONNECT BY PRIOR
         m.modifier = m.parentModifier
    START WITH modifier = 'X'
    ORDER BY level, modifier;
    which gives you something like...
    D MODIFIER DECODE(MODIFIER,'X',NULL
    X
    - Y1 (0 projects underneath)
    + Y2 (2 projects underneath)
    + Y3 (3 projects underneath)
    The decode stuff is just to show you the result, you can format the output in your calling code. Just extend the columns to include everything you want, modifierDescription etc..
    Hope this helps.

  • Call sql statement from JComboBox component

    Hi there,
    I Have created a frame to populate two JComboBoxs, I'm populating the first one from a database using SQL, this datable is showing the category to below every report.
    anybody know how can I select from my first JComboBox a record a call a second SQL statement acutomatic, the idea is populate me second JCombox with data like my first one, remember the first one is a header

    With a JComboBox you have to be careful that you don't run a query when just the cursor is moved up or down the list. If you want the listener to fire just when enter is pressed or the mouse is clicked, then do this:
    //This stops events being fired when the cursor is used on the list
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);You should also attach an event listener like this one:
    comboBox.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                            executeSomeQuery(comboBox.getSelectedItem().toString());               }
              });Or something similar to above, have a play around with it and it should work how you want it to.
    Message was edited by:
    JStudent911

  • Is it possible to create a physical DS from an insert SQL statement?

    Hi,
    From the ALDSP docs I came to know we can create a physical data service from a select SQL statement. Can we use an insert statement to create a physical data service? we dont want to use stored procedure for this.
    Please help.
    Thanks,
    Leela

    When you create a physical data service from a database table, the data service will contain a create<tableName> procedure. That procedure will execute an insert statement for the table.

  • Calling SQL statements from Shell scripts

    Hi,
    I want to call external package procedures, declare some variables & do some oracle validations in the shell script.
    How SQL environment is set in shell script & is this one time process or I have to write few statements before every SQL statement.
    Please explain with an example.
    Thanks..

    is this one time process Yes. Example :
    $ cat script.sh
    export ORACLE_HOME=/home/oracle/base/OraHome10
    export ORACLE_SID=db102
    export PATH=$ORACLE_HOME/bin:$PATH
    sqlplus -s / as sysdba << EOF
    select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') date_time
    from dual;
    exit
    EOF
    sqlplus -s / as sysdba << EOF
    col global_name for a60
    select * from global_name;
    exit
    EOF
    $ ./script.sh
    DATE_TIME
    27/02/2008 11:11:27
    GLOBAL_NAME
    DB102
    $

  • How to link oracle dba_users table with SQL's sysusers and syslogin tables?

    I need to validate that the username present in the Oracle's dba_users table is the same as SQL's sysusers's isNTUSER and syslogin's name columns. How to achieve this? Someone please help me out. Thanks.

    refer these three link for information.
    http://www.oracleappshub.com/release12/r12-sla-analyzing-subledger-accounting/
    http://www.oracleappshub.com/release12/r12-sla-from-product-accounting-to-subledger-accounting/
    http://www.oracleappshub.com/release12/know-the-changes-because-of-r12-oracle-payment-module-fund-disbursement-in-ebs/

  • Calling SQL statement from a script problem

    Hello,
    I have a script e.g query.sh:
    #!/bin/sh
    sqlplus -s ${ORACLE_USER} << HIC
    set heading off
    set newpage none
    SELECT 'ALTER TABLE '||'TEST_TABLE'||' ADD PARTITION '||' P'|| TO_CHAR(TRUNC(sysdate+7), 'IYYY')||'W'|| TO_CHAR(TRUNC(sysdate+7), 'IW')||' VALUES LESS THAN(TO_DATE('''|| TO_CHAR(sysdate + 14, 'YYYYMMDD')||''',''YYYYMMDD''));' FROM DUAL;
    exit
    HIC
    This will actually give me: ALTER TABLE TEST_TABLE ADD PARTITION P2010W46 VALUES LESS THAN(TO_DATE('20101122','yyyymmdd'));
    I am executing this output from the second script. e.g create_part.sh
    #!/bin/sh
    SQL=`/home/bill/scripts/query.sh`
    sqlplus ${ORACLE_USER} << EOF
    set serveroutput on size 1000000
    set heading off
    $SQL
    exit
    EOF
    When I am running the 2nd script I am getting:
    SQL> SQL> SQL> SQL> 2 ALTER TABLE test_table ADD PARTITION P2010W46 VALUES LESS THAN(TO_DATE('20101122','yyy
    ERROR at line 1:
    ORA-01861: literal does not match format string
    I suspect that the output from the 1st script wraps to a second line, and it failes to execute properly.
    Oracle is 9i
    Please suggest a way to overcome this problem.
    Thank you in advance.

    If you are not passing in any variable values that you need the shell to substitute intot he source then placing the SQL into a separate .sql file and then just using start scriptname from the shell can simplify the code especially if any shell script meta-characters like '$' appear in the SQL. Otherwise you have to escape the meta-characters.
    sqlplus /nolog <<EOF
    start script_name
    exit
    EOF
    It is also possible to write the sqlplus script to accept substitution variable from the caller so the line above would look like start script_name $var1 $var2
    HTH -- Mark D Powell --

  • Create object type from multiple tables for select statement

    Hi there,
    I have 3 tables as given below and I wish to create an object type to group selected columns as 'attribute' from multiple tables. 
    I need to create 2 input parameters to pass in - 'attribute' and 'attribute value'  in PL/SQL and these 2 parameters will be
    passing in with 'column name' and 'column value'.  e.g. 'configuration' - the column name, 'eval' - the column value.
    Then, the PL/SQL will execute the select statement with the column and column value provided to output the record. 
    Pls advise and thank you.
    table ccitemnumber
    name                           null     type                                                                                                   
    ccitemnumber                   not null varchar2(20)                                                                                                                                                                                    
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    table productmodel
    productmodelnumber             not null varchar2(6)                                                                                            
    description                             varchar2(60)  
    accesstimems                            number                                                                                                 
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    table topmodel
    stmodelnumber                  not null varchar2(30)                                                                                           
    productfamily                           varchar2(60
    formfactor                              varchar2(10)                                                                                           
    modelheight                             varchar2(10)                                                                                           
    formattedcapacity                       number                                                                                                 
    formattedcapacity_uom                   varchar2(20)
    object type in database
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    modelheight                             varchar2(10)
    formattedcapacity                       number                                                                                                 
    formattedcapac

    user12043838 wrote:
    Reason to do this as these fields are required to be grouped together as they are created in different tables. They are treated as 'attribute' (consists of many columns) of the part number. So, the PL/SQL is requested to design in a way able for user to pass in the column name and column value or part number, then the select statement should be able to query for the records. Another reason is a new column can be added easily without keep modifying those effected programs. Reuseable too.This basically equates to ... hard to code, hard to maintain, and poor performance.
    Are you really sure you want to do this? This isn't going to be easy-street as you seem to think it is, but it's a one way street to a poorly performing system with security vulnerabilities (google SQL Injection).
    I would highly recommend you reconsider your design decision here.

  • How to create a linked server to SQL in Oracle?

    I am able to create a linked server to Oracle in SQL.. But I do not know the steps to create a linked server too SQL in Oracle.
    How to create a linked server to SQL in Oracle? After creating the linked server to SQL, I would like to create triggers in Oracle DB to insert records into SQL DB.

    There are 2 products in Oracle you can use to link to a MS SQl Server. The first one is for free and it is called Database Gateway for ODBC. With a suitable 3rd party ODBC driver you can connect to any foreign database. The second gateway is our commercial gateway and it is called Oracle Database Gateway for MS SQL Server. It is designed for MS SQl Server connections and more powerful then Dg4ODBC. It know how to map a lot of Oracle functions to SQL Server equivalents and you can also use it to directly call SQL Server procedures or functions. This dedicated SQL server gateway is also able to participate in distributed transactions.
    But again, this is a commercial gateway and you have to purchase a license for that second gateway, the Database Gateway for MS SQl Server.
    - Klaus

  • Create a link to a specific spot in PDF document

    Is it possible to create a link from a Table of Contents item to a specific heading on a page within the same document. So far from what I've read and what I've tried I can only link to a specific page but not a specific section on that page. Is that possible? If so how to I do that? It's basically the same idea as HTML anchor links within the same HTML page. So if you have a links up top you can create named anchors for the destination spot later on down the page. I tried using the destinations in Acrobat also but it seems to also only point to the page, not the specific area on a page.
    If anyone knows if that's possible, could you either show me how to do it or point me to a tutorial online that shows how to do that. I've searched and searched but just cannot seem to find anything. Maybe I'm not using the right keywords to search.

    You can either link to an existing named destination or a view that you establish when you create the link. A named destination is a combination of a page and the view settings (e.g., fit width, fit visible, 200% zoom and scrolled 1/4 way down the page, etc.)
    When you add a new named destination, go to the page you want and set up the display of the page to what you want. Give the named destination a meaningful/descriptive name.
    When you create the link that you want to target a named destination, select an action of "Go to a page view" and set it to the current view. You then have to go and edit the action and select "Use Named Destination" and select from the list of named destinations in the document.
    You do not need to set up named destinations to link to a specific area of a page, but they are helpful when linking from other documents or systems, particularly if the document that's linked to changes with any frequency.
    To set up the same type of link without using named destinations, just add a new link and when you're presented with the "Create Link" dialog, select "Go to a page view" and navigate to the corresponding page, set the view you want, and click the "Set Link" button.

Maybe you are looking for