How to see the "VIEW" in sqlplus script?

Hello gurus,

Can I know how to watch the plu "VIEW" in sql script?

So far I used the editor to look at the script, but I don't know how to watch the view SQL script?


Any idea?


Thank you!!

Hello

Capitalize the name:

select dbms_metadata.get_ddl('VIEW', 'TEST_VIEW') from dual;

Do not forget that the text inside the quotation marks (quotation marks single or double quotation marks) is case-sensitive.

The parser takes advantage of all that is not in quotes, so when you say:

create or replace view xyz.test_view as select sysdate x from dual;

What is actually esecuted is

CREATE OR REPLACE VIEW XYZ.TEST_VIEW AS SELECT SYSDATE X FROM DUAL;

and the view is called "TEST_VIEW" (uppercase), which is not the same thing as "test_view" (with all lowercase letters).

It may be not important if the other argument to get_ddl ('view') is capitalized or not. Often people write procedures to forgive if you forgot something, and the error is obvious. There is a database object that is called 'VIEW' is not a database object called 'view', and so the function can be written to correct an obvious mistake to say "view" rather than "VIEW". But it cannot be assumed that, when you say "test_view", you really wanted "TEST_VIEW": you can actually have two different objects to these two names. It would not be a very good idea (I do not use lowercase letters in the names is a good idea in any case), but you could do it.

Published by: Frank Kulash, Sep 15, 2010 15:40

Tags: Database

