Describe statement How-To

Hello,
if i have a database, and i need to find out which tables are
included, how would i do it.
Assuming that i don't know anything about the database.
Also, if I have a table in database, and when I issue a
describe table_name, table description is so long that it
scrolls a few pages. How would I
a) pause it in the middle of describing it.
b) output responce to a file
i.e. describe table_name > file
Thanks
Alex
null

Alex Korneyev (guest) wrote:
: Hello,
: if i have a database, and i need to find out which tables
are
: included, how would i do it.
select * from cat;
it prints out all the tables that belong to user you log in as.
: Assuming that i don't know anything about the database.
: Also, if I have a table in database, and when I issue a
: describe table_name, table description is so long that it
: scrolls a few pages. How would I
: a) pause it in the middle of describing it.
in SQL*Plus
set pause on
or just use Linux console's Shift+PgUp/PgDown. It also works with
xterm.
: b) output responce to a file
: i.e. describe table_name > file
spool file.name
All the work session will be logged into file.name
: Thanks
: Alex
null

Similar Messages

  • Describe statement in abap

    how to use this descibe statement.can any one please explain me with example

    Hi Rajeev, write Describe and press F1 in the ABAP editor..u ll get the different functionalities for describe..
    this is one of them
    DESCRIBE - Return attributes of an internal table
    Basic form
    DESCRIBE TABLE itab.
    Effect
    Returns the attributes of the internal table itab. You must use at least one of the additions listed below:
    Note
    The DESCRIBE statement cannot be used for all ABAP types. In connection with ABAP Objects, SAP has introduced a RTTI concept based on system classes to determine type attributes at runtime. This concept applies to all ABAP types and as such covers all the functions of the DESCRIBE TABLE statement.
    Extras:
    1. ... LINES n
    2. ... OCCURS n
    3. ... KIND   k
    Addition 1
    ... LINES n
    Effect
    Places the number of filled lines of the table t in the field lin. The value returned to lin has type I.
    Note
    The number of filled lines of the table itab can also be ascertained using the predefined function lines( itab ).
    Example
    DATA: N    TYPE I,
          ITAB TYPE TABLE OF I.
    CLEAR ITAB.
    APPEND 36 TO ITAB.
    DESCRIBE TABLE ITAB LINES N.
    Result: N contains the value 1.
    Addition 2
    ... OCCURS n
    Effect
    Passes the size of the OCCURS parameter from the table definition (as defined with DATA) to the variable n. The value returned to n has type I.
    Example
    DATA: N1    TYPE I,
          N2    TYPE I,
          ITAB1 TYPE TABLE OF I INITIAL SIZE 10,
          ITAB2 TYPE I OCCURS 5.
    DESCRIBE TABLE ITAB1 OCCURS N1.
    DESCRIBE TABLE ITAB2 OCCURS N2.
    Result: OCC contains the value 10 and N2 the value 5.
    Addition 3
    ... KIND k
    Effect
    Writes the table type from itab to the variables n. The value returned to k is of type C. The constants SYDES_KIND-STANDARD, SYDES_KIND-SORTED and SYDES_KIND-HASHED are defined in the type group SYDES for the return values.
    Example
    Generic FORM routine any table type
    TYPE-POOLS: SYDES.
    FORM GENERIC_FORM USING ITAB TYPE ANY TABLE.
      DATA: K TYPE C.
      DESCRIBE TABLE ITAB KIND K.
      CASE K.
        WHEN SYDES_KIND-STANDARD.
        WHEN SYDES_KIND-SORTED.
        WHEN SYDES_KIND-HASHED.
      ENDCASE.
    ENDFORM.
    Notes
    Performance: The runtime for executing the DESCRIBE TABLE statement is approximately 4 msn (standardized microseconds).
    The DESCRIBE TABLE statement also passes values to the SY-TFILL and SY-TLENG System fields
    Additional help
    Determining the Attributesof Internal Tables

  • Email settings, previously I could state how many emails to be saved/downloaded and under the ios 7 it no longer is there any ideas thank  you

    Under settings mail,contacts,calendars my iphone use to have a place to state how many emails to be saved/downloaded I believe there was a choice of 250,500 or 1000, now that I downloaded IOS 7 I don;t see where you can do that. Is there any other way of doing it, thanks

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430http://support.apple.com/kb/ht1430
     Cheers, Tom

  • Where on the ipad mini would it state how many gb it has?

    Where on the ipad mini would it state how many gb it has?

    Welcome to Apple Support Communities
    To check how much space the device has got, open Settings > General > About

  • HT1051 I photo books to order it is from Australa and won't let me ship to the United states, how do I change from Australa

    I am trying ot order an iphoto book on line and the shipping is from Austriala and will not let me ship to the United States how do I change from Austraila so I can send the book to the United States.

    Set the print products country in the iPhoto advanced preferences
    LN

  • Oracle Describe Statement and CGI

    Hello,
    First of all,
    I would like to thank everyone that helped me out. It really
    made my much easier.
    Second,
    General Question.
    describe command in Oracle will display a specified table's
    definition.
    Now, I have a CGI program that will execute any SQL statement
    that has to do with tables on Oracle Database.
    i.e. select , update, insert, delete. Now when I tried
    describe student, i got an error (in httpd error log file:
    "invalid SQL statement". why?
    here is a code from my program,
    assuming: $fields{'sqlString'} = describe student
    $sth = $dbh->prepare($fields{'sqlString'})
    $sth->execute;
    Thanks Alex
    null

    Matt Surico (guest) wrote:
    : Alex Korneyev (guest) wrote:
    : {snip}
    : : General Question.
    : : describe command in Oracle will display a specified table's
    : : definition.
    : : Now, I have a CGI program that will execute any SQL
    statement
    : : that has to do with tables on Oracle Database.
    : : i.e. select , update, insert, delete. Now when I tried
    : : describe student, i got an error (in httpd error log file:
    : : "invalid SQL statement". why?
    : : here is a code from my program,
    : : assuming: $fields{'sqlString'} = describe student
    : : $sth = $dbh->prepare($fields{'sqlString'})
    : : $sth->execute;
    : : Thanks Alex
    : "describe" is a SQL*Plus command, not a SQL command. Other
    : SQL*Plus commands are column, spool, ttitle, etc...
    : If the Oracle user by which you execute the CGI above has
    access
    : to the data dictionary, you can issue the following command:
    : SELECT column_name, nullable, data_type, data_length
    : FROM dba_tab_columns
    : WHERE table_name = 'STUDENT'
    : AND owner = '{fill in the owner name in CAPS}'
    : If the Oracle user in your CGI doesn't have full access to the
    : data dictionary, you or the DBA could minimally grant SELECT on
    : DBA_TAB_COLUMNS to that user.
    : Hope that helps!
    : Matt Surico
    : Oracle 7.3 Certified DBA
    Thanks, that helps.
    Speaking of permissions. How do i set permissions for a user?
    acctually add user? for testing my CGI i am using orcl database
    with scott/tiger permissions. How do i view user's permissions?
    Also, I have this weird problem. Well I know the anser to it,
    but i need a way to go around it. Here it goes.
    Assuming following:
    alextable = (fname char (20), lname char(20))
    If I do the following from within SQL/Plus
    insert into alextable values('Alex','Was Here');
    then select * from alextable, i can see it. BUT if i do the same
    thing from CGI, I won't see, until i quit SQL/Plus. But if i
    issue the same command from CGI script and then do "select"
    statement, I will see the changes from SQL/Plus and CGI levels.
    I know that some databases use that as a "Rollback" feature.
    Is ther anyway to modify, maybe user permissions, or something
    else,so i would be able to see changes right away, no matter
    where i make them.
    thanks
    alex
    null

  • Service remains in "offline*" state - how to reset it?

    Hello.
    Since two days ago, I've got a problem with one of the sevices on a S10 Sparc system.
    --($:~)-- svcs -a | grep \*
    offline*       Jan_08   svc:/application/oracle/database:RACE002
    --($:~)-- svcs -xv svc:/application/oracle/database:RACE002
    svc:/application/oracle/database:RACE002 (Oracle database)
    State: offline since  8. Januar 2008 03:43:55 CET
    Reason: Start method is running.
       See: http://sun.com/msg/SMF-8000-C4
       See: man -M /usr/share/man -s 5 ora-smf
       See: /var/svc/log/application-oracle-database:RACE002.log
    Impact: This service is not running.
    --($:~)-- tail /var/svc/log/application-oracle-database:RACE002.log
    database RACE002 is OPEN.
    [ Jan  7 03:41:45 Method "start" exited with status 0 ]
    [ Jan  8 03:42:52 Stopping because service disabled. ]
    [ Jan  8 03:42:52 Executing stop method ("/lib/svc/method/ora-smf stop database RACE002") ]
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    [ Jan  8 03:43:00 Method "stop" exited with status 0 ]
    [ Jan  8 03:43:54 Enabled. ]
    [ Jan  8 03:43:55 Executing start method ("/lib/svc/method/ora-smf start database RACE002") ]Ie., the service is in "offline*" since Jan 8.
    How do I get the service to change into any other different state, be it "online", "maintenance" or "offline"?
    --($:~)-- svcs -xv svc:/application/oracle/database:RACE002
    svc:/application/oracle/database:RACE002 (Oracle database)
    State: offline since  8. Januar 2008 03:43:55 CET
    Reason: Start method is running.
       See: http://sun.com/msg/SMF-8000-C4
       See: man -M /usr/share/man -s 5 ora-smf
       See: /var/svc/log/application-oracle-database:RACE002.log
    Impact: This service is not running.
    --($:~)-- sudo svcadm disable svc:/application/oracle/database:RACE002
    --($:~)-- svcs -xv svc:/application/oracle/database:RACE002
    svc:/application/oracle/database:RACE002 (Oracle database)
    State: offline since  8. Januar 2008 03:43:55 CET
    Reason: Start method is running.
       See: http://sun.com/msg/SMF-8000-C4
       See: man -M /usr/share/man -s 5 ora-smf
       See: /var/svc/log/application-oracle-database:RACE002.log
    Impact: This service is not running.
    --($:~)-- svcs svc:/application/oracle/database:RACE002
    STATE          STIME    FMRI
    offline*       Jan_08   svc:/application/oracle/database:RACE002
    --($:~)-- sudo svcadm mark maintenance svc:/application/oracle/database:RACE002
    --($:~)-- svcs svc:/application/oracle/database:RACE002
    STATE          STIME    FMRI
    offline*       Jan_08   svc:/application/oracle/database:RACE002
    --($:~)-- sudo svcadm clear svc:/application/oracle/database:RACE002
    svcadm: Instance "svc:/application/oracle/database:RACE002" is not in a maintenance or degraded state.
    --($:~)-- sudo svcadm refresh svc:/application/oracle/database:RACE002
    --($:~)-- svcs svc:/application/oracle/database:RACE002
    STATE          STIME    FMRI
    offline*       Jan_08   svc:/application/oracle/database:RACE002
    --($:~)-- sudo svcadm restart svc:/application/oracle/database:RACE002
    --($:~)-- svcs svc:/application/oracle/database:RACE002
    STATE          STIME    FMRI
    offline*       Jan_08   svc:/application/oracle/database:RACE002 Note: I'm not looking for an answer on how to make the oracle database RACE002 be available again. That can easily be done as "oracle" OS user and using "sqlplus" to send a "startup" command.
    I'm looking for a way to make SMF behave again. Because right now, I cannot use SMF to change the state of the service, which is a problem, as my backup scripts fail because of that :/
    Thanks a lot,
    Michael

    Hello again Michael, would you be able to post the output of the following procedure?
    4:41pm cmdrkeen@crossfire  /research #>svccfg
    svc:> select network/ssh
    svc:/network/ssh> listprop(except obviously with your service rather than SSH)

  • Timer event doesn't listen to my if else statements how do stop it?

    So I'm building a random generator of just a vector that i imported into flash and everything works just fine, almost. I added a timer to the creation of the vector. I also have some if else statements that are going to govern User Input. I realized that if the UI was initially outside of the parameters i've set it runs fine but once the once the function with the timer starts it never stops regardless of whether or not the UI is in the parameters I set. How do I stop the function when the UI is not what i want it to be?
    Heres my code:
    //initial universal variable declaration
    var kface:Kobbyface;
    var UI:Number;
    var kfacex:Number;
    var kfacey:Number;
    var UIold:Number = 0;
    var timer:Timer = new Timer(200);
    //background rectangle
    graphics.beginFill(0xFFFF00, 1);
    graphics.drawRect(0,65, stage.stageWidth, stage.stageHeight);
    graphics.endFill();
    trace (inputnumber);
    //eventlistener for click
    gobutton.addEventListener(MouseEvent.CLICK, create);
    function create(me:MouseEvent):void {
    UI = Number(inputnumber.text);
    if (isNaN(UI)) {
    errormessages.text = "Kobby only responds to numbers"
    else if (UI > 500) {
    errormessages.text = "You're not ready for that many Kobbys"
    else if (UI < 15) {
    errormessages.text = "Come on you can handle more than that"
    else{
    createfaces();
    //for loop///
    function createfaces ():void {
    ////////timer for face animation///////
    timer.addEventListener(TimerEvent.TIMER, animate);
    timer.start();
    function animate(evt:TimerEvent):void {
    /////keep track of old number/////
    if (UIold != 0) {
    for (var i: int = 1; i<UIold + 1; i++) {
    stage.removeChildAt(1);
        /////assign old number to new number////
    UIold = UI;
    for ( var i:int = 1; i<UI + 1; i++ ) {
    trace( i );
    ////assign values to coordinate varialbes/////
    var kfacex:Number = Math.random() * stage.stageWidth;
    var kfacey:Number = Math.random() * stage.stageHeight + 65;
    //creation of faces///
    kface = new Kobbyface();
    stage.addChild(kface);
    kface.x = kfacex;
    kface.y = kfacey;

    you can apply the stop() method to your timer:
    timer.stop();

  • Auto task - Gather Stats.How do Oracle knows which DB objects to analyze ?

    Hi,
    Do oracle has any specific criteria while identifying which Oracle DB objects needs to be analyze as part of Gather Stats ( included as "auto task") ?
    Does it uses information from DBA_TAB_MODIFICATIONS to find any fixed % of change like 10% or so or it analyzes all objects ?

    Copied and pasted from the documentation, which you can find via some simple Google searches if you don't know about http://docs.oracle.com
    GATHER AUTO: Gathers all necessary statistics automatically. Oracle implicitly determines which objects need new statistics, and determines how to gather those statistics. When GATHER AUTO is specified, the only additional valid parameters are stattab,statid, objlist and statown; all other parameter settings are ignored. Returns a list of processed objects.
    GATHER STALE: Gathers statistics on stale objects as determined by looking at the *_tab_modifications views. Also, return a list of objects found to be stale.
    GATHER EMPTY: Gathers statistics on objects which currently have no statistics. Return a list of objects found to have no statistics.
    14.2.1 GATHER_STATS_JOB
    Optimizer statistics are automatically gathered with the job GATHER_STATS_JOB. This job gathers statistics on all objects in the database which have:
    Missing statistics
    Stale statistics

  • DESCRIBE statement

    Dear all,
    I m simply  trying to  get the length of a variable and written the following code.
    DATA : var(20) type c,
           len type i.
    describe field var length len.
    write : /len.
    But it giving an error : In Unicode DESCRIBE length can only be used with the IN BYTE MODE or IN CHARACTER MODE addition.
    Can any one suggest some solution.
    Regards,
    Maverick

    Describe is used to describe length of a field & how many number of lines for an internal table.
    in case of field we have to provide in which format we have to read i.e. Character or Binary
    in case of Internal Table no need to provide these things it will directly write number of lines to our field type integer.
    *For Field
    DESCRIBE FIELD dobj  LENGTH ilen IN {BYTE|CHARACTER} MODE .
    for more information go to F1 help
    *For Internal Table
    data:ivbap type standard table of <any table>,
           da_tfill type i.
    describe table ivbap lines da_tfill

  • HT1414 I have an iphone purchased in the UAE.  Now that I have moved back to the States, how can I get FaceTime installed?

    When I was living in the UAE I purchased an iphone 5.  It does not have FaceTime because of 'cultural' reasons.  Now that I have moved back to the States where we don't have the same 'cultural' issues, I'd like to put Facebook on.  How do I go about it?  Will apple exchange the phone?  Can my phone's serial number be taken off the no Facebook listing?

    There is no way to get Facetime on that phone. No, Apple will not exchange it. You'll need to purchase a new phone in order to have FaceTime. Third pary apps such as Skype should work, though.

  • Help with describe statement

    Hi,
    does both the statements gives the same results or it depends on anything
    DESCRIBE FIELD Itab LENGTH LEN IN byte MODE.
    DESCRIBE FIELD Itab LENGTH LEN IN CHARACTER MODE.
    thanks

    See the below information :
    LENGTH ilen IN { BYTE | CHARACTER } MODE
    Effect
    The length directly used by the data object dobj in the memory is determined in bytes or characters depending on the addition MODE and is assigned to the data object ilen. The data type i is expected for ilen.
    You must specify the addition MODE in Unicode programs. The variant with the addition IN BYTE MODE determines the length of the data object dobj in bytes. The variant with the addition IN CHARACTER MODE determines the length of the data object dobj in characters. When using IN CHARACTER MODE, the data type of dobj must be flat and character-type. You can only specify IN BYTE MODE for deep data types and in this case, the length of the reference (8 bytes) is determined.
    In non-Unicode programs and in releases prior to 6.10, LENGTH can be used without the addition MODE. In this case, the addition IN BYTE MODE is used implicitly
    Note
    For data objects with a fixed length, the length is determined that is specified during the creation of the data object. To determine the the used length of character-type data objects without counting the trailing spaces, you can use the built-in function strlen.
    Example
    Calculation of bytes required for the display of one character. The result is greater than 1 in multi-byte systems. .
    DATA: text(1) TYPE c,
          blen TYPE i,
          clen TYPE i,
          bytes TYPE i.
    DESCRIBE FIELD text: LENGTH blen IN BYTE MODE,
                         LENGTH clen IN CHARACTER MODE.
    bytes = blen / clen.

  • CFQuery with an IN statement (how do you do it)

    I have a <cfquery> SQL statement with a 'where in ( )'
    clause but quotedValueList can't handle values greater than 1000,
    so, how do you do it?
    Now, I can't just stick the first query into the second query
    to make it work. The first query is more complicated than the
    example I gave so that's why I have to break them up. So, how would
    I make the second query work if the first query returned 2000
    students?
    <cfquery name="getStudents" datasource="Oracle">
    select pk1
    from users
    group by pk1
    </cfquery>
    <cfquery name="getStudentCourses" datasource="Oracle">
    select course_id
    from course_users
    where users_pk1 in (......)
    </cfquery>

    Well, here is one "method", although it is a major kludge.
    You just create a series of OR statements in your 2nd query based
    on the number of items returned from your first query. Not elegant
    or efficient, but it is strictly "ColdFusion".
    <cfquery name="getStudents" datasource="Oracle">
    SELECT pk1
    FROM users
    GROUP BY pk1
    </cfquery>
    <cfquery name="getStudentCourses" datasource="Oracle">
    SELECT course_id
    FROM course_users
    WHERE 1=0
    <cfoutput query="getStudents">
    OR users_pk1 = #pk1#
    </cfoutput>
    </cfquery>
    Of course, now you may have a query with 2000 OR lines in it,
    so your query might run a little slowly the more items you select
    from the first query.
    Phil

  • My mail reverted to a pre-configured state - how do I recover?

    I tried time-machine and now have recovered folders in my mail but the accounts are still missing. Any advice on how to restore email to it's configured state?

    the first time you start Mail after TM restore it should tell you that it needs to import messages. You have to say yes. If you say "No", I think it dumps the existing mail preference file and starts anew. is this what you did?
    Quit Mail, and restore the file homedirectory/Library/Preferences/com.apple.mail.plist (delete the existing one first). also, delete the file *Envelope Index* from homedirectory/Library/Mail.
    Start Mail. It will tell you that it wants to import messages. say "yes".

  • Prepard statement how to set default value to specific place holder

    hi all
    i have a prepared statement in that, to second place holder (or dollar ) i want to
    assign a default value. can i do that
    if yes, how ?

    Ummm... the placeholders in prepared statements are question marks, not dollars.
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/PreparedStatement.html
    And no, there's no "default" features in the API.
    For every placeholder, you have to set a value, and that value will remain in place until another set, even if the preparedstatement has been executed since the last set.
    You need to do your own defaulting explicitly, with if or other conditional coding.
    A totally different approach to default values is possible with at least most databases; when the table is created, or thereafter, you can specify a default value for a column. However, this will only be applied on INSERT of new rows, and only when the INSERT statement doesn't have a value (including a NULL value) for that column. That might not work for you.

Maybe you are looking for

  • Re-installed router software - can't change password!

    I had to format my HD so I re-installed my linksys WRT54g wireless router and used the installation disk. at the end it says to put in my password. I put in every combination of password I could think of, but it keep going back and asking me again. s

  • Ftree.Get_Tree_Node_Parent

    Hi! I want to create a h-tree dynamic. I have parents and children nodes. Now i want to create a child from a child and for my query i need the parent node. so i tried this code: IF node_depth = 2 THEN      parent_node := Ftree.Get_Tree_Node_Parent(h

  • Ugly display after an upgrade

    Hello guys, I have a BIG problem. This is what my display currently looks like : Uploaded with ImageShack.us This happened after an ordinary upgrade with "pacman -Syu" and a restart, because among upgraded packages there were kernel 2.6.37 and nouvea

  • Basic Panel Keyboard Shortcut No Longer Works

    For some reason when I try to use the keyboard shortcut (command 1) to return to the basic panel it no longer works. Any ideas?

  • Howto get quad G5 to recognize 1366 x 768 resolution?

    hi, for a project we're using the panasonic PT-DW7000U-K projector, which has a native resolution of 1366 x 768. sadly our G5 doesn't show this resolution in the display preferences. how would i go about having the G5 to display this resolution? or i