Anyway, to remove the column names in the result of the query of SQLPLUS

Hello

I am using sqlplus to run a script that returns results with the column names.

Anyway is to omit the names of columns in the result of the sqlplus query?

I would like to have only results with their column names in the output.

Thanks in advance!

Hello

Maybe your LINES (IZE) is not defined?

SCOTT>set lines 130
SCOTT>select status, machine, module
  2    from v$session
  3   where upper(username) = 'SCOTT';

STATUS   MACHINE                                                          MODULE
-------- ---------------------------------------------------------------- ------------------------------------------------
INACTIVE PFAE3\VPC4894-03                                                 TOAD 9.7.2.5
ACTIVE   PFAE3\VPC4894-03                                                 SQL*Plus

2 rows selected.

SCOTT>

As an alternative to the linesize parameter, you can format the columns:

SCOTT>set lines 80
SCOTT>col status for a8
SCOTT>col machine for a30
SCOTT>col module for a30
SCOTT>select status, machine, module
  2    from v$session
  3   where upper(username) = 'SCOTT';

STATUS   MACHINE                        MODULE
-------- ------------------------------ ------------------------------
INACTIVE PFAE3\VPC4894-03               TOAD 9.7.2.5
ACTIVE   PFAE3\VPC4894-03               SQL*Plus

2 rows selected.

SCOTT>

Concerning
Peter

Tags: Database