Similar Questions

  • In the toolbar, I click on the face of color and see the view from the RGB color space. How can I put them in CMYK?

    In the toolbar on the left, click on the face of color and see the view from the RGB color space. How can I put them in CMYK?

    German:

    In der Werkzeugleiste klicke auf Farbflache und den RGB-Farbraumansicht sehe ich. Stelle wie ich sharp in CMYK um?

    Color picker, if that's what you mean (it opens if you double-click the color proxy) is still in RGB in InDesign, but if you place the cursor in one of the fields of CMYK value, add swatch button will change to add CMYK Swatch.

    Personally, I like the color picker and use the color Panel instead.

  • How to see the fn:trace() results in the newspaper and/or console workshop?

    Hello, all.
    So, I'm a new in ODSI, in advance, my excuse to basic questions.

    I would use the fn:trace () function. However, the following code does not send information either on AdminServer.log or Wokshop console. What is the reason?

    declare the procedure tns:test() {}
    declare $timeBefore as XS: date: = fn:current-date();
    FN: trace($timeBefore, "My First test"); -> How to see the trace output?
    Returns the value $timeBefore.
    };

    Here's what I have in the console AdminServer.log and workshop:

    common/application {}
    user: weblogic
    name: testCase2
    EventKind: update
    Server: AdminServer
    }

    performance of the query / {}
    compiletime: 93
    }

    common, session, request, invocation {}
    time: Tue may 25 15:41:12 IDT 2010
    Duration: 0
    }

    Update/service {}
    procedure: test
    arity: 0
    DataService: ld:Logical/over_files/testCase_OverFiles.ds
    script: declare ns0 namespace = "" ld: logic/over_files/testCase_OverFiles ";"
    {return value ns0:test() ;}
    }

    {/ common time signature}
    timestamp: Tue may 25 15:41:12 IDT 2010
    Duration: 93
    }

    Best regards
    Yuri.

    Edited by: ygauchma may 25, 2010 05:59

    Because I'm not over your shoulder, it must be very clear on what you tried.

    Your first post show you a procedure using the trace. Well, I tried this, and instructions (ODSI set to debug and WLS logging of debug level log level) and it worked. Have you tried that? Doing a job?

    Now you're showing a function. Have you tried setting log levels?

    Where are you looking for results? The will NOT in the Console for ODSI Studio Test view (I guess that's where you're looking). They will be in the WLS log file if you have configured the log WLS-> Log level = debug file. They will be in the WLS (stdout/stderr) console if you have configured this Log level = debug.

    I believe that the trace function is implementation specific, then there is no such thing as a generic example.

    -Mike

  • How to see the info of waiting events. After executing a statement select query

    Hello

    How to see the info of waiting events. After running a select query. Is there a setting to the value of this option?
    And I also want to see the following info. in the trace file. For this, what are the settings I need to adjust to the right?
    SELECT * FROM emp, dept 
    WHERE emp.deptno = dept.deptno;
    
    call   count      cpu    elapsed     disk    query current    rows
    ---- -------  -------  --------- -------- -------- -------  ------
    Parse      1     0.16      0.29         3       13       0       0
    Execute    1     0.00      0.00         0        0       0       0
    Fetch      1     0.03      0.26         2        2       4      14 
     
    Misses in library cache during parse: 1 
    Parsing user id: (8) SCOTT 
    Concerning
    Evelyne

    For

    SQL > show parameter dump;

    ORA-00942: table or view does not exist
    >
    Use

     GRANT SEECT ON v_$parameter to Your_User_Name
    

    For

    SQL > ALTER SESSION SET EVENTS = 10046 trace name forever, context level 12';

    ERROR:
    ORA-01031: insufficient privileges
    >
    Use

     GRANT ALTER SESSION to your_user
    
  • How to see the signature of a function/procedure stored?

    Someone changed the signature of a function I am trying to run. It worked before, but now one of the parameters has changed to a new type. How to see the contents of it? It is the output in Oracle sqlplus.

    SQL > exec: rc: = newcaselistforvalidation (to_date ('2010-01-01 ',' yyyy-mm-dd hh), to_date ('2011-01-01 ',' yyyy-mm-dd hh), 100);
    START: rc: = newcaselistforvalidation (to_date ('2010-01-01 ',' yyyy-mm-dd hh), to_date ('2011-01-0))

    ***
    ERROR on line 1:
    ORA-01843: not one month valid
    ORA-06512: in "AST. NEWCASELISTFORVALIDATION', line 21
    ORA-06512: at line 1

    I suspect that this is the date which has been formatted into something new.
    SQL> desc newcaselistforvalidation
    
  • How to see the content of what's currently on my iCloud of this site

    How to see the content of what's currently on my iCloud.  I would like to see these files presented in a display of file manager type in order to sort and remove if necessary.

    Go to iCloud.com, then click on your iCloud drive icon.  I hope this is what you mean or what you are looking for.

    iCloud Drive FAQ - Apple Support

  • How to see the old registered devices?

    How to see the list of disabled devices?

    If you have devices that are associated with your Apple ID, to the use of the content purchased from iTunes Store or access to subscription services, I don't think that there is a list of previously associated devices that are no longer associated.  I don't know what you mean by devices 'off '.

    If you ask about "old devices registered" on your Apple ID support profile, they must always be there.  This list is mainly for the purpose of support services.  You can check here

    https://supportprofile.Apple.com/

  • How to see the level of ink for a dell v515w printer?

    Separated from this thread.

    How to see the level of ink for a dell v515w printer?

    Hi Albert,

    I appreciate your time display. You can refer to the manual for more information. http://www.Dell.com/Ed/business/p/Dell-V515w/PD

    To better help, contact Dell technical support.

    http://en.community.Dell.com/support-forums/peripherals/

    Thank you.

  • All the fonts/writing are gibberish and I can't not as what is written, so I can't change anything on my vista, how to see the writing again if I can read? Thank you

    All the fonts/writing are gibberish and I can't not as what is written, so I can't change anything on my vista, how to see the writing again if I can read? Thank you

    Try cleartype youre settings, follow this link.

    http://www.Microsoft.com/en-us/typography/default.aspx

    Also, look for downloads 'police' as you need...

    1, select "cleartype online setting" you will probably get a download popup, install the

    Update...

  • How can see the motherboard serial number in windows 7

    Salvation;

    I need how can see the serial number of the motherboard in windows 7
    I look forward to help me
    Thank you...

    You will most likely need remove the left side panel and look at the motherboard to determine the serial number.

  • How I see the preview image of my PDF documents?

    How I see the preview image of my PDF documents?

    Hi josepm26085232,

    Preview of thumbnails has been disabled in the latest Adobe Acrobat Reader DC due to security problem.

    If you want this feature, you will need to uninstall the latest version & reinstall the old version of the Adobe - Adobe Acrobat Reader DC Distributiondrive.

    Kind regards
    Nicos

  • OA Framework page customization - how to change the view Instance

    OA Framework page customization - how to change the view Instance

    Hello
    I have to add extra field to a page.
    View instance, I found, but there is no attribute that I need.

    Is it possible to change the Instance from the view of the application level
    because you use only not JDeveloper?

    Thank you
    Malin

    Hi smart,

    If your VO does not include the column you are looking for, then the only way to achieve is through substitution of VO for which you use jdeveloper.
    You can't accomplish by customizing.

    Thank you
    Sree

  • How to retrieve the view coming from Onyx?

    Hello

    I started to use the Onyx project recently. That is truly amazing to see what he does. I wonder if there is a possibility to check the main view... let my try to explain this.

    I want to change the box of esxi5 - Advanced/Logging option to external syslog server.

    While in the interface graphics, I did my steps and Onyx prints the output:

    #---UpdateOptions-

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    _this $ = get-view-Id "OptionManager-EsxHostAdvSettings-456.
    _this $. UpdateOptions ($changedValue)

    This does not work as expected. I can throw it to powercli and it will introduce the option. This works only for this area special esxi. I want to create a loop that will change this option to each area of esxi in the cluster.

    The view that uses onyx is: ' Get-View-Id "OptionManager-EsxHostAdvSettings-456'»»

    That he already knows the moref / host of the view.

    But if I would like to have this in a loop, so it will do for each host, so how can I get this kind of view?

    So far, I could build only something like

    foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

    {

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    $number = $vmhostview.moref.split("-") [1]

    _this $ = get-view-Id OptionManager - EsxHostAdvSettings - $nombre
    _this $. UpdateOptions ($changedValue)

    }

    Which is totally stupid approach I think it works... splitting moref...

    After a while, I noticed that

    http://pubs.VMware.com/VI-SDK/visdk250/ReferenceGuide/Vim.option.OptionManager.html

    Said OptionManager is owned by configuration manager. So that I could get the id from this point of view:

    ((get-vmhost myHost | get-vue).) ConfigManager.AdvancedOption). ToString()

    which will result in the output: OptionManager-EsxHostAdvSettings-456

    In order to have this I could make my loop at the end:

    foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

    {

    $changedValue = new-Object VMware.Vim.OptionValue [] (1)
    $changedValue [0] = new-Object VMware.Vim.OptionValue
    .key $changedValue [0] = "Syslog.global.logHost".
    $changedValue [0] .value = "tcp://x.x.x.x:514".

    _this $ = get-view-Id ($vmhostview. ConfigManager.AdvancedOption). ToString()

    _this $. UpdateOptions ($changedValue)

    }

    Now I don't know that it was just a chance that I found the location of the view name or it's the way I'm supposed to find the name of view id. I wonder how other people treat such cases, if there is more easy way to do it. If someone could share its experience I would really appreciate it.

    Kind regards

    Greg

    There is not need to build these view ID as you see them from Onyx.

    In fact, I wanted to write this script like this

    $changedValue = New-Object VMware.Vim.OptionValue[] (1)
    $changedValue[0] = New-Object VMware.Vim.OptionValue $changedValue[0].key = "Syslog.global.logHost" $changedValue[0].value = "tcp://x.x.x.x:514"
    
    Get-View -ViewType HostSystem -Searchroot (Get-Cluster "xxyyzz").ExtensionData.MoRef | %{
      $optMgr = Get-View $_.ConfigManager.AdvancedOption  $optMgr.UpdateOptions($changedValue)
    }
    
    • Move the part that does not change with each HostSystem outside the loop
    • The ConfigManager is a table with MoRefs pointing to the respective managers. You can just do a Get - view with a MoRef and it returns the object that represents the Manager
    • From the object manager, you can now call the method

    BTW, you better see the last SDK Reference.

    You can find the HostConfigManager here.

  • How to get the DDL to sqlplus as the TOAD

    Hello

    I have to work on a computer terminal for a client where the TOAD is not installed. For my regular activities of s/n, I need to take the DDL several times.
    I'm very used to the style of the DDL scripts that TOAD 9.6.x.x gives to any object in a schema.

    Can anyone suggest how I can get exactly TOAD - like scripts (which provide not only the create statements)

    For example

    * 1. sqlplus from when I *.
    Select dbms_metadata.get_ddl ('TABLE', 'APE1_ACCUMULATORS') of double;

    I only get the bottom

    CREATE THE TABLE XLTDBO92. APE1_ACCUMULATORS
    (
    CYCLE_CODE NUMBER 4 APE1ACCU_CYCLE_CODE_NN CONSTRAINT NOT NULL,.
    CYCLE_INSTANCE NUMBER (2) CONSTRAINT APE1ACCU_CYCLE_INSTANCE_NN NOT NULL,
    CUSTOMER_SEGMENT NUMBER 4 APE1ACCU_CUSTOMER_SEGMENT_NN CONSTRAINT NOT NULL,.
    CUSTOMER_ID NUMBER (9) CONSTRAINT APE1ACCU_CUSTOMER_ID_NN NOT NULL,
    ACCUM_TYPE_ID NUMBER (9) CONSTRAINT APE1ACCU_ACCUM_TYPE_ID_NN NOT NULL,
    OWNER_ID
    )

    * 2. of TOAD 9.6.x.x but when I click on 'create scripts' I'll get *.

    DROP TABLE XLTDBO92. APE1_ACCUMULATORS CASCADE CONSTRAINTS;
    CREATE THE TABLE XLTDBO92. APE1_ACCUMULATORS
    (
    CYCLE_CODE NUMBER 4 APE1ACCU_CYCLE_CODE_NN CONSTRAINT NOT NULL,.
    CYCLE_INSTANCE NUMBER (2) CONSTRAINT APE1ACCU_CYCLE_INSTANCE_NN NOT NULL,
    CUSTOMER_SEGMENT NUMBER 4 APE1ACCU_CUSTOMER_SEGMENT_NN CONSTRAINT NOT NULL,.
    CUSTOMER_ID NUMBER (9) CONSTRAINT APE1ACCU_CUSTOMER_ID_NN NOT NULL,
    ACCUM_TYPE_ID NUMBER (9) CONSTRAINT APE1ACCU_ACCUM_TYPE_ID_NN NOT NULL,
    OWNER_ID
    )

    DROP SYNONYM XLTDB92. APE1_ACCUMULATORS;

    CREATE SYNONYM XLTDB92. APE1_ACCUMULATORS FOR XLTDBO92. APE1_ACCUMULATORS;


    GRANT DELETE, INSERT, SELECT, UPDATE ON XLTDBO92. APE1_ACCUMULATORS TO XLTDBO92_ALL;


    So my question is:
    How to such scripts from sqlplus, regardless of the type of the object? _


    Note: I'm writing a new thread because my previous question has been answered, even if I was not able to type in completely. My mistake as it was published in before that I could finish the question.

    Regds,
    Malika

    If the DDL returned by dbms_metadata isn't to your liking, then write your own scripts to generate the DDL or cover scripts to generate all the items you want.

    In the case of synonyms and grants, is very easy using the RDBMS dictionary views, but if you generate a table DDL you also want and need the PK, UK, FK, secondary indexes, comments and policies on the table as well as synonyms and subsidies. All that if you delete the tables goes.

    There is a get_dependent_ddl dbms_metaddata of procedure to generate objects dependend on a table that can be interesting.

    HTH - Mark D Powell.

  • How to see the batteries on an iPad Pro specifically the pencil of Apple?

    iPad Pro; 9.3.3 iOS; I can't find "Batteries" on my record of Notifications to see how much power I have left on my iPhone and Apple pencil

    Humble Tad Hello,

    Thank you for using communities of Apple Support.

    From your post, I understand that you are not able to locate the section on your iPad Pro that shows you your battery info Apple pencil. I know how it is important for you to know how much battery is left for you to use. You will not be able to see the information of the battery for an iPhone, but you will see the iPad Pro and Apple pencil battery information. Please see below for more information:

    Use the pencil to Apple with iPad Pro

    To see the load your pencil Apple left, check the view of Widgets in the Notifications on your iPad Pro.

    See you soon

Maybe you are looking for