How can I find number of columns in a table using a query

Hi
I want to find the number of columns in a table using a query.
Any help in this regard is much appreciated.
Cheers

Hi,
This is the output i get when i executed ur query
OWNER     OBJECT_NAME     OBJECT_TYPE
SMLDBO     T2311_SURVEY_QUESTIONS     TABLE
select OWNER,OBJECT_NAME,OBJECT_TYPE
from all_objects
where OBJECT_NAME = 'T2311_SURVEY_QUESTIONS';
works Fine.
But if i use the below query it returns : 0
SELECT count(*) FROM user_tab_columns
WHERE table_name =upper( 'T2311_SURVEY_QUESTIONS');
What could be problem.
The table exists + name of the table is correct + it resides in my schema itself.
Any guess !!!

Similar Messages

  • How can i find number of columns in a table ....... it's higer priority

    hi
    i wnat find the number of columns in a table.
    is there any predefine fiunction. pls tell me

    Thanks for correction!
    I asked myself that question after posting previous post... started to search in Documentation but you were faster.
    Thanks again!
    Message was edited by:
    Faust
    Edit:
    Dear thread users!
    You have here (in my post in this thread - see above) good example for inappropriate post in one thread.
    I posted to fast - I didn't realise am I sure what I wrote!
    Consequence was that, after posting, I asked myself is it correct my statement about rights on SYS-objects, I started to search for answer, etc.
    So what I want to say is: if you don't want to find yourself foolish, like I found myself, don't post before you are sure is it correct what you wrote!
    Cheers!

  • The have stolen my laptop, how can I find it? is it possible to use serial number to find it?

    they have stolen my laptop macbook pro i7, still new and got all my research, how can i find it and is it possible to use the serial number to find it? please help

    Unless you have an active MobileMe account with Find My Phone activated for the laptop and the laptop is connected to a WiFi site, then you cannot locate it. File a police report and file with your insurance company.

  • HT1338 HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING?

    HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING, KEEP GETTING MICROSOFT SQL SERVER ERRORS
    WHEN TYPING IN ADDRESS'S?

    If your computer is tied to a network, then there is a way to check. Go to System Preferences, and click Accounts. unlock Admin
    then you can click Login Options.
    under that, Network Account Server. This should show you what server your computer is tied to. If you aren't in the tech department, you could try asking them.

  • How can I find out when was a particular table last updated?

    How can I find out when was a particular table last updated? I need to find out the usage of this table - when was it last updated, etc. Thanks in advance. The version I am using is Oracle 9i.

    If you don't have any application level logging, and auditing is not enabled, there's not much hope.
    You could, if you have archive logs available, go trawling through archive logs via logminer, but that's likely to prove painful and not very fruitful, unless you're very meticulous and patient...
    -Mark

  • When I updated the new version and used icloud, some of the apps are missing, how can I find those apps(but i was not using my account to download some apps before). Please advise.

    When I updated the new version IOS5 and used icloud, some of the apps are missing, how can i find those apps (but i was not using my account to download some apps before).  Please advise.

    They are free to iOS 7 users who have activated their NEW device on Sept 1 2013 or after. They are NOT automatically free with iOS 7.
    AirDrop is only compatible with iPad 4th gen and iPad mini. iPad 3rd gen and below do contain the necessary hardware for AirDrop. Also, AirDrop is only compatible between iOS devices. You cannot AirDrop between iOS device and Mac OS.

  • Windows Internal Database on Windows Server 2012 - How can I find out what role or feature is using it?

    We have setup many roles and features and apparently one of them is using the Windows Internal Database (WID). We have had some events logged for WID and need to troubleshoot them. But we are not sure which role/feature is using it. How can I find
    this out?

    Hi,
    Several components of Windows Server 2008 and 2012 use Windows Internal Database for their data storage: Active Directory Rights Management Services, Windows System Resource Manager, UDDI Services, Active Directory Federation Services 2.0, IPAM and Windows
    SharePoint Services.
    Which role did you setup or what is the error message did you received?
    Regards.
    Vivian Wang

  • How can you find out whether anything in a table's been selected?

    How can you find out is there anything(a cell or a row) in a table's been selected???
    it's doesn't matter which cell or which row's been selected in a table, but just to know is there anything been selected
    I can't figure out the code to do that >.<
    is there anything to do with
    bookTable.getCellEditor()?

    How can you find out is there anything(a cell or a row) in a table's been selected???
    it's doesn't matter which cell or which row's been selected in a table, but just to know is there anything been selected
    I can't figure out the code to do that >.<
    is there anything to do with
    bookTable.getCellEditor()?

  • How can I find out where the Library files currently used by iTunes are located?

    I have had a bit of a nightmare sorting out my iTunes files so I have various versions of Library files all over the place. How can I tell where the Library file that iTunes is currently using is located? In Preferences I can see the Library "Name", but I don't think that is much help. Preferences also shows where my i-Tunes media folder is but not where the Library files are.
    Any help greatly appreciated.
    J

    Ah, I was assuming you would search in Finder and display some details. All alternative approach is to Option start iTunes and click the Choose option. It should show a file selection box targeted at the folder of the currently active library.
    tt2

  • How can I get Number of Lines from internal table?

    Hello at all,
    i have in my Report a internal Table, which have many KUNNR.
    For example the internal Table:
    MANDT.......KUNNR......NAME.........FIRSTNAME........CITY
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........99999.......Johnson.......... Jeffrey........London
    ...040..........12345.........Owen............Michael........Liverpool
    ...040..........55555.......Hardley.......... Kingston.......Birmingham
    I want to know, how many same KUNNR are existing in the internal Table?
    In my example i need the result 3, because their is existing 3 times the Kunnr 12345 in the internal Table.
    Have anyone an idea, how can I resolve this problem?
    Edited by: Thomas Zloch on Jun 21, 2010 2:55 PM - one question mark at a time is sufficient

    Hi,
    1.Create two internal tables of same type and sort according to Kunnr then Delete the
    adjusent duplicates by comparing KUNNR
    2.Sort the table by KUNNR and use ON change of Concept in that Just increment the counter.
    I am writing the sample logic here.
    tables kna1.
    data: t_kna1 type table of kna1,
             w_kunnr type kna1-kunnr,
             counter type i," Holds No.of KUNNRs in the T_kna1
             t_kna2 type table of kna1.
    select * from kna1 into table kna1 up to 100 rows.
    t_kna2[] = t_kna1[].
    delete t_kna2 by kunnr.
    delete adjusent duplicates from t_kna2 by comparing kunnr."1st Method
    read table t_kna2 transporting no-fields.
    counter = sy-tfill."1st Method
    loop at t_kna1 into kna1."2nd Method
    at first.
    w_kunnr = kna1-kunnr .
    counter = 1.
    endat.
    if w_kunnr ne kna1-kunnr.
    counter = counter + 1.
    endif.
    endloop.
    Note : Here I used a sample table KNA1 in this there are no Duplicates of KUNNR .

  • How can i display collection of  records in HTML Table using DWR framework

    Dear All,
    Just i start using the Direct Web Remoting framework.I am worrying to get the list of records to display html table using this concept.I did the same like.
    index.js
    var cellFuncs = [
    function(data) { return data; },
    function(data) { return data.toUpperCase(); },
    function(data) { return "<input type='button' value='Test' onclick='alert(\"Hi\");'/>";  },
    function(data) { return count++; }
    function update() {
    var name = dwr.util.getValue("demoName");
    Demo.sayHello(name, function(data) {    dwr.util.setValue("demoReply", data);   } );
    var count = 1;
    dwr.util.addRows( "tabs",[ 'Africa', 'America', 'Asia', 'Australasia', 'Europe' ], cellFuncs);
    alert("hai");
    index.jsp
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type='text/javascript' src='dwr/engine.js'> </script>
    <script type='text/javascript' src='dwr/util.js'> </script>
    <script type='text/javascript' src='dwr/interface/Demo.js'> </script>
    <script type="text/javascript" src='index.js'> </script>
    </head>
    <body>
    <div id="tabContents">
    <div id="demoDiv">
    <p>
    Name:
    <input type="text" id="demoName" value="Joe"/>
    <input value="Send" type="button" onclick="update()"/>
    Reply: <span id="demoReply" style="background:#eeffdd; padding-left:4px; padding-right:4px;"></span>
         <table id="tabl1">
         <tbody id="tabs">
         <tr>
         <td>name</td>
         <td>name1</td>
         <td>name2</td>
         <td>name3sdf</td>
         </tr>
         <tbody>
         </table>
    </p>
    </div>
    </div>
    </body>
    </html>
    dwr.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
    <dwr>
    <allow>
    <!-- simpletext -->
    <create creator="new" javascript="Demo">
    <param name="class" value="org.getahead.dwrdemo.simpletext.Demo"/>
    </create>
    </allow>
    </dwr>
    web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app id="dwr">
    <display-name>DWR (Direct Web Remoting)</display-name>
    <description>A Simple Demo DWR</description>
    <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <display-name>DWR Servlet</display-name>
    <description>Direct Web Remoter Servlet</description>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>activeReverseAjaxEnabled</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>initApplicationScopeCreatorsAtStartup</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>maxWaitAfterWrite</param-name>
    <param-value>500</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>
    </web-app>
    Demo.java
    package org.getahead.dwrdemo.simpletext;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import org.directwebremoting.WebContext;
    import org.directwebremoting.WebContextFactory;
    public class Demo
    public String sayHello(String name)
    return "Hello, " + name;
    the sayHello() is printing the display.But the table rows not updating.But its object expected.So can you tell me where i need to change and how to add the pagination for the table like 10 by 10 records to display.
    Please help me.
    Saravanan

    Hi Brian,
    OAF supports the master-detail based design. You can very well implement your model. You can use 2 VO for your 2 objects and link them using a ViewLink. Check OAF Dev guide for more details.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can i store a picture file in a table using sql

    can anyone help me
    to store a pic file in a table using sql

    You can find an example in this link
    http://www.orafaq.com/forum/t/38347/0/

  • How can I auto-number particular rows in a table?

    I have a table within a dynamic form.  In column 2 there is a drop-down where the user can pick a certain reagent.  I would like to set it up so that column 1 auto-populates with a series of numbers when certain reagents are chosen.  It needs to be an action/formula as the rows are added as needed to the form.
    For example:
    Reagent
    1
    Bottle
    2
    Bottle
    Can
    Paper
    3
    Bottle
    Can anyone help me out with a script or other way to accomplish this?
    Also, I'm relatively new to LiveCycle and although I have some limited scripting experience, I haven't applied it here yet - so I may need a little extra instruction on how to apply any script fixes...

    Hi,
    Turn on trace for the session, tkprof the trace file and review what indexes were used.
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Can u find (number of rows) + (SELECT * FROM emp) in 1 query?

    We have a requirement like this: We need to pass a SQL statement as a SYS_REFCURSOR OUT variable from a SP. Problem is, if the SQL returned 0 rows we have to send 1 row with all NULLS to the SYS_REFCURSOR.
    Is there any way to find out the number of rows returned from a SQL without having to put a SELECT COUNT(*) again using the "same" SQL?

    Peter:
    That only works if the cursor actually returns rows. Consider:
    SQL> create table t as
      2  select rownum id, to_char(to_date(rownum, 'J'), 'Jsp') descr
      3  from user_objects
      4  where rownum <= 5;
    Table created.
    SQL> insert into t select * from t;
    5 rows created.
    SQL> commit;
    Commit complete.
    SQL> create function f (p_id in number) return sys_refcursor as
      2     l_cur sys_refcursor;
      3  begin
      4     open l_cur for
      5        select id, descr, count(*) over() cnt
      6        from t
      7        where id = p_id;
      8     return l_cur;
      9  end;
    10  /
    Function created.
    SQL> var cur refcursor
    SQL> exec :cur := f(1);
    PL/SQL procedure successfully completed.
    SQL> print cur
            ID DESCR             CNT
             1 One                 2
             1 One                 2
    SQL> exec :cur := f(42);
    PL/SQL procedure successfully completed.
    SQL> print cur
    no rows selectedSince the OP's requirement (or ""solution" coming from someone who misunderstood the concept of cursors") is that "if the SQL returned 0 rows we have to send 1 row with all NULLS to the SYS_REFCURSOR" the analytic count doesn't help.
    @OP
    The only reliable (for certain definitions of reliable) way would be to consume the first row of the cursor to see if it did in fact return any rows.
    However, if the cursor was initally empty, we then need to generate a new cursor with all NULLS to satisfy the request. Not a big deal, as the new cursor would reflect the state of the database at the time of the initial query, even if a qualifying row was inserted and committed between the first query and the second, but it doesn't work the other way around.
    If I consume the first row and find a record, then I need to re-do the query to get all of the rows. but what happens if another process changes/deletes the qualifying row in between and commits? The second query will have no rows and you will return an empty cursor to the caller.
    Also, counting the rows (which the analytic count will need to do) could have a significant impact on performance since all the qualifying rows need to be read before the first row can be returned.
    John

  • How can I find the largest BLOB in a table and how big it is?

    Hi
    I have a massive table with 10 million rows storing images as BLOBS as well as some other data.
    Is there a way that I can find which is the largest BLOB in it and how big it is?
    Any help would be appreciated
    Flaz

    select max(dbms_lob.getlength(blob_column)) from table
    remove the max to get the length.

Maybe you are looking for