Similar Questions

  • possible to remove the query hint?

    The next tip gets injected into some of my questions intended only to return one row, when removed the query executes immediately. With the indicator, it takes 5-10 seconds to the process and its liveliness with synchronized methods causing issues.

    / * + FIRST_ROWS * /.

    I tried the following:

    Query ReadAllQuery = new ReadAllQuery (obj.getClass ());
    query.setHintString (null);

    MaxRows or firstResult the assignment will result, on platforms that support it, the SQL generated to include the paging/filtering database. On the OraclePlatform, the pagination for the method code, this includes the / * + FIRST_ROWS * / tip. You can create a custom DatabasePlatform that extends the OraclePlatform and override the method printSQLSelectStatement with the same logic but change or omit the printer.printString (HINT); line.

    Another option is to disable the RownumFiltering completely on the DatabasePlatform via the setShouldUseRownumFiltering method, but it could affect performance when you use the method/firstresult, as it will rely on JDBC pagination via the statement setMaxRows() and absolute() methods of the set of results that are generally much less effective.

    Best regards
    Chris

  • Having a column name as a variable in a query, problem!

    I have a problem with a simple query below


    SELECT * FROM DisneyWHERE Upper (COLNAME) AS SUPERIOR ('%' |) SEARCHSTRING. '%'); SELECT * FROM Disney
    WHERE Upper (COLNAME) AS SUPERIOR ('%' |) SEARCHSTRING. '%');

    My problem, the variable of column name is not recognized as a column for example name
    A user can select to display a set of characters from the database by user name, movies, etc (they selecting this function since a combobox), they then enter a search string (textbox)
    column name = user name
    SearchString = pluto

    SELECT * FROM Disney
    WHERE Upper (COLNAME) AS SUPERIOR ('%' |) SEARCHSTRING. '%');

    The problem is orac; e does not seem to be picking up this column name is a column name and seems to be a simple comparison. To make this more clear

    It "seems to match the username = pluto
    instead of find pluto in the username column.

    Someone at - it ideas how I can get around this. I have a strange feeling, it's something to do with pl/sql dynamic, but I am new to oracle, so I have no idea of how to write dynamic queries. Any help would be appreciated muchly

    I'm using oracle 11g and visual studio .net 2005

    user10372910 wrote:
    But it wouldn't just look for each column I'm sorry if I seem stupid that I have only just introduced to oracle and I used to use sql

    Sort of Yes and no.

    If colname is 'film' and the search string 'star wars' is the place where actually takes the clause...

    WHERE username as username
    AND the movie like 'star wars % % '.

    If username is not limited in any way and it limits just on film.

    Conversely if the column name is "username" and the search string is 'Bob Smith' then where clause evaluates actually to...

    WHERE username like ' %% of Bob Smith.
    AND the film as film

    then move is not limited in any way and simply limits on the user name.

  • Remove the expand/collapse TOC icon

    Is anyway to remove the collapse icon in the menu table of contents that I would use my own icon table of contents somewhere else?

    Alternatively, you can replace them with a transparent GIF or PNG file.  Then the buttons would be invisible to the user.

  • Required radio buttons, in any case to remove the red outline once verified?

    I have a PDF I'm putting in LC who has couple dozen yes/no radio button questions. I have these pairs of radio button each required entry. My question is when a player fills the PDF file with 'fields to highlight' turned on, once they select Yes or no on one of the questions that the red border 'entry required' stay on unselected option.

    For example; Do you like PDF? [x] YES [] NO * required entry

    yesno.jpg

    However even if the 'Yes' option box is checked the opposite of 'no' radio button in the same group remains highlighted in red because it is a required entry. On the group selection has already been made, so my question is anyway to remove the red outline, after making a selection in this group of radio buttons.

    Thanks a ton!

    Hello

    The only real control for required fields highlight color is enable or disable. See example here: http://bit.ly/e3bTJF.

    Different versions of Acrobat/Reader deal with mandatory radio buttons. Acrobat v9 describes the group with a rectangle.

    If the objects are radio buttons, I would stick with circle shape by default users will be familiar with the form and feel that they can select one of the choices. The use of a square shape means that they may make more than one selection.

    Niall

    Ensure the dynamics

  • How to remove the name of the column in the select clause

    Hello guys,.

    I want to just delete a column name in the select clause. Because I don't want to write all the names of columns. I hope I am.

    In other words, I want the following.
    Select   * - unwanted_column  from table;
    
    instead of this 
    
    Select col1, col2, col3, col4, ........ col 10000 from table;

    Hello

    There is nothing in SQL, which means "all columns * except *...» ». As others have said, the only way to achieve these results in SQL is to list all the columns you want.

    Your front end may have a feature that allows you to hide a specific column. For example, in SQL * Plus, you can use COLUMN... NOPRINT , like this:

    COLUMN      dname     NOPRINT
    
    SELECT       *
    FROM       scott.dept
    ORDER BY  dname
    ;
    

    Output:

    `   DEPTNO LOC
    ---------- -------------
            10 NEW YORK
            40 BOSTON
            20 DALLAS
            30 CHICAGO
    

    There is a column called dname in the scott.dept table; the query above uses actually. But, because of the order of the COLUMN, SQL * Plus will not display this column.

    Published by: Frank Kulash on February 26, 2013 10:10
    Example of scott.dept has changed.

  • How to remove the names of columns in SQL-report

    What I want is only data, without no column name.

    COLUMN LDATE
    SELECT SYSDATE LDATE
    FROM DUAL;

    LDATE
    --------
    07.11.11

    This example does not work. There are still LDATE above column. Any idea?

    It's all in the SQL * more manual...

    SQL> set heading off
    SQL> select * from emp;
    
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    
    14 rows selected.
    
  • How to remove the link to the interactive report columns!

    Hi all

    I'm building an interactive report based on pl/sql block.

    In the report, I get the columnnames with link (underlined). I'm confuse when I have the chance to see the names of columns like AGE_SEX, AGE_SEX_

    When I see these columns of interactive report, it seems to be as same as the underline covers underscore.

    Is their anyway I can remove the link to the interactive report columns.


    I selected the link column exclude from the column heading in the report but still attack link gets the link in the column.

    Appreciate your help.

    Thank you/kumar

    Published by: kumar73 on May 5, 2010 14:32

    Hello

    Try the place for HTML page header

    
    

    Hope that I did not understand what you are trying

    BR, Jari

  • I bought my computer from someone else. Change user accounts did not name of each file in the computer. How can I change or remove the user/name (my name) /document? __

    I bought my computer from someone else. Change user accounts did not take their name off of each (or more) file in the computer. How can I change or remove the user/name/document
    I have looked everywhere and changed user information and the name of the administrator. What can I do else?

    Hello flashgordonjxn,

    Who has ever done the installation of Windows, the installation program asks you to enter your name and optionally, the name of the organization. These registration information appears under recommended for in the general tab of the System when you click Start, click Control Panel, click performance and Maintenanceand then click System.

    To change see instructions below:

    1. Click Startand then click run.
    2. In the Open box, type regedit, and then click OK.
    3. Look for the following registry key:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    4. To change the name of the company, follow these steps:

      In the right pane, double-click RegisteredOrganization. Under value data, type the name that you want, and then click OK.

    5. To change the name of the registered owner, follow these steps:

      In the right pane, double-click RegisteredOwner. Under value data, type the name that you want, and then click OK.

    6. Click Exit on the file menu to exit the registry editor.

    Hope this helps you. Let us know anyway. Make it a great day!

    "And in the end the love you take, is equal to The Love You Make" (The Beatles last song from their latest album, Abbey Road.)

  • How do I remove the filter from column of table without QueryEvent

    Hi all

    With the help of JDev 12.1.3.

    I have a table that contains a list of customers and suppliers like so.  Auto Repair Bob is a client.  Chips R Us is a seller.

    Name                | TypeKey (foreign key to the Table of Type) | Unique ID

    Auto repair Bob C 1

    Quickie Mart C 2

    R chips us V 3

    Let's say that I filter on 'V' through the user interface by selecting a choice selection of the column in the table.  Now only chips R Us opens.

    Name                | MasterTypeKey | Unique ID

    R chips us V 3

    Now, let's say that I want to remove my filter I can do another business process programmatically.  How to do that without requiring a QueryEvent and so to refresh a page?  I have been searching the various view classes of being variable Manager and have located the variable I need to remove it, but I'm not sure how to let him go.

            // get the query in it's current state
            String lQuery = bpIterator.getViewObject().getQuery();
            //get Valriables
            VariableValueManager lEnsureVariableManager = bpIterator.getViewObject().ensureVariableManager();
            Variable[] lVariables = lEnsureVariableManager.getVariables();
            int lCount = lEnsureVariableManager.getVariableCount();
            // Dump query
            System.out.println("---query--- " + lQuery);
            // if variables found dump them
            if (lCount > 0){
                System.out.println("---Variables:");
                for (int ii = 0; ii < lCount; ii++){
                    Object lObject = lEnsureVariableManager.getVariableValue(lVariables[ii]);
                    System.out.println("  --- Name: " + lVariables[ii].getName() + " Value: " +
                                       (lObject != null ?  lObject.toString() : "null"));
                }
            }  
    

    Makes me

    ---query--- SELECT BusinessPartners.COMPANY_ACCOUNT_ID,       BusinessPartners.MASTER_TYPE_KEY,         BusinessPartners.NAME,         BusinessPartners.BUSINESS_PARTNER_REF_KEY,      FROM BUSINESS_PARTNERS BusinessPartners WHERE ( ( ( (UPPER(BusinessPartners.MASTER_TYPE_KEY) = UPPER(:vc_temp_1) ) ) ) ) AND BusinessPartners.COMPANY_ACCOUNT_ID = :Bind_CompanyAccountId ORDER BY BusinessPartners.NAME
    ---Variables:
      --- Name: vc_temp_1 Value: C
      --- Name: pCompanyAccountId Value: null
    

    I am trying to get vc_temp_1 is deleted or to accept any value, but when I write what follows I get an error message "missing parameter IN or OUT."

    lEnsureVariableManager.removeVariable("vc_temp_1");
    

    Any ideas on how I can remove the filter on my view object?

    It cannot work without running the query again. As you see that the filter is running a query make the vo is not all data.even if you delete the variable filter, that you do not get the data from the database you need to show.

    You can reset the filter (see https://tompeez.wordpress.com/2013/08/06/jdev-12c-how-to-reset-a-filter-on-an-aftable-the-12c-way/) but you must run the query again to the corresponding data.

    Timo

  • new to 4.02, no grid or column names in the query results

    It is a bit strange, I have SQL Developer 4.02 just installed, and I don't see grid or column names in the query results.  Don't see anything useful in tools > Preferences, what don't get me?

    The worksheet gives you a couple of different ways to run a query...

    1. instruction execute sheet icon toolbar (large green arrow, or Ctrl + Enter).

    This produces a results tab of the query with the data displayed in a grid.

    2. worksheet icon toolbar Execute the Script (the small tip of the green arrow on lined paper, or F5).

    This produces a tab out of the Script with the data displayed on the printer.

    If execution of the statement to Execute the Script, using some SQL * most orders will remove the column headers:

    1. set the position

    2. set the pagesize 0 (or 1 or 2).

    Pagesize and linesize default is - 1.  By default, the spreadsheet is free for formatting output script as he wishes.  If you have not changed these settings in the spreadsheet, then see if you point to a startup script in Tools > Preferences > Database > name of the connection startup script file

    Kind regards

    Gary

    SQL DeveloperTeam

  • Remove the column space

    Hi, just wanted to help regarding the deletion of my user name column spaces. I used the following code to remove the double space to a single space.
    regexp_replace(table_a.username, ' {2,}', ' ')
    but when you look through my answers I noticed that there is an extra in a few names at the end of the field as well. The original double space was between first name and family name, but now I have to replace the space completely, but don't know how.

    If someone could please advise.

    Thanks in advance.
    with t as (
               select 'ABC         DEF   ' str from dual
              )
    select  regexp_replace(str,' *( |$)','\1')
      from  t
    /
    
    REGEXP_
    -------
    ABC DEF
    
    SQL> 
    

    SY.
    P.S. It does not remove the spaces to the left, just backwards.

    SY.

  • How to remove the charater of a value in column

    Hi could someone please enlighten me how?

    I called CAMAPIGNS table, there is a column called NAME without length limit.
    Data already in my table I want to remove the character more than 100 length of the NAME column.
    Update CAMAPIGNS set NAME=SUBSTR(NAME,1,100)
    
  • How remove the line by line by comparing to the first column?

    Hello!

    I have a problem - I need to remove the line by line, but the problem is, I know that the first COLUMN of the table is a PK.
    To retrieve the NAME of the COLUMN that I use:

    SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
    But it does not somehow.
    Below you can see my script (which has not worked for now):

    declare
    XXX varchar2 (100);
    Start
    C1 in (select table_name, tmp_tables tmp_table_name) loop
    IMMEDIATE EXECUTION
    ' SELECT column_name in ' | xxx | "USER_TAB_COLUMNS WHERE column_id = 1 AND table_name = ' |" ' || C1.tmp_table_name | " ' ;
    immediate execution
    "start."
    for c2 in (select * from ' | c1.tmp_table_name | start loop ')
    Insert into ' | C1.table_name | "values c2; delete from ' | C1.tmp_table_name | 'where ' | xxx |' = c2.' | xxx |'; exception: when other then null; end; end loop; end;';
    end loop;
    end;

    P.S. The Inserts work perfect. I have a problem with deleting lines that are in c1.table_name, of c1.tmp_table_name (the two tables have the same structure, PK, always), because I have the names of columns different another tables which are PK. (for example: K, ID, NS and so on) Please help me to write the correct script.
    For example this will be for the first line recovered as:
    Start
    C1 in (select table_name, tmp_tables tmp_table_name) loop
    immediate execution
    «Start for c2 in (select * from ' |)» C1.tmp_table_name | Start loop ')
    Insert into ' | C1.table_name | "values c2; delete from ' | C1.tmp_table_name: ' where K = c2. K; exception: when other then null; end; end loop; end;';
    end loop;
    end;
    This script works perfectly. But I have many other tables with different PK - K No.

    Solution with the logging of errors table

    -- create the error-logging table
    CREATE TABLE tbl_MergeErrors (
        Stamp       TIMESTAMP(3),
        TableName   VARCHAR2(30),
        KeyColumn   VARCHAR2(30),
        KeyValue    VARCHAR2(4000),
        ErrorCode   NUMBER(5),
        ErrorMsg    VARCHAR2(4000),
    
      CONSTRAINT pk_MergeErrors
          PRIMARY KEY (TableName, Stamp)
          USING INDEX
    )
    /
    
    -- procedure to insert errors
    CREATE OR REPLACE
    PROCEDURE LogMergeError (pTableName  IN VARCHAR2,
                             pKeyColumn  IN VARCHAR2,
                             pKeyValue   IN VARCHAR2)
    IS PRAGMA AUTONOMOUS_TRANSACTION;
    
        -- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
        nSQLCODE   NUMBER(5)      := SQLCODE;
        vcSQLERRM  VARCHAR2(4000) := SQLERRM;
    
    BEGIN
      INSERT INTO tbl_MergeErrors
             (Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
          VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
                  RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
                  nSQLCODE, vcSQLERRM);
      COMMIT WORK;
    
    -- if an error occured here, then just roll back the autonomous transaction
    EXCEPTION
      WHEN OTHERS THEN   ROLLBACK WORK;
    END LogMergeError;
    /
    
    -- create the tables and insert test-data
    CREATE TABLE TMP_TABLES (
        TABLE_NAME       VARCHAR2(200),
        TMP_TABLE_NAME   VARCHAR2(200),
      CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
    )
    /
    CREATE TABLE TMP_KL002 (
        K   VARCHAR2(40),
        N   VARCHAR2(200)
    )
    /
    CREATE TABLE TMP_TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200)
    )
    /
    CREATE TABLE KL002 (
        K VARCHAR2(40),
        N VARCHAR2(200),
      CONSTRAINT PK_KL002 PRIMARY KEY (K)
    )
    /
    CREATE TABLE TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200),
      CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
    )
    / 
    
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
    INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
    INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
    INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
    INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
    INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
    INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
    COMMIT WORK;
    
    -- to test, if it works correct when primary key values exists before
    INSERT INTO KL002 VALUES ('07', 'exists before');
    COMMIT WORK;
    
    -- check the data before execution
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    
    -- empty the error-logging table
    TRUNCATE TABLE tbl_MergeErrors DROP STORAGE; 
    
    -- a solution
    DECLARE
    
        PLSQL_BLOCK  CONSTANT VARCHAR2(256) := '
    BEGIN
      FOR rec IN (SELECT * FROM <0>) LOOP
        BEGIN
          INSERT INTO <1> VALUES rec;
          DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
        EXCEPTION
          WHEN OTHERS THEN
              LogMergeError( ''<1>'', ''<2>'', rec.<2>);
        END;
      END LOOP;
    END;';
    
    BEGIN
      FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
                     FROM Tmp_Tables t,
                          User_Tab_Columns c
                     WHERE     (c.Table_Name = Upper( t.Tmp_Table_Name))
                           AND (c.Column_ID = 1)
                ) LOOP
        EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
                                   '<0>', tabcol.Tmp_Table_Name),
                                   '<1>', tabcol.Table_Name),
                                   '<2>', tabcol.Column_Name);
      END LOOP;
    END;
    / 
    
    -- check the data after execution ...
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    
    -- ... and also the error-logging table
    SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
    
    -- of couse you must issue an COMMIT (the ROLLBACK is only for testing
    ROLLBACK WORK;
    
    -- drop the test-tables
    DROP TABLE TABLE1 PURGE;
    DROP TABLE KL002 PURGE;
    DROP TABLE TMP_TABLE1 PURGE;
    DROP TABLE TMP_KL002 PURGE;
    DROP TABLE TMP_TABLES PURGE;
    
    -- you shouldn't drop the error-logging table, but I use it to free up my db
    DROP TABLE tbl_MergeErrors PURGE;
    

    Greetings, Niels

  • by using the parameter entry is as column names

    Hi all

    I have a stored proc in which I get the column names as parameter with string delimited by commas. For example, if I get

    Address, city, name, zip_code as a varchar2 in my stored proc is the name of the parameter

    p_param

    I can do


    Select p_param from

    VW_Personal

    or is their any simple way, I can use these list of parameters by commas as the column names in my stored proc.

    Any help will be appreciated.


    Thank you

    I copy - paste the same answer I gave to another question this morning:

    You can use ref Cursor, anyway when you retrieve the values you need to know the number and the type of data in the columns.

    SQL> create or replace procedure print_enames(in_col in varchar, in_val in varchar2) is
      2  c sys_refcursor;
      3  v_name emp.ename%type;
      4  begin
      5    open c for 'select ename from emp where '||DBMS_ASSERT.SIMPLE_SQL_NAME(in_col)||'= :1 ' using in_val;
      6    loop
      7     fetch c into v_name;
      8     exit when c%notfound;
      9     dbms_output.put_line('ename='||v_name);
     10    end loop;
     11  end;
     12  / 
    
    Procedure created.
    
    SQL> select * from emp;
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    
    14 rows selected.
    
    SQL> set serverout on
    SQL> exec print_enames('mgr','7839')
    ename=JONES
    ename=BLAKE
    ename=CLARK
    
    PL/SQL procedure successfully completed.
    
    SQL> exec print_enames('sal','1250')
    ename=WARD
    ename=MARTIN
    
    PL/SQL procedure successfully completed.
    
    SQL> exec print_enames('deptno','30')
    ename=ALLEN
    ename=WARD
    ename=MARTIN
    ename=BLAKE
    ename=TURNER
    ename=JAMES
    
    PL/SQL procedure successfully completed.
    

    Max

    Published by: Massimo Ruocchio, June 23, 2011 17:02
    As well stressed Centinul this approach is prone to sql injection.
    Usage of DBMS_ASSERT function. SIMPLE_SQL_NAME can avoid this problem, but there are onliy on Oracle 10.2 and later.

Maybe you are looking for