Logical limit on Select clause

I am working on Oracle 10g 10.2.0.3 and I cannot select more than 1000 columns using SQL.
But I could select more than 1000 columns in Oracle 11g R2.
What is the limit on number of columns that can be selected in a select query on Oracle 11g R2?
Also, can i get Oracle documentation which specifies this limit for select query?
Edited by: 844063 on Apr 26, 2011 10:53 PM

Well, then, on a related note, I have at least some tables that do not show all the columns in the column or data views in SQL Developer. I get the first 76 columns for one table that I have in mind. The index build utility also does not show all the available columns in the table.
"Select *" does show all the columns, and so does the DESCRIBE statement. Is there a setting in preferences (I couldn't find it) that controls this?

Similar Messages

  • Limit on Select clause

    I am working on Oracle 10g 10.2.0.3 and I cannot select more than 1000 columns using SQL.
    But I could select more than 1000 columns in Oracle 11g R2.
    What is the limit on number of columns that can be selected in a select query on Oracle 11g R2?
    Also, can i get Oracle documentation which specifies this limit for select query?

    Hi,
    I think you can select as many columns you like in both 10g and 11g.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/limits003.htm#i288032
    You cannot however use more than 1000 columns in say create view as ... or create table as ...
    In both cases you will get
    ORA-01792: maximum number of columns in a table or view is 1000
    These limits probably also mean that you cannot use more than 1000 columns in your select list, when this is part of subquery factoring or inline views, or whenever the optimizer feels like treating that query as a view or table.
    In other words, you can:
    select 'n1', 'n2', ..., 'n1001' from dual;But you cannot:
    select * from
    select 'n1', 'n2', ..., 'n1001' from dual
    );My guess is, since you have a query in 11g that will not execute in 10g, it is due to how the optimizer re-writes the query in those two versions.
    Regards
    Peter

  • Using if logic in the where clause of a select statement

    I have a select clause. And in the select clause there is a variable all_off_trt that can be 'Y' or 'N'.
    In the where clause I want to make it so that if a form variable is checked and all_off_trt is 'Y' then
    exclude it else if the form variable isn't checked then select it no matter what all_off_trt is.
    Is there any way to include either and if statement or a case statement within the where clause to acheive this? If not is there another way of doing it?
    Basically I am looking for a case statement like this
    case
    when all_off_trt = 'Y' and mail_para.code = 'Y' then false
    else true
    end
    Message was edited by:
    Tugnutt7

    Ok, so that really doesn't solve my problem. I have 3 different fields that I need to do that with. Each combining in a select statement to print an email list, as well as other thing limiting the where clause.
    This is currently what I have, tested and working 100%.
    cursor email_cur is
         select unique p.email,s.all_off_trt,s.all_deceased,s.no_enroll
    from participant p, trialcom t, ethics s
    where p.status='A'
    and p.surname=t.surname
    and p.initials=t.initials
    and s.trial_cd = t.tricom
    and s.centre = t.centre
    and p.email is not null
    and (t.centre in (select code from mail_parameters where user_name=user and mail_para='CENTRE')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='CENTRE'))
    and (t.tricom in (select code from mail_parameters where user_name=user and mail_para='TRIAL')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='TRIAL'))
    and (t.role in (select code from mail_parameters where user_name=user and mail_para='ROLE')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='ROLE'))
    and (p.country in (select code from mail_parameters where user_name=user and mail_para='COUNTRY')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='COUNTRY'))
    and (t.represent in (select code from mail_parameters where user_name=user and mail_para='REPRESENT')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='REPRESENT'));
    This is in a program unit that runs when a button is clicked. At the end of that I need to add on the 3 case statements that help further narrow down the selection of emails to be printed. Then it prints the emails selected from this statement into a file. So it has to be done right in the select statement. The three table variables are the all_off_trt, all_deceased, and no_enroll. The form has 3 checkboxes. One for each, that when checked (giving the variable associated with the checkboxes a value of 'Y') excludes all emails that have a 'Y' in the coresponding table variable.

  • Decimal Separator in SELECT Clause

    Hi
    I have the following decimal format parameters:
    SQL> select value
    2 from v$nls_parameters
    3 where parameter = 'NLS_NUMERIC_CHARACTERS';
    VALUE
    If I show a number with decimal I get a comma as the decimal separator
    SQL> select 10/100 from dual;
    10/100
    ,1
    But if I use a decimal separator in the SELECT clause I get:
    SQL> select 100 * 1,1 from dual;
    100*1 1
    100 1
    It doesn't work. But using a period as the decimal separator works:
    SQL> select 1.1 * 100 from dual;
    1.1*100
    110
    Maybe this is something I've never had to deal with before but I thought that the numeric format applied to the sql results and also the numbers that you used in the sql clauses.
    Regards,
    Néstor Boscán

    Hi,Néstor,
    user594312 wrote:
    ... I thought that the numeric format applied to the sql results and also the numbers that you used in the sql clauses.No; it applies to results, and it can affect implicit conversions, but it doesn't apply to SQL code.
    The period (or dot, '.') is always the decimal separator in numeric literals. There is no way to change that.
    Think how confusing it would be if it did apply to SQL code! For example:
    WHERE   num_col  IN (1,2)Are we comparing num_col to 1 value or 2 values? Whichever it is, what if we wanted to do the opposite?
    If you really wanted to use comma as the decimal separator, you could have to use strings, not numbers, and that could be a lot less efficient.
    For example:
    SELECT  100 * TO_NUMBER ('1,1')    -- This assumes your NLS settings are correct
    FROM    dual;Of course, efficiency won't be an issue when you're selecting 1 row from dual.

  • Need to know the column names in my dynamic select clause

    Dear All,
    Please go through the following code. While executing the following code i am getting an error saying that dbms_sql.describe_columns overflow, col_name_len=35. Use describe_columns2.
    Please guide me how to proceed further. Or please help me, how can i get the column names when i issue a dynamic select clause.
    DECLARE
    CUR INTEGER;
    COL_CNT INTEGER ;
    A INTEGER;
    SEL_CLAUSE VARCHAR2(2000);
    DESC_T DBMS_SQL.DESC_TAB;
    REC DBMS_SQL.DESC_REC;
    b number;
    BEGIN
    SEL_CLAUSE := 'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'',3,''THREE'') FROM DUAL';
    --'SELECT ROWID,PARA_SUB_CODE,DECODE('||''''||'ENG'||''''||','||''''||'ENG'||''''||',PARA_NAME,PARA_BL_NAME),NULL,NULL FROM PCOM_APP_PARAMETER';
    --'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'') FROM DUAL';
    DBMS_OUTPUT.PUT_LINE( SEL_CLAUSE );
    CUR := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(CUR,SEL_CLAUSE,DBMS_SQL.NATIVE);
    DBMS_SQL.DESCRIBE_COLUMNS(CUR,COL_CNT,DESC_T);
    B := desc_t.first;
    FOR J IN 1..COL_CNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('J := '||J || ' COL CNT ' || COL_CNT);
    END LOOP;
    BEGIN
    A := DBMS_SQL.EXECUTE(CUR);
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    END;
    Regards,
    Balaji

    Is there any way can i have it directly??It does not work with static SQL either. Dynamic SQL is no different.
    SQL> select 1 x from dual where x = 1 ;
    select 1 x from dual where x = 1
    ERROR at line 1:
    ORA-00904: "X": invalid identifier
    SQL>As suggested already, you will need to use alias if you want your select expression to be referred in the where clause.
    SQL> BEGIN
      2      FOR rec IN (SELECT *
      3                  FROM   (SELECT 1,
      4                                 2,
      5                                 DECODE(1, 1, 'ONE', 2, 'TWO', 3, 'THREE') "DECODE(1, 1, 'ONE', 2, 'TWO', "
      6                          FROM   DUAL)
      7                  WHERE  "DECODE(1, 1, 'ONE', 2, 'TWO', " = 'ONE')
      8      LOOP
      9          NULL;
    10      END LOOP;
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SQL>Message was edited by:
    Kamal Kishore

  • &param lexical variable in SELECT clause

    Is there a way to get Oracle*Reports to accept a lexical variable in the SELECT clause? The example is:
    SELECT
    table.column1,
    table.column2,
    &PARAM as column3
    FROM
    table
    I am already using lexical variables in the WHERE clause, but getting one to work in the SELECT clause has thus far failed.
    The SQL is accepted if :PARAM is used in place of &PARAM, but I am unable to actually vary the selected column this way.
    The bind variable PARAM has the following code behind it in a BeforeReport trigger:
    IF :ANOTHER_PARAM := 'ALL' THEN
    :PARAM = 'ALL'
    ELSE
    :PARAM = 'table.column3'
    When using :PARAM in the SELECT clause, the literals 'table.column3' are returned, not the contents of table.column3.

    Sorry for the wasted bandwidth. I found a solution. Here it is:
    SELECT
    table.column1,
    table.column2,
    CASE :P_USER
    WHEN 'ALL' THEN 'ALL'
    ELSE table.column3
    END as column3

  • Merge can't accept a variable in the select clause?

    oracle 10.2
    I have a stored procedure.
    I have a variable, vseq, which I set a sequence variable. With all other sql statements I can do
    insert into table a
    select vseq
    from dual;
    Apparently a merge can't handle variables in the select clause. I get an error. I can get it to work when I hard code a value.
    this is ridiculous...

    merge can't handle variables in the select clauseCare to prove?
    sql> DECLARE
      2   v_first_name varchar2(20) := 'BOSS';
      3  BEGIN
      4  MERGE INTO sun_employees se
      5  USING (SELECT * FROM employees WHERE department_id = 20) e
      6  ON (e.employee_id = se.employee_id)
      7  WHEN MATCHED THEN
      8    UPDATE SET salary = e.salary
      9  WHEN NOT MATCHED THEN
    10  INSERT(employee_id, first_name, last_name, department_id)
    11  VALUES (e.employee_id, v_first_name, e.last_name, e.department_id);
    12  END;
    13  /
    PL/SQL procedure successfully completed.
    sql> select first_name from sun_employees;
    FIRST_NAME
    BOSS
    BOSS

  • Using @Prompt in the SELECT clause (?)

    Post Author: faltinowski
    CA Forum: Semantic Layer and Data Connectivity
    Product:  Business Objects
    Version:  6.5 SP3 
    Patches Applied:  MHF11 and CHF48
    Operating System(s):  Windows
    Database(s):  Oracle
    Error Messages:  "Parse failed: Exception: DBD, ORA-00903 invalid table name  State N/A"
    Hi!  I'm bewildered -- we have an object that parses but when I try to reproduce this object, it does not.
    We have a universe that's been in production for several years using an object developed by another designer who's no longer with the company.  This object is a dimension, datatype is character, and there's no LOV associated.  The SELECT statement in this object is
    decode(@Prompt('Select Snapshot Month','A','Object Definitions\CY Month Snapshot',MONO,CONSTRAINED),'00-Previous Month',to_number(to_char(add_months(sysdate,-1),'MM')),'01-Current Month',to_number(to_char(add_months(sysdate,0),'MM')),'01-January','1','02-February','2','03-March','3','04-April','4','05-May','5','06-June','6','07-July','7','08-August','8','09-September','9','10-October','10','11-November','11','12-December','12')
    This object parses. The client uses the object in the select clause to capture the "month of interest" for the report.  So the report may be for the entire year's data which is graphed to show trends, but there's a table below the graph which is filtered to show just the month of interest.  Typically they use the value "00-Previous Month" so they can schedule the report and it will always show the last month's data.
    Problem
    The original object parses.
    If I copy the object within the same universe, it parses.
    If I copy the code into a new object in the same universe, it doesn't parse
    If I copy the code into a new object in a different universe, it doesn't parse
    If I copy the object to a different universe, then edit the LOV reference, it doesn't parse
    If I create any new object having @Prompt in the SELECT statement, it doesn't parse.
    If another designer tries - they get the same thing.
    What am I missing?  Obviously someone was able to create this successfully.
    On the brighter side
    The object I created in a new universe (which doesn't parse in the universe) seems to work fine in the report.

    Seems that, the prompt syntax is correct.
    But the condition is not correct.
    You are taking the prompt value and not doing anything. That could be one issue for this error.
    I believe that, you just want to capture the prompt value use it in report level and do not want to apply as a filter.
    So, use the condition as follows.
    @Prompt('Select Grouping','A',{'A','B','C'},mono,constrained) = @Prompt('Select Grouping','A',{'A','B','C'},mono,constrained)
    Hope this helps!

  • How to append new field in select clause of dynamic VO through CO

    I have dynamic VO "FaoWorkPerObjPerfRatingsVO" in controlloer below:
    public class FaoWorkApprObjectivesCO extends ApprObjectivesCO
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OAApplicationModule oam = oapagecontext.getApplicationModule(oawebbean);
    oracle.apps.fnd.framework.server.OADBTransaction oadbtransaction = oam.getOADBTransaction();
    OAViewObject oav = (OAViewObject)oam.findViewObject("FaoWorkPerObjPerfRatingsVO");
    if(oav != null)
    System.out.println("FAO Found VO PerObjPerfRatingsVO for ObjectivesAM. This means we have re-entered the page");
    } else
    oav = (OAViewObject)oam.createViewObject("FaoWorkPerObjPerfRatingsVO", "oracle.apps.per.selfservice.objectives.server.PerObjPerfRatingsVO");
    How can I append 2 new fields are MULTIRATERS_AVERAGE and COUNT_MULTIRATERS as statement below in select clause of dynamic VO above (FaoWorkPerObjPerfRatingsVO)
    fao_pems_utility.AVG_STEP_VALUE(fao_pems_utility.GET_APPRAISAL_ID(PCE.ASSESSMENT_ID),
    'MULTIRATER',
    Null,
    PCE.COMPETENCE_ID) MULTIRATERS_AVERAGE,
    fao_pems_utility.COUNT_RATINGS(Null,
    Null,
    fao_pems_utility.GET_APPRAISAL_ID(PCE.ASSESSMENT_ID),
    PCE.COMPETENCE_ID,
    Null,
    'MULTIRATER',
    Null) || ' out of ' ||
    (fao_pems_utility.HOW_MANY_RATING(fao_pems_utility.GET_APPRAISAL_ID(PCE.ASSESSMENT_ID),
    'GROUPAPPRAISER') +
    fao_pems_utility.HOW_MANY_RATING(fao_pems_utility.GET_APPRAISAL_ID(PCE.ASSESSMENT_ID),
    'REVIEWER')) COUNT_MULTIRATERS
    Thank you very much.

    Hi
    My VO is VO Extension below. In the seeded VO (oracle.apps.per.selfservice.objectives.server.PerObjPerfRatingsVO) doesn't include 2 fields that I want to add in VO.
    oav = (OAViewObject)oam.createViewObject("FaoWorkPerObjPerfRatingsVO", "oracle.apps.per.selfservice.objectives.server.PerObjPerfRatingsVO");
    Could you please provide me the coding to append 2 new fields in VO Extension approach. I would like to append them in select clause.
    Thank you.

  • Regarding Logical database and  select statement..

    Hi
    Experts.
    i would  like to  know the  diff b/w logical data base & select statement  while using report.
    wt is the use of logical databases in R/3. is there   any   advantage  used in the  reports.
    Thanks & Regards..
    Spandana.

    Dear Spandana,
      Go through the below description of LDB. I hope you wil get a fair amount of idea.
    SAP comes loaded with all the extras. Among the extras that are most helpful to IT managers are all the access routines needed to pull any business object that managers can think of out of SAP databases. However, SAP has not thought of everything where your particular applications are concerned. SAP organizes its standard database tables to service business units based on conventional business applications. Itu2019s likely your business requires something new, perhaps even something exotic. In that case, you will need to create a new database, using information from different places. Basically, you need a logical database. You need to create a virtual business data object repository consisting of a new kind of record or table that suits your purposes. In addition, the repository should be composed of information that is actually stored in a number of different locations, none of them necessarily logically associated with one another. Letu2019s take a closer look at creating logical databases.
    A case for a logical database
    Suppose my company manufactures widgets of the most obscure variety, and they are components of other widgets. I sell my widgets as raw material for the more sophisticated widgets built by others, but in some cases I actually partner with other manufacturers in creating yet another class of widget. Now, in my world, I consequently have customers who are also partners. I sell to them and I partner with them in manufacturing and distribution. Also, I need an application that uses both of these dual-use relationships.
    Essentially, I have a customer database and a partner database. Neither contains records that are structured to contain the identifying particulars of the other. Thus, I need a hybrid database that gives me tables detailing these hybrid relationships. What can I do? I can go the long way around and write a new database, pulling information from both and creating new objects with a customized program that I write by hand. However, this process is cumbersome and contains maintenance issues. On the other hand, I can use SAPu2019s logical database facility, create my logical database in a couple of minutes, and have no maintenance issues at all.
    Logical database structures
    There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
    u2022     Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
    u2022     Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
    u2022     Database access programming: Once youu2019ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
    Creating your own logical database
    ABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Hereu2019s a step-by-step guide:
    1.     Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
    2.     Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
    3.     Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
    4.     Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youu2019ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you donu2019t have to write a single line of code.
    Watch out!
    The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
    Declaring a logical database
    Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
    Logical databases for increasing efficiency
    Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
    Regards
    Arindam

  • Logical Database (PNPCE) , selection screen hide.

    Hi Gurus,
             i have couple of questions related to logical database pnpce.
    1.Since i know logical database has there own selection screen , my requirement is i want to add my custom fields to the selection screen other than what is provided is it possible or not.
    2. i want to hide the selection screen of the logical database, but i do want to create my own in which i will be declaring some select options of the standard logical database screen has, like pernr, organisation unit, etc, how do i communicate the entered data with the logical database if i dont use the logical database standard selection screen, hope i could able to explain my problem, please see into my problem and let me know thanks in advance,
    hussaini

    Hussain,
    LDB have standard selection screens, if at all you want to customize those standard selection screen you would have to define a report category for your program. You`ll have to configure in the spro settings for your corresponding report category.
    If you would like to declare your own selection criteria, you can very well do it and these criteria are visible below the standard selection criteria. You can process these elements in your program and not in the LDB standard program. Use the normal selection screen events in your program for processing your selection criteria.
    Hope this info is helpful, reward points if convinced.
    Regards

  • Using a select clause in the column formula in an Analysis

    Hi all,
    Is there a function or syntax that I can use to simulate a "SELECT" clause in the column formula of an Analysis? What I am trying to achieve is displaying a measure from a specific fact record into the current record. For example, if the current record displays "Region","position", and "salary", I would like to add an additional column called "compared to" in which I can display the "salary" measure from another specific fact record whose attributes I know.
    Is there a function/statement that I can use to achieve this?
    Thanks

    Hi,
    U can't do it in Edit formula column..it's possible below one
    Add SQL filter in that column then follow blow steps
    Convert this filter to SQL
    i.e : add more option to sql here u can write SQL query in that column
    Thanks
    Deva

  • How to use a function in select clause

    hi gems...good evening...
    I want to write a select clause from a function. The scenario is like below:
    function parameters
    CREATE OR REPLACE FUNCTION FUNCTION_DEMO(p_pid IN NUMBER,
    p_bankerNum IN NUMBER,
    p_banker_name IN VARCHAR2,
    p_business_num IN NUMBER,
    p_businesses IN table_typ_businesses)
    return table_typ_bankers
    as .......
    global object and table types
    CREATE OR REPLACE TYPE obj_typ_businesses AS OBJECT (businesses NUMBER);
    CREATE OR REPLACE TYPE table_typ_businesses AS TABLE OF obj_typ_businesses;
    CREATE OR REPLACE TYPE obj_typ_bankers AS OBJECT (banker_num NUMBER(10,0));
    CREATE OR REPLACE TYPE table_typ_bankers IS TABLE OF obj_typ_bankers;
    The select query
    select * from
    table(cast(FUNCTION_DEMO(1,
    2,
    'ALEX',
    2,
    table(cast(select businesses_id from reference_businesses) as table_typ_businesses) as table_typ_bankers)But it is giving error with Missing expression.
    My function is compiled successfully. I just want to make the select query to view the output given by the function i.e the table type "table_typ_bankers".
    Please help...thanks in advance..

    Hi ,
    You can check this and change your code by taking this as an example. I just noted down with simple one input and return as collection type
    and how to use/call it in select statement.
    SQL> CREATE OR REPLACE TYPE obj_typ_businesses AS OBJECT (businesses NUMBER)
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE table_typ_businesses AS TABLE OF obj_typ_businesses
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE obj_typ_bankers AS OBJECT (banker_num NUMBER(10,2))
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE table_typ_bankers IS TABLE OF obj_typ_bankers
      2  /
    Type created.
    /* Now creating a demo function and just focusing on your one input as collection type  */
    SQL> create or replace function f11 ( tab_rec  IN table_typ_businesses)
      2  return table_typ_bankers
      3  is
      4  t_val table_typ_bankers:= table_typ_bankers();
      5  begin
      6        dbms_output.put_line('tab_rec count -'||tab_rec.count);
      7
      8  for i in 1..tab_rec.count
      9              loop
    10               dbms_output.put_line ('tab_rec value ('||i||')'||tab_rec(i).businesses);
    11                       t_val.EXTEND;
    12                    t_val(i) := obj_typ_bankers(tab_rec(i).businesses * 12.50);
    13              end loop;
    14              return t_val;
    15  end;
    16  /
    Function created.
    /* To run your function by a select statement */
    SQL> SELECT * FROM TABLE(f11(table_typ_businesses(obj_typ_businesses(5),
      2                          obj_typ_businesses(12),
      3                                         obj_typ_businesses(18))
      4                                             ) )
      5  /
    BANKER_NUM
          62.5
           150
           225
    tab_rec count -3
    tab_rec value (1)5
    tab_rec value (2)12
    tab_rec value (3)18Hope this will help you... :)
    Thanks!
    Ashutosh

  • How to remove column name in select clause

    Hello Guys,
    I just want to remove a column name in select clause. Because, I don't want to write all column names. I hope I express myself.
    In other words, I want the following.
    Select   * - unwanted_column  from table;
    instead of this
    Select col1, col2, col3, col4, ........ col 10000 from table;

    Hi,
    Sorry, there's nothing in SQL that means "all columns *except* ...". As the others have said, the only way to get those results in SQL is to list all the columns you do want.
    Your front end may have some feature that allows you to hide a specific column. For example, in SQL*Plus, you can use <tt> COLUMN ... NOPRINT </tt> , like this:
    COLUMN      dname     NOPRINT
    SELECT       *
    FROM       scott.dept
    ORDER BY  dname
    ;Output:
    `   DEPTNO LOC
            10 NEW YORK
            40 BOSTON
            20 DALLAS
            30 CHICAGOThere is a column called dname in the scott.dept table; the query above actually uses it. But, because of the COLUMN command, SQL*Plus won't display that column.
    Edited by: Frank Kulash on Feb 26, 2013 10:10 AM
    Changed scott.dept example.

  • Maximum no. of columns allowed in SELECT clause - Urgent please

    Hi,
    I am constructing SQL query dynamically in a stored proc. based on user inputs. I am getting following error when I have around 400 columns in my SELECT clause. FROM, WHERE, GROUP BY clauses are same eventhough I have 30 columns and I don't have any problems here. Can anyone please let me know what is maximum no. of columns allowed in a query. I am working on Oracle 9i Release2.
    Thanks in advance.

    ORA-01467 sort key too longIt's not the SELECT clause that causes this, it's most likely the GROUP BY clause. Basically, the columns in the GROUP BY clause have to fit comfortably within a single database block. Does that sound like it might be a problem with your query?
    Cheers, APC
    Message was edited by:
    APC

Maybe you are looking for