Need a query...

My version of oracle is 11.

I want to prepare a DDL script for all the listed items below...

1. the tables with all the options

2 views

3 types

4. the index

5. packaging / procedures / functions / triggers - only object name

6 triggers - Source of relaxation

7. subsidies to other patterns - other than PSUSR, PSQRYUSR, PSAPEX and PSBROWUSR

8. materialized views

9 sequences

10. the directories

11 objects JAVA

12. planners list



I tried dbms_metadata.get_ddl (table_name) select double package; who will seek to single table and in which I have to mention the name of each table, but I tried like this
Select dbms_metadata.get_ddl('a.table_name) from user_tables, but his does not work I do not know that where I'm going wrong and its launch this error...


ORA-06553: PLS-306: wrong number or types of arguments in the call to 'GET_DDL '.
06553 00000 - "PLS - %s: %s.
* Cause:
* Action:

Kindly give your ideas... Thank you too...

For other objects like triggers, I know I have to use get_dependant_ddl, but its not only an object of his i have to get all the objects that are available in the particular schema...

Rgds,
Nitesh Perron.

Niteshprk wrote:
You use where clause, but I don't want to filter everything that I need all the tables it is useless to all where clause and I get this error while running this query after correction he...

Select dbms_metadata.get_ddl ('TABLE', a.table_name) from user_tables one

ORA-31603: object not found 'SYS_IOT_OVER_743606' of type TABLE in the schema "CPDFP".
ORA-06512: at "SYS." Dbms_metadata", line 5088
ORA-06512: at "SYS." Dbms_metadata", line 7589
ORA-06512: at line 1

Yes, I used the Where clause to filter a table few of my environment that contains thousands of tables.

Use on the by-pass Ito:

SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
     FROM USER_TABLES u
     WHERE u.nested='NO'
     AND (u.iot_type is null or u.iot_type='IOT');

Tags: Database

Similar Questions

  • Need to query the result with two different of a same attribute values

    Hi all

    I have a search query where I need the query result when an attribute have two different values (e.g.: want the query result when the attribute 'status' is equal to 1 and 2)

    And also, the user will be able to search by any State result.

    What is the best way to implement this.

    Thank you
    DK

    The solution to this use case is to put the part by default ((statut == 1 ou statut == 2) and: bindUserInput is null) as part of the query and the Pratt of the query to run when a value is entered by the user in a view criteria. East view criteria (Status ==: bindUserInput) and the value of the checkbox to ignore the values null. If the binding variable: bindUserInput is null, only the portion of the query is running, if the binding variable is not null, the display criteria is added at the request of three and three default components will not return any line.

    Timo

  • Need to query for the monthly total compensation

    Hi all
    Please I need a query that he will show me the name, identification number, and the total compensation
    total compensation = gain Total - Total deduction
    I can find the total compensation in pay stubs, but I need the query to do some reports

    Thanks in advance

    The modified query is less. You can change the names of Classification if needed.

    Select women's wear. EMPLOYEE_NUMBER, sum (DECODE (pec.classification_name,
    "Involuntary deductions", ((-1))
    * TO_NUMBER (prrv.result_value)).
    'Statutory deductions', ((-1))
    * TO_NUMBER (prrv.result_value)).
    "Earnings", TO_NUMBER (prrv.result_value)
    ) Paid_Value
    of apps.pay_payroll_actions App
    apps.pay_assignment_actions PAA
    apps.pay_run_results prr
    apps.pay_run_result_values prrv
    apps.pay_input_values_f piv
    apps.pay_element_types_f pet
    apps.pay_element_classifications pec
    apps.per_all_assignments_f ADP
    apps.per_all_people_f women's wear
    where App. PAYROLL_ACTION_ID = PAA. PAYROLL_ACTION_ID
    and the PAA. ASSIGNMENT_ID = ADP. ASSIGNMENT_ID
    and the PAA. EFFECTIVE_DATE between the ADP. EFFECTIVE_START_DATE and ADP. EFFECTIVE_END_DATE
    and the PAA. ACTION_TYPE = 'R '.
    - and the PAA. BUSINESS_GROUP_ID =: BG_ID
    - and the PAA. ACTION_STATUS = 'C '.
    and prr. ASSIGNMENT_ACTION_ID = PAA. ASSIGNMENT_ACTION_ID
    and prr. RUN_RESULT_ID = prrv. RUN_RESULT_ID
    and prrv. INPUT_VALUE_ID = piv. INPUT_VALUE_ID
    and piv.NAME = 'value to pay '.
    and domestic animals. ELEMENT_TYPE_ID = prr. ELEMENT_TYPE_ID
    and domestic animals. CLASSIFICATION_ID = pec. CLASSIFICATION_ID
    and the PAA. "EFFECTIVE_DATE =: PAYROLL_DATE - FEBRUARY 23, 2012 '-: PAYROLL_DATE - FEBRUARY 23, 2012"
    and women's wear. EMPLOYEE_NUMBER =: EMP_ID
    and ADP. PERSON_ID = papf.person_id
    and the PAA. EFFECTIVE_DATE between women's wear. EFFECTIVE_START_DATE and women's wear. EFFECTIVE_END_DATE
    Group of women's wear. EMPLOYEE_NUMBER

  • Help needed dynamic query

    Hai I want dynamic query for framing
    CREATE TABLE PI4 (COR varchar2(1),dep varchar2(3),cod_rc varchar2(2))
    
    insert into pi4(dep,cod_rc) values('A01','5C')
    
    insert into pi4(dep,cod_rc) values('DAC','5L')
    HORN must be updated using dynamic query
    as below
    UPDATE PI4         
            SET
         PI4.COR = ’O’
    WHERE
         PI4.DEP IN ('A01','A02','A03')
    OR
         (
         PI4. dep IN ('DAC','FTS','G12')
         AND
         PI4.COD_RC = '5L'
         )
    sql_stament is that the variable must be set to above code.

    Pls help


    S

    Check below the code where the CO value is assigned dynamically to a p_cor variable

    DECLARE
    v_sql_statement VARCHAR2(32767) := NULL;
    p_cor VARCHAR2(10) := 'O';
    BEGIN
    v_sql_statement := 'UPDATE PI4 SET PI4.COR ='||p_cor||' WHERE (PI4.DEP IN (''A01'',''A02'',''A03'') OR (PI4. dep IN (''DAC'',''FTS'',''G12'') AND PI4.COD_RC = ''5L''))';
    EXECUTE IMMEDIATE v_sql_statement;
    END;
    

    If you do not need dynamic query to perform the update:

    See the code below:

    DECLARE
    p_cor VARCHAR2(10) := 'O';
    BEGIN
    UPDATE PI4 SET PI4.COR =p_cor WHERE PI4.DEP IN ('A01','A02','A03') OR (PI4. dep IN ('DAC','FTS','G12') AND PI4.COD_RC = '5L'));
    END;
    

    Published by: AP on July 27, 2010 03:39

    Published by: AP on July 27, 2010 04:51: end tag code included

  • I need a query that selects the amount of records for each day of a table.

    I need a query that selects the amount of records for each day of a table.
    For example, the result would be:

    1 14 date
    Date 2-3

    etc.

    Any ideas?

    Sort:

    SELECT count ([IDCommentaire]), convert (varchar, dateAdded, 112)

    OF COMMENTSgroup by convert (varchar, dateAdded, 112)

  • I need a query that returns the average amount of characters from text colum in MS SQL.

    I need a query that returns the average amount of characters from text colum in MS SQL.

    Could someone show me how?

    Sorting, I need of the

    DATALENGTH

    function

  • Need to query to find missing months between two dates.

    A bank customer a monthly overview of databases (in the tens of millions of accounts)

    The data are sent with a line per account each month.  It is stored in a table called "ACCOUNTS_TAB".

    Fields on registration, which

    Column

    Description

    Example of format.

    * YRMTH-1

    Year and month of the snapshot

    6-character numeric, 4-digit year added to months of 2 digits, example 201301, 201311

    * AccountID

    Unique identifier for an account.

    Integer, example 100098322

    Opening balance - 1

    Initial account balance at the closing of the previous month

    $30000

    Closing balance - 1

    The account balance at the end of the month of closing

    $34200

    Class-1 relative to investments

    .....

    ...

    .....

    ......

    .....

    Many more columns, two favorites (*) columns are alone, that you will need for the query. There are no columns to tell when an account is closed, or has just opened, and not separate "master account" - you use this single table for your query that results.

    The table was in place from 200301, so many accounts have dozens of lines, if they have been open for many years and other only 1 or 2 ranks, if new.

    Write a query to give just a list of accountDs that meet the following criteria.

    1. 1) has a record for specific 201503
    2. 2) was also a record for the month specific 201602
    3. 3) missing one or several months between these two records.

    A good account which was opened from 201503 to 201602 inclusive would of course have lines for

    201503

    201504

    201505

    201506

    201507

    201508

    201509

    201510

    201511

    201512

    201601

    201602

    It's good to hardcode the month of departure (201503), end of month (201602) and the actual number of months between them (10 exclusive or 12 inclusive) as part of your query.

    Once again the account must meet all 3 criteria to be an account issue.  If only, they have a partial set of these documents but do not have the month of departure, or is not the end of the month, it is not a problem, only when they have so specified and end early and not a full between game.


    Help, please!

    Maybe this...

    -----

    -The Dataset for the test begins

    WITH dataset (ACCOUNT_NO, DATES)

    AS (SELECT 100, DOUBLE 201503

    UNION ALL

    SELECT 100, DOUBLE 201504

    UNION ALL

    SELECT 100, DOUBLE 201505

    UNION ALL

    SELECT 100, DOUBLE 201506

    UNION ALL

    SELECT 100, DOUBLE 201507

    UNION ALL

    SELECT 100, DOUBLE 201508

    UNION ALL

    SELECT 100, 201509 OF THE DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201510

    UNION ALL

    SELECT 100, 201511 OF THE DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201512

    UNION ALL

    SELECT 100, 201601 DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201602

    UNION ALL

    SELECT 200, DOUBLE 201503

    UNION ALL

    SELECT 200, DOUBLE 201504

    UNION ALL

    SELECT 200, DOUBLE 201505

    UNION ALL

    SELECT 200, DOUBLE 201506

    UNION ALL

    SELECT 200, DOUBLE 201508

    UNION ALL

    SELECT 200, DOUBLE 201509

    UNION ALL

    SELECT 200, DOUBLE 201510

    UNION ALL

    SELECT 200, DOUBLE 201511

    UNION ALL

    SELECT 200, DOUBLE 201512

    UNION ALL

    SELECT 200, 201601 DOUBLE

    UNION ALL

    SELECT 200, DOUBLE 201602

    UNION ALL

    SELECT 300, DOUBLE 201503

    UNION ALL

    SELECT 300, DOUBLE 201504

    UNION ALL

    SELECT 300, DOUBLE 201505

    UNION ALL

    SELECT 300, DOUBLE 201506

    UNION ALL

    SELECT 300, DOUBLE 201507

    UNION ALL

    SELECT 300, DOUBLE 201508

    UNION ALL

    SELECT 300, DOUBLE 201509

    UNION ALL

    SELECT 300, DOUBLE 201510

    UNION ALL

    SELECT 300, DOUBLE 201511

    UNION ALL

    SELECT 300, 201601 DOUBLE

    UNION ALL

    SELECT 300, DOUBLE 201602

    UNION ALL

    SELECT 400, DOUBLE 201504

    UNION ALL

    SELECT 400, DOUBLE 201505

    UNION ALL

    SELECT 400, DOUBLE 201506

    UNION ALL

    SELECT 400, DOUBLE 201507

    UNION ALL

    SELECT 400, 201508 DOUBLE),

    -The Dataset to test ends

    -Hand with clause begins

    ResultSet

    AS (SELECT account_no,

    CASE

    WHEN COUNT)

    CASE WHEN dates IN (201503, 201602) THEN 1 END)

    COURSES (PARTITION BY account_no) = 2

    AND (COUNT (DISTINCT SUBSTR (dates, 4)))

    COURSES (PARTITION BY account_no) = 12

    OR COUNT (DISTINCT SUBSTR (dates, 4))

    COURSES (PARTITION BY account_no)<>

    AND COUNT (DISTINCT SUBSTR (dates, 1, 4))

    (PARTITION BY account_no) > 1

    THEN

    « Y »

    ON THE OTHER

    « N »

    END

    FLG

    THE dataset---> replace with your table name

    GROUP BY account_no, dates)

    SELECT DISTINCT Account_no

    FROM THE result set

    WHERE flg = 'Y ';

    -Hand with the ends of the clause

    ACCOUNT_NO

    -----------------------

    100

    300

    200

    See you soon,.

    Manik.

  • Need to query for check missing synonyms

    A query need to check in a schema

    The synonyms created for the table - name of the table and their number (if any missing names synonyms)

    Named for objects procedures - synonyms name and their number (if there are missing names synonyms)

    Synonyms named name of sequences and their number (if there are missing their names synonyms)

    How can I design it.

    Hello

    Think about synonyms on all. You have less troubles to keep that way. Start using qualified names on objects that are in a different schema and if possible just run alter session set current_schema = this scheme;

    If you need to use synonyms for everything and check them as you said, use SQL to views of the dictionary to get the differences.

    Lack of synonyms for example report:

    select dba_tables.owner,  dba_tables.table_name, dba_synonyms.owner, nvl(dba_synonyms.synonym_name, 'this synonym was never here or lost in maintenance') synonym_name
    from dba_tables left join dba_synonyms on (dba_tables.table_name = dba_synonyms.table_name)
    where dba_tables.owner = upper('&owner')
    -- and dba_synonyms.table_name is null
    ;
    

    Note! This script illustrates SQL dict views. It isn't a perfect solution and valid for your application.

    See http://docs.oracle.com/cd/B28359_01/server.111/b28318/datadict.htm#CNCPT002

  • Need to query to find stored procedures that takes great execution time

    Hi all

    I use the oracle version below:

    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    is it possible to find the name of stored procedure that take too long to run, I need those optimized all SPs.

    Is there a query as top queries that are used to find queries albums that have great time for execution...

    or y at - it another way to find the names of MS. I try with AWR report but showing only used the names of MS.

    Thank you

    No, it not there no such request as far as I know.

    or y at - it another way to find the names of MS.

    Just listen to complaints from the user...

  • need SQL query suggestion

    Hi all

    Create the table t_payroll

    (number payroll_id)

    Insert into t_payroll values (10)

    Insert into t_payroll values (20)

    Insert into t_payroll values (30)

    Insert into t_payroll values (40)

    Insert into t_payroll values (50)

    commit;

    Select * from t_payroll

    Output:

    Payroll_Id

    10

    20

    30

    40

    50

    Requirement: to spend on payroll id as a parameter, if passed null, then should recover 10,20,30 Payroll id only.

    I tried as follows:

    Select * from t_payroll

    where payroll_id between nvl (& p_payroll_Id, 10) and nvl (& p_payroll_id, 30)

    I hope that the work of query above, but it may not work if I need the 10,20,40 payroll Id only.

    Please suggest.

    Thanks for all your support...

    Kind regards

    Afzal.

    Select * from t_payroll

    where (payroll_id = "& p" or (payroll_id in (10,20,30) and '& p' a null value))

    ----

    Ramin Hashimzade

  • Need to query the available values for EA Qualitative list

    I need to provide the ID attribute, the name and the list of values of an extended attribute qualitative:


    I can easily get the ID and name, but do not see the path to the other values

    SELECT commonextendedattributetypeml . name ,

    commonextendedattributetype . attributeType

    DE agile . commonextendedattributetype , agile . commonextendedattributetypeml

    ( ) ()commonextendedattributetypeml. fkextendedattributetype =

    commonextendedattributetype . pkid ))

    ET commonextendedattributetypeml . name AS '%TM'

    ET commonextendedattributetype . attributeType = 'QUALITATIVE' ;

    Try the following SQL code:

    SELECT ml.name,

    t.AttributeType,

    t.AttributeID,

    qualML.Quality

    Of

    commonextendedattributetype t

    INNER JOIN commonextendedattributetypeml on ml.fkExtendedAttributeType = t.pkid and ml.langID = 0 ml

    List INNER JOIN comExtendedAttrQualityList on list.fkExtendedAttribute = t.pkid

    INNER JOIN commonExtendedAttributeQuality on list.pkid = qual.fkQualityList qual

    INNER JOIN qualML on qualML.fkExtendedAttributeQuality = qual.pkid and qualML.langID = 0 comExtendedAttributeQualityML

    WHERE

    ml. Name LIKE '% TM' AND t.attributetype = 'QUALITATIVE '.

    ORDER BY ml.name

    Note that the above query restricts the language id of 0 (for English) in two places

  • Dear need to query result

    Hi all

    I need a a query that will return the results of a more expensive query that is taking most of the I/O /memory.


    Thank you

    In addition to what sb invited:

    Why not the most used network?

    But yes, if you want to see Top SQL statements that use the most resources then:

    long value 9999999
    set line 200;
    for a50 sql_text column

    SELECT *.
    (Substr(a.sql_text,1,50) SELECT sql_text,
    Trunc(a.disk_reads/decode(a.executions,0,1,a.executions)) reads_per_execution;
    a.buffer_gets,
    a.disk_reads,
    a.executions,
    a.sorts,
    a.Address
    V $ sqlarea one
    ORDER BY 2 DESC) WHERE rownum<=>
    /

    And I think that the question was already answered to your phone too:
    How to find the most executable query in the database

    Concerning
    Girish Sharma

  • Need help query subquery

    Hey guys,.
    I have a question that I can't wrap my head around. I have a table called traffic, and in this table I have tons of columns... I focus mainly on three pillars, VIOLATIONTYPE, TID, AND guid. When a judgment is made, it receives a uniqueIdm which is the GUID column.
    If more than one ticket is given to the individual, the guid remains the same. I need to write a query to find out how many warnings is emitted by the user who is TID column.
    The problem is, if more than one ticket has been assigned at the time of the stop and these tickets are not only attention, but also a quote, I won't count that stops traffic in my query.
    I just need all the stops that are strictly warnings.
    Of course, I know how to extract the warnings, but if the guid is a warning and reference both, I don't know how to remove the records in the query. Any help would be appreciated. The query below, I wrote is just the initial steps to get * him to stop before I eliminate records where a quote and a caveat had the same GUID...

    Select * from traffic where tid = "1234" and violationtype = "warning" and guid in (select traffic seq_guid b where a.guid = b.guid)

    Consider using a NOT IN or NOT EXISTS a subquery to allow lines with citations, something like (not tested)

    select *
      from traffic a
     where tid='1234'
        and violationtype = 'warning'
        and guid in (select seq_guid from traffic b where a.guid = b.guid)
        and not exists (select 0 from traffic c where c.guid = a.guid and violation_type = 'citation')
    
  • Need to query the information in the table - more than 1 d

    I am writing a Facebook application and want to compare my db user with information returned from Facebook. I get the correct information of FB as a table with a structure on the inside. It is not letting me use ArrayToList, so I guess it's because of the structure.

    When I use the code that is attached, it browse the data and returns all the correct information.

    I am completely vaporlocked on is how to use the data returned by this loop to the query, as in:
    SELECT foo
    FROM bar
    WHERE uid IN (loop of the correct information)

    I feel like this should be easy enough, and it is making me want to push my eyes. Thank you in advance and please let me know if you need additional information.

    You rock as Satan. Thank you very much. : D

  • help needed in query select

    Hello

    I use the apex of oracle 10g 3.2
    I use a select statement inside a cursor in an anonymous PL/SQL process. The output of the query is like that.

    Method_id patient_id result index_repeat
    39 123 12 0
    29 123 23 0
    39 123 32 1

    Now what I want, that is if there is more then a method_id as 39 occurs twice with index_repeat 0 and 1, then take only with index 39 repeat 1 I mean the output of what I want is the select query

    Method_id patient_id result index_repeat
    29 123 23 0
    39 123 32 1

    I use the following query

    Select method_internal_index, result, patient_id_code, index_repeat
    of t_files_data_exp
    where f_id =: P56_F_ID

    F_ID is the primary key.

    Thank you
    Olivier

    Don't know what exactly you need. When I read your condition sounds like all you need is the following;

    select  method_internal_index
           ,patient_id_code
           ,result
           ,index_repeat
    from    t_files_data_exp
    where   f_id=:P56_F_ID
    and     index_repeat = 1
    

    However, I suspect that what you need is the following;

    select * from
    (
      select  *
             ,row_number() over (partition by method_id order by index_repeat desc) rn
      from    t_files_data_exp
      where   f_id=:P56_F_ID
    )
    where rn = 1
    

    because I assume that the INDEX_REPEAT could be 2 or 3 or more!

