rewrite the sql code

Hi all

I use below statement in my merge request:

SELECT ROWNUM FROM dual CONNECT BY LEVEL SHIFT_TYPE < = 2

I wonder do not double table. Can we get the result that above query gets hitting does not double table because the double table doesn't it belong to our schema.

Kind regards

Amrit

Requirement of the strange

Try the below one:

with x as
(
select 'a' from  where rownum <= 1
)
select rownum shift_type
from x
connect by level <=5

Tags: Database

Similar Questions

  • If I can revise the SQL code generated by OBIEE

    Hi all

    I had a problemetic SQL generated automatically by OBIEE. I have to rewrite or at least add a tip to make it complete within a fixed period.

    But I'm not sure if OBIEE offers us this feature to change or customize the SQLs it generates?

    Please help to give some advice.

    Thank you very much.
    Leon

    Hi leon,.

    OBIEE increases the performance of the aliases table, cz as he can't do oneself joined himself.
    Please visit this link this will solve your problem to improve performance
    http://www.iwarelogic.com/blog/performance-increasing-OBIEE-724
    (GOLD) http://www.rittmanmead.com/2008/11/thoughts-on-OBIEE-performance-optimization-Diagnostics/

    UPDATE POST
    @leon, you cannot change the SQL code generated by obiee, your obligation to use EXISTS instead of IN operator, then you can do this in the physical layer of RPD by accessing the properties of the table and select SQL problem and write your query with condition EXISTS on the relevant tables. So that in turn Bi server accepts and converts according to its methodology.

    UPDATE POST-2
    @leon, you can use rownum in your where clause, but check the query generated by OBIEE and the results obtained by rownum satisfied your requirment.

    Please follow label by awarding points to make it useful to others and even for us. Rules to be followed http://forums.oracle.com/forums/ann.jspa?annID=939

    hope responds to your question.mark points.

    See you soon,.
    KK

    Published by: Jocelyn on January 24, 2011 22:25

    Published by: Jocelyne 24 January 2011 22:27

    Published by: Jocelyn on January 25, 2011 02:13

    Published by: Jocelyne 25 January 2011 05:26

  • view the sql code used in a cfquery that performs an update

    I want to see the sql code used in a cfquery that performs an update. I can't do it at all, advice?

    Have you looked at the docs? May I suggest the attribute of 'result '.

  • Y at - it an easy way to get the sql code that is sent in the query UPDATE

    I have a request to UPDATE abbreviated for readability. Is there an easy way to get the sql code that is sent? I use get this info for sql select in the display of debugging in cfeclipse but not for the UPDATE.

    < cfquery debug = "" name = "q" datasource = "#datasource #" > "



    UPDATE [BookingSystem]. [dbo]. [tbTrades]
    SET
    [Status] = #MATCHED_STATUS #.
    WHERE

    clientID = < cfqueryparam value = "" #arguments.clientID # "cfsqltype ="cf_sql_integer"> AND"

    < / cfquery >

    It might pay to read the docs for - http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_17.html#1102316 - focusing on the RESULT parameter.

    Read also about debugging in CF: http://livedocs.adobe.com/coldfusion/8/htmldocs/Debug_01.html

    --

    Adam

  • Is there anyway to see the sql code generated in Report Builder?

    I'm debugging a custom report complex which includes many variables bind and lexicals and uses several user_exits for flex collect field values. Is there anyway to see the SQL code that is actually generated in the report - that is, a type of log file?

    Version of the EBS is 11.5.10.2
    Report Builder 6i

    Assuming that all of the lexical settings are in your before and after triggers setting, why not add a message pop up in your setting after trigger to display what is used? Ex:

    If: P_input1 = 'A' then
    : P_where1: =' and x = 2 ";"
    on the other
    : P_where1: =' and x = 3';
    end if;

    -make the last statement in your setting after release:
    SRW.message (1, "SQL: select a, b, c from table1 where b = 5' |: P_where1");

  • Add the new column to Admin tool, including the SQL Code

    Hi all

    I am new to OBIEE and I already searched here in the forum but have not found an exact answer which could help me.
    I have a table in the warehouse where to get information on employees. It's employe_id, manager_id and name.
    Example:
    Employe_id Manager_ID name
    1 Mueller
    2 1 Meier

    Now, I would like to create a new column in the Mapping BI Admin tool business layer and add a SQL where to select the name of the Manager.
    Is this possible? And how can we do it? It will work with a new logical column? Where we add the SQL Code?

    I hope someone can answer my question!
    Thank you very much!

    Kind regards
    David

    OK, I think I got it - the name of Manager is on a separate table (or a search to return to the current table) and your thinking that you want to label your SQL in the report to find the name of Manager based on Director ID, you have?

    If so, import the table with the names of Manager in the physical layer. If this is the same table that you already have (but want to search him in the current table) then you need to create an alias for the current table.

    For each new table in the Phy layer, or an alias - define the join (current_table.manager_id = manager_table_or_aliased_current_table.employee_id)

    Once completed, we will on the source of the logic table in the MDB for this dimension, edit, on the general tab, "Add" and select the table / alias that you created in the phy layer. Click OK - it combines now two tables attached as a source - you can then map the name of the Manager search in your column 'name '.

    Kind regards
    Alastair

  • I need the SQL code

    I need the code for SQL.  I have Windows 7 as a guest on my computer and Fedora (Linux) as a guest.  Where can I get this code?

    I need the code for SQL.  I have Windows 7 as a guest on my computer and Fedora (Linux) as a guest.  Where can I get this code?

    Hello

    You can get help for SQL on the following forums.

    Category of the SQL Server:

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Concerning

  • Rewrite the sql query

    Hello

    I need to rewrite this SQL query to give the same result, but a way more resorcefull.
    Probably using aggregation, but I'm not sure.
    Can someone give me a head start.
    desc resource_bundles
    
    Name          Null     Type                
    ------------- -------- ------------------- 
    LOCALE        NOT NULL CHAR(5)             
    BUNDLE_NAME   NOT NULL VARCHAR2(32)        
    RESOURCE_NAME NOT NULL VARCHAR2(64)        
    VALUE_STRING           VARCHAR2(2048 CHAR) 
    
    select a.bundle_name,a.resource_name, a.value_string as Czech,(select b.value_string 
                                             from resource_bundles b 
                                             where b.bundle_name = a.bundle_name
                                             and b.resource_name = a.resource_name
                                             and b.locale = 'en_US'
                                            )as English,
                                             (select c.value_string 
                                             from resource_bundles c 
                                             where c.bundle_name = a.bundle_name
                                             and c.resource_name = a.resource_name
                                             and c.locale = 'ru_RU'
                                             ) as Russian,
                                             (select d.value_string 
                                             from resource_bundles d 
                                             where d.bundle_name = a.bundle_name
                                             and d.resource_name = a.resource_name
                                             and d.locale = 'it_IT'
                                            ) as Italian
    from resource_bundles a
    where a.locale = 'cs_CZ';
    Thank you

    Published by: BluShadow on April 15, 2011 12:20
    addition of {noformat}
    {noformat} tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Hello

    Here's one way:

    SELECT       bundle_name, resource_name
    ,       MIN (CASE WHEN locale = 'cs_CZ' THEN value_string END)     AS czech
    ,       MIN (CASE WHEN locale = 'en_US' THEN value_string END)     AS english
    ,       MIN (CASE WHEN locale = 'ru_RU' THEN value_string END)     AS russian
    ,       MIN (CASE WHEN locale = 'it_IT' THEN value_string END)     AS italian
    FROM       resouce_bundles
    GROUP BY  bundle_name, resource_name
    HAVING       COUNT (CASE WHEN locale = 'cs_CZ' THEN 1 END)     > 0
    

    If you would care to view the information that Centinul mentioned, then I could test it.

    Published by: Frank Kulash, April 17, 2011 15:08
    Removed extra "(" in 'HAVING COUNT ((...)'.

  • How to rewrite the sql statement?

    Hello my query goes like this:

    Select a, b, c
    from (select 5A, b null, null double c
    Union of all the
    Select null, 4, the double null
    Union of all the
    Select 10, 3, double null) test_tab;

    and I want to get the result

    5 null null
    null null 4
    10 null null
    3 null null

    How can I rewrite the query without changing the structure of a table?

    Kind regards
    Igor

    Hello

    A way

    select a, null b, null c from test_tab where a is not null
    union all
    select null, b, null from test_tab where b is not null
    union all
    select null, null, c from test_tab where c is not null
    

    Concerning
    Anurag

  • Named view criteria with no Assistant - I write the SQL code

    Using JDeveloper/ADF 11.1.2.3.
    Is there a way to create a view named with a SQL Select which is more complex than the wizard can write?

    I know that I can write the code to create a view of the criteria when running, but then I can't just drag and drop it as a class one.

    A use case:
    I have a table named FACILITIES, with a secondary table named FACILITY_SERVICES. I want a display criteria for FACILITIES which found all facilities with all the services required in a connection variable is a comma-delimited list.
    WHERE list.to_vc_array(:requiredServices) /* I wrote this function to translate a comma delimited list to my own vc_arraytype. */
       SUBMULTISET OF 
          CAST(MULTISET ( SELECT service
                            FROM facility_services
                           WHERE facilities.facility_id = facility_services.facility_id)
               AS vc_arraytype)
    With the wizard, I can't even write a simple IN the query (football match at least one of the required services), still less the more complex (correspond to ALL required services).

    My blog http://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/ might give you a starting point. There are some hooks that you can use to implement this. Please also check Jobineshs blog (that I mention in my blog)!

    Timo

  • drop the triggers in the SQL code causes not properly completed order.

    running the following command in SQL developer, giving the following error message
    ORA-00933: SQL not correctly completed command.
    What I am doing wrong
    Begin  
    For I In (Select Trigger_Name, Owner From Dba_Triggers Where Trigger_Name Like 'ABC%' And Owner = 'my_schema')
      Loop  
        Execute Immediate 'DROP TRIGGER '||I.Owner||'.'||I.Trigger_Name;  
      End Loop;  
    End;
    Published by: Mo2 on April 16, 2010 12:21

    Published by: Mo2 on April 16, 2010 12:24

    MO2 wrote:
    Yes he has.
    is an example of the names BIN$ + i6ls2WnR/Svz0wA5LSG8A == $0

    In fact these triggers created by the database after I have remove the tables. is there a way to avoid their creation?

    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0;
    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0
                     *
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    

    Yes, oracle complained about it during a fall.
    These objects will be created if you recyclebin on.

    You can either disable your recyclebin or you can purge these items in recyclebin after a fall. Make sure that you require this function or objects in the future.

    Concerning
    Anurag

  • Change the SQL code

    Given that I do a UNION of 2 application directly on the tab ADVANCED. try to create "combine this claim with a similar request" but the filter does not pass because I use a DYNAMIC pivot table.

    If anyone can help or tell where to find information to achieve this.

    Thank you!
    Nora

    P.D.:forgive my English, but I am a translator

    Please close this thread and price points, if what I said helped. ;)

    Thank you!

  • frmcmp cannot compile the modules containing SQL code that connected to the database

    Hello

    I checked several hundred messages of the forum on the net without finding a solution.

    I have a Linux server with 11.1 WebLogics (11 GR 1 material) and FormsRuntime installed.

    I am logged in as root.

    I put all the environment variables based on the values in default.env.

    In addition, I updated TERM and ORACLE_TERM vt220. And TNS_ADMIN to the location of the sqlnet.ora and tnsnames.ora.

    I compiled a simple .pll containing only the following code:

    IS test PROCEDURE

    an INTEGER: = 0;

    BEGIN

    a: = 1;

    END;

    command:

    frmcmp_batch module = TESTLIBPLAIN.pll userid=myuser/mypassword@mydb module_type = LIBRARY output_file = TESTLIBPLAIN.plx compile_all = Yes = Yes = No. batch connection

    result: successful compilation. generated .plx.

    now, I'm trying to compile an another .pll containing just the following code:

    IS test PROCEDURE

    an INTEGER: = 0;

    BEGIN

    Select 1 in the doubles.

    END;

    command:

    frmcmp_batch module = TESTLIBSQL.pll userid=myuser/mypassword@mydb module_type = LIBRARY output_file = TESTLIBSQL.plx compile_all = Yes = Yes = No. batch connection

    result: error:

    "

    11 forms (form of the compiler) Version 11.1.1.3.0 (Production)

    Copyright (c) 1982, 2010, Oracle and/or its affiliates.  All rights reserved.

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

    With partitioning, OLAP and Data Mining options

    PL/SQL Version 11.1.0.7.0 (Production)

    Oracle V11.1.1.3.0 - Production procedure generator

    Oracle virtual graphics system Version 11.1.1.3.0 (Production)

    Oracle Multimedia Version 11.1.1.3.0 (Production)

    Oracle tools integration Version 11.1.1.2.0 (Production)

    Common tools Oracle area Version 11.1.1.3.0

    Oracle CORE Production 11.1.0.7.0

    Compile the library TESTLIB.

    Invalidate the body TEST procedure...

    Compilation of body TEST procedure...

    ERROR on line 5, column 1 0

    Ignored SQL statement

    Library TESTLIB closing...

    Errors on TEST:

    PL/SQL ERROR on line 5, column 1 0

    Ignored SQL statement

    Could not generate the library.

    FRM-30312: unable to compile the library.

    "

    the two libraries differ by having used SQl commands or not.

    I tried to compile some more complex .pll and .fmb containg the SQL code. I get similar error messages. The messages that I receive for each module are the same, I would get when compiling the module with FormBuilder 9i (Windows) without being connected to the database.

    So my first thought was, this frmcmp_batch is unable to connect to the database.

    BUT:

    From frmcmp_batch with an invalid user, password, or database name not existing (resp. not in tnsnames.ora), results in appropriate error messages (not found TNS, refusal to sign etc.).

    With myuser/mypassword@mydb I don' t get this kind of messages.

    sqlplus myuser/mypassword@mydb works.

    myuser can access all objects in the database mydb.

    mydb tnsping works.

    When I check v$ session on mydb while (!) frmcmp_batch is running, I see that it is in fact a db session, created from myuser: DB-User = myuser, terminal = myappsever, osuser = root, remote process = frmcmp_batch.  And State of the current session of the db is ACTIVE.

    As a result, frmcmp_batch fails with error messages that I expect that when there is no connection to the base, if it is connected!

    Any ideas what could be wrong with my setup?

    Help appreciated.

    Jean

    I found the solution. Seems, fmrcmp 11g can connect to, but compiles not on the 9i database. With the help of a Database 11 g resolves the problem :-)

  • output the generated SQL code

    I know that you can build the sql code generated by a query in Coldfusion 7 using the result attribute but it's nto available with Coldfusion MX and unfortunately I'm stuck with MX.

    so is it possible with MX for the SQL code generated from a CFQUERY?

    In the CF administrator, turn on debugging and enter your IP address in the appropriate box. The executed SQL appears at the bottom of the page.

    Another approach would be to do something like the following:

    SELECT a, b, c #myTable # WHERE d = "#dValue #" e = "#eValue #

    The SELECT statement in this example is identical to that of the

  • Customize the operator for the SQL command

    With JDeveloper 12.1.3, I created a search form "Panel with ADF Query Table".  After having specified the search parameters, the SQL that is subject to the MSSQL root command generates the following error message:

    < oracle.adf.controller > < Utils > < buildFacesMessage > < ADF: addition of the following JSF error: incorrect syntax [FMWGEN] [SQLServer JDBC Driver] [SQL Server] close to ' |'. >

    java.sql.SQLException: incorrect syntax [FMWGEN] [SQLServer JDBC Driver] [SQL Server] close to ' |'.

    Here is the part of SQL code that is the question:

    WHERE (((city AS (?) || '%')) AND (State AS (?) || '%') ) ) ) )

    Since MSSQL does not accept the "|" as an operator is valid, an error message is generated.  MSSQL expects the CONCAT function or operator ' + '.  Is it possible and easy to configure JDeveloper for change the operator of ' | ' to the CONCAT function?

    OK, your settings are looking as it should.

    You have two options to work around the problem.

    (1) use your own sql generator, as shown here http://www.jobinesh.com/2013/02/customizing-sql-builder-class.html

    (2) modify the sql code generated for the START WITH operator generate the right sql for sql server code. For this, you can override the method getViewCriteriaItem() as shown here https://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/

    Timo

Maybe you are looking for

  • compaq mini cq10-110es password

    Hello I have a laptop compaq mini cq10-110es Serial number is: CNU0021X83 I forgot my bios password Help me please

  • upgrades to Vista error code A 80071, 30

    My vista updates had been arrested for a long while, and now I can't download/install any update to level.  I tried individually one-by-one time and everything gives me error code A 80071, 30.  I tried wireless and ethernet connection and same result

  • Email has been compromised.

    Someone has compromised my email and send work from home ads of my address. I downloaded malware and it's still the Outlander. How can I get this cleaned up as those on my contact list are getting irritated with their reception?

  • Hp upgrade wizard is really very useful?

    OK iam getting SICK of these impasses HP cause us, I do an upgrade without struck dead hp help dvd? I know for sure that it removes cyberlinkdvd 7 compatible, and because of things that I find questionable, SO I can download all the updates and dtriv

  • How to make a refund on a subscription to Adobe Stock

    Dear Adobe,I would like to file a complaint with you in regards to the customer service awful that I received from you and your team in recent weeks. I tried for three weeks now to get a refund on a subscription to Adobe Stock, which, to my knowledge