Listing tables where particular column exists

I want to list the tables where particular column is refered how do i do this thru sql plus?
Thanks in advance
Sudha

Do you mean this?
select table_name from user_tab_columns where column_name like 'N%ID';Lennert

Similar Messages

  • How do i know in how many tables particular column exists

    i want to know in how many tables a particular column exists..
    what i mean is
    let us assume that there is a Column ABC in table SERVICE.
    this particular ABC column is there in some other tables REQUEST,HHG,SS.... and so on
    what exactly my query is..
    how can i know where all in the database the column ABC is used..
    i mean i want to get all the table names using this column ABC.
    hope i am clear with my doubt..
    thanks for the replies in advance

    If I understand the question
    SELECT owner, table_name
      FROM dba_tab_cols
    WERE column_name = 'ABC'Of course, depending on the requirements, you could use the ALL_TAB_COLS or USER_TAB_COLS tables as well.
    Justin

  • Return the rows of the table where a column contains a specific value first

    I want my query to return the rows of the table where a column contains a specific values first in a certain order, and then return the rest of the rows alphabetized.
    For Example:
    Country
    ALBANIA
    ARGENTINA
    AUSTRALIA
    CANADA
    USA
    Now i want USA and CANADA on top in that order and then other in alphabetized order.
    Edited by: 986155 on Feb 4, 2013 11:12 PM

    986155 wrote:
    If it is 2 then i can write a case... i want generalised one where may be around 5 or 6 mentioned should be in descending order at the top and remaining in ascending order there after.Computers tend not to work in 'generalized' ways... they require specifics.
    If you store your "top" countries in a table you can then simply do something like...
    SQL> ed
    Wrote file afiedt.buf
      1  with c as (select 'USA' country from dual union
      2             select 'Germany' from dual union
      3             select 'India' from dual union
      4             select 'Australia' from dual union
      5             select 'Japan' from dual union
      6             select 'Canada' from dual union
      7             select 'United Kingdom' from dual union
      8             select 'France' from dual union
      9             select 'Spain' from dual union
    10             select 'Italy' from dual
    11           )
    12      ,t as (-- top countries
    13             select 'USA' country from dual union
    14             select 'United Kingdom' from dual union
    15             select 'Canada' from dual
    16            )
    17  select c.country
    18  from   c left outer join t on (t.country = c.country)
    19* ORDER BY t.country, c.country
    SQL> /
    COUNTRY
    Canada
    USA
    United Kingdom
    Australia
    France
    Germany
    India
    Italy
    Japan
    Spain
    10 rows selected.

  • Compare tables in two schemas for the table with particular column & value

    Hello All,
    I have a query to find out the list of table from a given schema to extract all the tables having a search column .
    ex :
    SELECT OWNER, TABLE_NAME, COLUMN_NAME FROM
    ALL_TAB_COLUMNS WHERE OWNER='<SCHEMA_NAME>'
    AND COLUMN_NAME='<COLUMN_NAME>'
    I want to compare two schemas for the same above query .
    Can we wirte a query on this - I am using SQL DEVELOPER , which has menu item - TOOL - database differneces to find the diffenence between two schemas but my requirement is to find the differences in two schemas for all the tables matching for a particular column ( as given in quer).
    Appreciate your help.
    thanks/Kumar
    Edited by: kumar73 on 29 Nov, 2012 1:50 PM

    Hi, Kumar,
    This is the SQL and PL/SQL forum. If you have a question about SQL Developer, then the SQL Developer is a better place to post it. Mark this thread as "Answered" before starting another thread for the same question.
    If SQL Developer has a tool for doing what you want, don't waste your time trying to devise a SQL solution. The SQL Developer way will probably be simpler, more efficient and more reliable.
    If you do need to try a SQL solution, then post some sample data (CREATE TABLE and INSERT statements for a table that resembles all_tab_columns; you can call it my_tab_columns) and the results you want from that data.

  • Table.rows.find() returns null in a table where the row exists.

    Hi...
    I am working in a Project in Visual Studio 2013 where I have to read an Excel report related with a list of business opportunities. Some of the Fields that are involved in it are:  Opportunity ID, BU, Account, close date, Account Manager,
    Total Value and so on. As soon as I get the conection with the Excel Report, I fill a DataTable and declare the columns [Opportunity ID] and [BU] as my Primary Keys.  In that way, an Opportunity value may have one o more rows
    with different BU code each of them.  In consequence, you can define one row in the table if you specify the [Opportunity ID] and the [BU] values.
    My problem starts when I try to get information of those rows that have an specific value of [Opportunity ID]. For that situation I make a "foreach" structure where I check the BU codes that are involved with that Opportunity. So
    I use the Find() Method to get the information of the row specified by the Opportunity ID and BU.  The first time it goes to find the information it gets the results successfully but in the next cycle changing just the [BU] using the same [Opportunity
    ID] value, the find() method returns a "null" and I do not know why because I am sure that the row exists in the table.  I have verified the "Unique" property for the  [Opportunity ID] and [BU] columns (which are
    my primary keys)  and they are in false which is OK.
    I share the code that I am using...
    Hope someone can help.
    Thanks.
    Alfmar.
    void ObtenTotalesxBUs(string Opportunity, string[] BUs, Object[] TotalBUs, Object[] ExpTotalBUs)
    ArrayList TotalesBUs = new ArrayList(); //Required information from the row.
    ArrayList ExpTotalesBUs = new ArrayList(); //Required information from the row.
    foreach(string businessUnit in BUs)
    Object[] LlaveBusqueda = { Opportunity, businessUnit }; //Provide values to the Primary Keys.
    DataRow RenglonInfo = null;
    RenglonInfo = TablaFunnel.Tabla.Rows.Find(LlaveBusqueda); //Find method receives the Primary Keys values. Here is where I have a "null" in return the second time changing just the [BU] field.
    TotalesBUs.Add(RenglonInfo["Total"]); //Get the required information from the row.
    ExpTotalesBUs.Add(RenglonInfo["Expected Total Value"]); //Get the required information from the row.
    TotalBUs = TotalesBUs.ToArray();
    ExpTotalBUs = ExpTotalesBUs.ToArray();}

    Hi Viorel..
    Thanks a lot for you help.
    I am absolutely sure that the second ítem of BU is valid and exist in the table because I tried to make a "Select" statement in the table providing the values of [Opportunity ID] and [BU] and I get the expected record. So, why is not
    working using Find() with the defined Primary Keys??? 
    I tried this in order to test that the record exists...
    if(RenglonInfo == null)
    string strSelect = "[Opportunity ID] = '0000218256' AND [BU] = 'SFW'";
    RenglonInfo2 = TablaFunnel.Tabla.Select(strSelect);

  • How to update column values in a table where that column is referring to different tables

    i have a table Order it has columns
    OrderID, Name, Total
    1            trade   value populated from i.e. tradeorder table
    2            fixed   value is populated from fixedorder table
    3            annual  value populated from another table
    I m thinking of creating function for every order id to call those tables..
    and there are many insertions taking place in order table ,,at the moment its 20 rows ..
    kindly provide your suggestions

    You can group rows in order table and update the set of row from the specific table. For instance
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [TRADEORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='TRADE'
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [FIXEDORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='FIXED'
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [ANOTHERTABLE] B ON A.ORDERID=B.ORDERID WHERE A.NAME='ANNUAL'
    Regards, RSingh

  • How can i select the rows from the 3 tables by particular column name?

    Vehicle Passing Summary table structure
              PsngSmry_ID(Number),Vehicle_iD(Number),PsngSmryTime(datetime)
    Vehicle table structure
              Vehicle_iD(Number),VehicleName(VarChar2),VehicleType(VarChar2)
    Here Vehicle_iD is the Primary Key
    Equipment Table Structure
              Eqpmt_id(Number),Vehicle_iD(Number),EqpmtName(VarChar2),EqpmtType(VarChar2)
    Here Eqpmt_id is the Primary Key and Vehicle_iD is the foreign Key
    Equipment Component Table Structure
              Eqpmt_Cmpnt_id(Number) ,Eqpmt_id(Number),EqpmtCmpntName(VarChar2),EqpmtCmpntName(VarChar2),Parent_Eqpmnt_ID(Number)
    Here Eqpmt_Cmpnt_id is the Primary Key and Eqpmt_id is the foreign Key
    The rows in the Vehicle Passing Summary table
         PsngSmry_ID Vehicle_ID     PsngSmryTime
         111111          80986246     2010/10/11
         111112          80986247     2010/10/12
         111113          80986248     2010/10/10
    The rows in the Vehicle Table
         Vehicle_iD     VehicleName     VehicleType
         80986246          Lorry          Four Wheeler
         80986247          Van          Four Wheeler
         80986248          Bus          Four Wheeler
    The rows in the Equipment Table:
         Eqpmt_id     Vehicle_iD     EqpmtName          EqpmtType
         109846          80986246          2 Axle Lorry          CAR
    109821          80986246          4 Axle Lorry          CAR
    109825          80986246          4 Axle Lorry          CAR
         109562          80986247          2 Axle VAn          CAR
    109555          80986247          3 Axle VAn          CAR
    109777          80986247          3 Axle VAn          CAR
         109587          80986248          2 Axle Bus          CAR
    The rows in the Equipment Component Table :
         Eqpmt_Cmpnt_id Eqpmt_id EqpmtCmpntName Parent_Eqpmnt_ID
         20904146          109846          Truck               
         20904147          109846          Truck
         20904148          109846          Axle               20904146
         20904159          109846          Axle               20904146
         20904167          109846          Wheel               20904148
         20904177          109846          Wheel               20904148
         20904185          109846          Wheel               20904159
         20904325          109846          Wheel               20904159
         20904188          109846          Axle               20904147
         20904189          109846          Axle               20904147
         20904195          109846          Wheel               20904188
         20904196          109846          Wheel               20904188
         20904197          109846          Wheel               20904189
         20904398          109846          Wheel               20904189
         10904146          109562          Truck               
         10904147          109562          Truck
         10904148          109562          Axle               10904146
         10904159          109562          Axle               10904146
         10904167          109562          Wheel               10904148
         10904177          109562          Wheel               10904148
         10904185          109562          Wheel               10904159
         10904325          109562          Wheel               10904159
         10904188          109562          Axle               10904147
         10904189          109562          Axle               10904147
         10904195          109562          Wheel               10904188
         10904196          109562          Wheel               10904188
         10904197          109562          Wheel               10904189
         10904398          109562          Wheel               10904189
    Note : In Equipment Component Table,the hierarchy will be Truck-->Axle-->Wheel.So
    1.the Parent_Eqpmnt_ID of Axle is Truck's Eqpmt_Cmpnt_id.
    2.the Parent_Eqpmnt_ID of Wheel is Axle's Eqpmt_Cmpnt_id.
    Now I want to write the store procedure which will take "PsngSmry_ID(Number)" as input and the o/p will be in the format :
         Eqpmt_Cmpnt_id Eqpmt_id EqpmtCmpntName Parent_Eqpmnt_ID
         20904146          109846      Truck     
         20904148          109846      Axle               20904146
         20904167          109846      Wheel               20904148
         20904177          109846      Wheel               20904148     
         20904159          109846      Axle               20904146
         20904185          109846      Wheel               20904159
         20904325          109846      Wheel               20904159
         20904147          109846      Truck
         20904188          109846      Axle               20904147
         20904195          109846      Wheel               20904188
         20904196          109846      Wheel               20904188
         20904189          109846      Axle               20904147
         20904197          109846      Wheel               20904189
         20904398          109846      Wheel               20904189
         10904146          109562          Truck     
         10904148          109562          Axle               10904146
         10904167          109562          Wheel               10904148
         10904177          109562          Wheel               10904148     
         10904159          109562          Axle               10904146
         10904185          109562          Wheel               10904159
         10904325          109562          Wheel               10904159
         10904147          109562      Truck
         10904188          109562      Axle               10904147
         10904195          109562      Wheel               10904188
         10904196          109562      Wheel               10904188
         10904189          109562      Axle               10904147
         10904197          109562      Wheel               10904189
         10904398          109562      Wheel               10904189
    **Please add these columns in the o/p **
    1.EqpmtName and EqpmtType from Eqpmt table
    2.VehicleName and Vehicle Type from Vehicle table
    3.PsngSmryTime from PassingSummary table **
    Can anyone tell me the solution?
    Edited by: 865216 on Jun 22, 2011 2:14 AM

    Hi,
    I am new to this technology;But, just wanted to help you.
    Please refer the code it might be atleast helpful for you.
    But am facing PL/SQL: ORA-00933: error and unable to resolve it.could anyone please correct this code.
    sorry if my code is totally wrong.
    Thank you,
    Rupa
    create or replace procedure Equipment_proc
    is
    begin
    DECLARE
    TYPE EQP_record IS RECORD (
    Vehicle_iD Vehicle.Vehicle_iD%TYPE,
    Eqpmt_Cmpnt_id Equipment_Component.Eqpmt_Cmpnt_id%type,
    EqpmtCmpntName Equipment_Component.EqpmtCmpntName%type,
    Parent_Eqpmnt_ID Equipment_Component.Parent_Eqpmnt_ID%type,
    Eqpmt_id Equipment.Eqpmt_id%type,
    vehicleId NUMBER);
    EQP_rec EQP_record;
    CURSOR EQP_cursor IS
    select a.Vehicle_iD,c.Eqpmt_Cmpnt_id,b.Eqpmt_id,c.EqpmtCmpntName,c.Parent_Eqpmnt_ID
    from Vehicle a,Equipment b,Equipment_Component c
    where a.Vehicle_iD=b.Vehicle_iD
    and b.Eqpmt_id=c.Eqpmt_id
    and a.vehicle_id=&EQP_rec.vehicleId;
    BEGIN
    OPEN EQP_cursor;
         FETCH EQP_cursor INTO EQP_rec;
         dbms_output.put_line(EQP_rec.Vehicle_iD,EQP_rec.Eqpmt_Cmpnt_id||','||EQP_rec.Eqpmt_id||','||EQP_rec.EqpmtCmpntName||','||EQP_rec.Parent_Eqpmnt_ID);
    CLOSE EQP_cursor;
    END;
    END;

  • Particular column as control in table

     Dear All,
    Is there any way to make a particular column in a table as control and rest indicators?
    I am creating a table where in 1 column i display the speed which is calculated by the program and in the next column the user wants to add the distance.
    So, in the table i want the column representing Speed should act as an indicator and the Distance Column should behave as a Control as the user manually has to enter the distance.
    how is this possible?
    Thanks,
    Ritesh 

    Hello ritesh024,
    The attached vi is a small exemple of "Control column" and " Indicator column".
    This Vi computes the hypothenuse of a triangle according to the big and small side lengths.
    It is composed of a table where  first column is small side, second bigside, and the third is hypothenuse calculation.
    When the table changes, the hypothenuse is computed according to big and small side lengths.
    The hypothenuse column could be considered as "indicator" as you cannot change the value without triggering a new computation
     Hope this helps!
    Attachments:
    TableExemple.vi ‏12 KB
    Clipboard02.png ‏24 KB
    Clipboard01.png ‏12 KB

  • Sql join on two tables where column like another column

    hi all,
    been trying to get the results from a join between two tables where one column is like another one.
    table1 (nameA) examples: black2, green1
    table2 (nameB) example: black2.location.uk.com, green1.location.uk.com
    so for example I want to match all those in table1 with black2 to the column in table2 that begins with black2 and so on if you see what im trying to get at!
    my sql so far:
    select * from  schema.table1 a
    join schema.table2 b
    on a.nameA like concat('%', b.nameB, '%'); but it errors:
    ORA-00909: invalid number of arguments
    00909. 00000 - "invalid number of arguments"
    Any help or advice would be greatly appreciated, thankyou!

    Either of these should do it...
    select * from  schema.table1 a
    join schema.table2 b on a.nameA like '%'||b.nameB||'%';or
    select * from  schema.table1 a
    join schema.table2 b on instr(b.nameB,a.nameA) > 0

  • Selection in table with Master Column

    Hi,
    can anybody explain me how selection works in table with MasterColumn (TreeByNestingTableColumn)?
    I've created a table with several columns and the "master" one behaves differently from others.
    First of all, leaf elements of master column are not clickable (i.e. I don't receive notification "onLeadSelect" from the table, when user clicks in the cell of leaf element of the column). With expandable elements I receive loadchildren event and can react on selection.
    I'm using TextView as cell editor, will try LinkToAction, may be it will resolve situation, but it's rather workaround as solution
    Second, getLeadSelection doesn't work anymore for the table - it works with indexes of top level elements only.
    However onLeadSelect action brings me selected row number, which I somehow should map to the tree.
    I.e. when I get "25" as selected element, I recursively traverse context node to find 25th element. Which is rather slow operation as for any selection I have to reiterate whole structure and I hope that visual appearance is similar to context element order.
    May be there is simplier ways to get selected element by its index in "flat" list?
    And one another strange thing: first click on the table sends me onLeadSelect "0", but highlight points to the element user clicked - not necessary first one.
    Context node is "single" selection, initLeadSelect=true,
    selection = 0..1 (with 1..1 setTreeSelection doesn't work - method I want to use to be able to select a node in hierarchy on my own)
    all quite similar to other tables I have, which works well. Just the problems with the table, where Master Column is used.
    Thank you!
    Best regards,
    Nick

    >Valery's proposal was to perform reverse traverse from current element to root and summarize parent element indexes.
    It seems to work:
    in method, which sets selection I applied
    // we need to know index of the element not in whole context, but in scope of table-relevant node
    int index = getIndexInContext(selElement, wdContext.currentXXXElement());
    IContextElement curContext = wdContext.currentContextElement();
    int firstVisibleRow = curContext.getTableFirstVisibleRow();
    int visibleRows = curContext.getTableVisibleRows();
    if (index < firstVisibleRow || index > firstVisibleRow + visibleRows) {
    curContext.setTableFirstVisibleRow(index);
    and method getIndexInContext looks as:
        private int getIndexInContext (IWDNodeElement element, IWDNodeElement root) {
              int index = element.index();
              if (element == root) {
                   return index;
              IWDNodeElement parent = element.node().getParentElement();
              if (parent == null) {
    // do whatever you like here for error diagnostic
                   myMsgMgr.reportException("Internal Error: getIndexInContext - element is not under passed root", false);
                   return 0;
              // +1 - every level adds 1 (otherwise indexes of first children of hierarchy will be 0)
              return  index + getIndexInContext(parent, root) + 1;
    Best regards,
    Nick

  • Query to list tables with a particular column name in a schema!!

    Is there any way to know?
    Thanks in advance.

    You can query the data dictionary views to get this information.
    For example
    untested
    select table_name
    from user_tab_columns
    where column_name = 'my particular column name';There is also all_tab_columns and dba_tab_columns. Both of which would include the schema name.
    Edited by: Sven W. on Sep 9, 2011 2:24 PM

  • Wanting data from a table without a particular column

    I need the data from a table, except the data for a particular
    column. I don't want to write the select list, as it would be
    too clumsy for a large table. Can anybody suggest a solution. I
    can certainly create a view, but I don't want that.

    Hi,
    Try this select Statement.
    set haeding off
    set feedback off
    spool file.sql
    Select 'Select ' from dual;
    Select Column_name || ',' from all_tab_columns Where table_name = 'EMPLOYEE' and Column_Name != 'DEPARTMENT_ID';
    Select '1' from dual;
    select 'From Employee;' from dual;
    Spool off
    regards,
    Ganesh R

  • Deleting from multiple tables where few tables have same column name

    Hi,
    I am new to PL/SQL and need some help. I need to delete data older then X years from some 35 odd tables in my schema and out of those tables 25 tables have same column name on which i can have my "where" clause and rest 10 table have different table names. I am doing something like this :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(400);
    column_name VARCHAR2(400);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    DBMS_OUTPUT.PUT_LINE(table_list);
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    DBMS_OUTPUT.PUT_LINE(table_name);
    DBMS_OUTPUT.PUT_LINE(column_name);
    IF column_name = 'SUBMISSION_TIME' THEN
    delete from :table_name where to_date(:column_name)<(sysdate-(365*7));
    ELSE
    delete from || table_name || where ( || to_date(column_name) || ) <(sysdate-(365*7));
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    WHERE the text file "text7.txt" contains list of table name and column names separated by a pipe line. But when I execute the above proc it gives error "invalid table name".
    Can something like this be done or is there any other way to execute this task of deletion from 35 tables.
    Thanks.

    Thanks for replies. I don't know what I am doing wrong but still not getting this damn thing work...This is the proc i am running now :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(4000);
    column_name VARCHAR2(4000);
    code_text VARCHAR2(2000);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    IF column_name = 'SUBMISSION_TIME' THEN
    DBMS_OUTPUT.PUT_LINE('do nothing');
    ELSE
    code_text:= 'begin delete from'|| (table_name) ||'where to_date' || (column_name) || '<(sysdate-(365*7))';
    Execute Immediate code_text;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    But it gives following error :
    " ORA-06550: line 1, column 51:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 1, column 68:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    ORA-06512: at line 22 "

  • How to Determine Whether Columns Exist in a Table

    Greetings,
    Because of customizations to our product, certain database table structures vary between different client installations. Hence, in the code, I need to determine whether two columns exist in a certain table, in order to apply some business logic.
    Please suggest a way for me to determine whether two named columns appear in a specific table. In other words, for example, I need to discover whether both columns SAL_GRADE and BONUS appear in the EMP table, or not. Only if both columns are defined, can I apply my business logic.
    Thanks,
    Avi.

    Avi,
    Like this ?
    SQL> declare
      2    l_count number;
      3  begin
      4    select count(*)
      5      into l_count
      6      from user_tab_columns
      7     where table_name = 'EMP'
      8       and column_name in ('SALGRADE','BONUS')
      9    ;
    10    if l_count = 2
    11    then
    12      dbms_output.put_line('Both columns exist, so apply business logic');
    13    else
    14      dbms_output.put_line('One or both columns are missing, so don''t apply business logic');
    15    end if;
    16  end;
    17  /
    One or both columns are missing, so don't apply business logic
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • How to test if a column exists in a table

    Hello,
    Using SQL or PL/SQL how do I test if a column exists in a table. For example,
    if column_aa exists in table_1
    then do this....
    else do that....
    Thank you.

    Set ServerOutput On;
    CREATE Table a_Test (
    Col1 NUMBER
    , Col2 NUMBER )
    DECLARE
    lnCol1 NUMBER ;
    lnCol7 NUMBER ;
    PROCEDURE TestColumn( acColName IN VARCHAR2 )
    IS
    lnColX NUMBER ;
    NoColumnExists EXCEPTION;
    PRAGMA EXCEPTION_INIT(NoColumnExists, -904);
    BEGIN
    EXECUTE IMMEDIATE
    'SELECT Max('|| acColName||') FROM a_Test WHERE RowNum = 0'
    INTO lnColX ;
    DBMS_OUTPUT.Put_Line('Column: '||acColName||' exists.');
    EXCEPTION
    WHEN NoColumnExists THEN
    DBMS_OUTPUT.Put_Line('Column: '||acColName||' NOT exists.');
    WHEN Others THEN
    DBMS_OUTPUT.Put_Line( SqlCode ||' '||SqlErrM );
    END
    BEGIN
    DBMS_OUTPUT.Enable ;
    TestColumn( 'Col1') ;
    TestColumn( 'Col2') ;
    TestColumn( 'Col7') ;
    END
    DROP Table a_Test;

Maybe you are looking for

  • Win 7 slow boot - login in with fingerprint reader

    Hi I have a T400s (2.4 GHz and 4 GB) with an Intel SSD and WIn 7 RTM with latest Lenovo beta drivers. I have the fingerprint reader activated for login and my boot time of 35 seconds is now split about half in the fingerprint login and half in the re

  • ORA-00339: archived log does not contain any redo

    Hi All, recently we faced 'ORA-00339: archived log does not contain any redo' issue at standby side, after searching on Google and from Metalink (note 30866.1 and 7197445.8 ) I find out that this is the known issue for 10g and below versions, our's i

  • HT1727 how do I authorize a new computer

    How do I authorize a new computer so that I can transfer my downloads?

  • How to trace other email from bookmark

    how to trace other user email from bookmark

  • Physical Standby re-sync

    Hi, I have gone through the following link in order to re-sync my physical standby with the primary db . The physical standby had nearly 2500 archive log gap but resolved based on below link : http://www.bestremotedba.com/oracle-10g-dataguard-sync-st