Maybe you are looking for

  • Games on Macbook Pro - retina with AMD M370X 2015

    New to Macbook Pro laptops. I bought 10 TIA for frames here at my job and supported more than 2 years now. Bought a new Macbook Pro the retina with the Radeon M370X graphics option 2015. I'm used to the game on Windows laptops and I have a question r

  • Satellite A300 - its different in PSAJ4E and PSAG8E

    I have two Toshiba Satellite A300. An A300 - 15K (PSAJ4E) and a driver Conexant instaled. Second is A300-20th (PSAG8E) and the driver of Realtek Semiconductor Corporation. The sound coming from harman/kardon in the first is beautiful and the second w

  • 'Skype cannot connect' Windows issue 8

    Hello Recently, I tried connecting to Skype and it displays the error "Skype cannot connect. I am sure that my internet connection is stable, and I'm using the correct password because my Skype sign me usually automatically. I tried to update to the

  • Slow wifi connection

    Hello I recently bought a PC Hp Envy 17 j106sf and free wifi does not work properly. The speed of the wifi used to be more than 20 MB/s on my old computer and is currently the subject of 2 Mb/s. Ethernet works perfectly well. The wifi card is a Ralin

  • 1630 error code appears when you try to UNINSTALL Avery Wizard

    Can't get my Control Panel Add / Remove programs to uninstall this program which I use never - tried - it tries to install - then uninstall - then gives me an error message: error # 1630.