View criteria JDev 12.1.3 built invalid SQL

Hello world

It seems that in JDev 12.1.3 when a criterion for the view is created with a standard nested, generated when running query is not valid. It uses incorrectly alias upon accession of the two VO

For example, I created two simple VO:

ViewObj1 (SELECT 1 VO1_ID, "ViewObj1" DOUBLE TITLE):

<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
  xmlns="http://xmlns.oracle.com/bc4j"
  Name="ViewObj1"
  Version="12.1.3.10.8"
  InheritPersonalization="merge"
  BindingStyle="OracleName"
  CustomQuery="true"
  PageIterMode="Full">
  <DesignTime>
    <Attr Name="_isExpertMode" Value="true"/>
  </DesignTime>
  <Properties>
    <SchemaBasedProperties>
      <LABEL
        ResId="model.views.ViewObj1_LABEL"/>
    </SchemaBasedProperties>
  </Properties>
  <SQLQuery><![CDATA[SELECT 1 VO1_ID, 'ViewObj1' TITLE FROM DUAL]]></SQLQuery>
  <ViewAttribute
    Name="Vo1Id"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Type="java.math.BigDecimal"
    ColumnType="NUMBER"
    AliasName="VO1_ID"
    Expression="VO1_ID"
    SQLType="NUMERIC"/>
  <ViewAttribute
    Name="Title"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Precision="8"
    Type="java.lang.String"
    ColumnType="CHAR"
    AliasName="TITLE"
    Expression="TITLE"
    SQLType="CHAR">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="8"/>
    </DesignTime>
  </ViewAttribute>
  <ViewCriteria
    Name="ViewObj1Criteria"
    ViewObjectName="model.views.ViewObj1"
    Conjunction="AND">
    <Properties>
      <CustomProperties>
        <Property
          Name="displayOperators"
          Value="InAdvancedMode"/>
        <Property
          Name="autoExecute"
          Value="false"/>
        <Property
          Name="allowConjunctionOverride"
          Value="true"/>
        <Property
          Name="showInList"
          Value="true"/>
        <Property
          Name="mode"
          Value="Basic"/>
      </CustomProperties>
    </Properties>
    <ViewCriteriaRow
      Name="ViewObj1Criteria_row_0"
      UpperColumns="1">
      <ViewCriteriaItem
        Name="ViewObj1Criteria_ViewObj1Criteria_row_0_Title"
        ViewAttribute="Title"
        Operator="STARTSWITH"
        Conjunction="AND"
        Value=""
        Required="Optional"/>
      <ViewCriteriaItem
        Name="ViewObj1Criteria_ViewObj1Criteria_row_0_ViewObj2"
        ViewAttribute="ViewObj2"
        Operator="EXISTS"
        Conjunction="AND"
        IsNestedCriteria="true"
        Required="Optional">
        <ViewCriteria
          Name="ViewObj2NestedCriteria"
          ViewObjectName="model.views.ViewObj2"
          Conjunction="AND">
          <ViewCriteriaRow
            Name="ViewObj2NestedCriteria_row_0"
            UpperColumns="1">
            <ViewCriteriaItem
              Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Vo1Id"
              ViewAttribute="Vo1Id"
              Operator="="
              Conjunction="AND"
              Value=""
              Required="Optional"/>
            <ViewCriteriaItem
              Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Title"
              ViewAttribute="Title"
              Operator="STARTSWITH"
              Conjunction="AND"
              Value=""
              Required="Optional"/>
          </ViewCriteriaRow>
        </ViewCriteria>
      </ViewCriteriaItem>
    </ViewCriteriaRow>
  </ViewCriteria>
  <AttrArray Name="KeyAttributes">
    <Item Value="Vo1Id"/>
  </AttrArray>
  <ViewLinkAccessor
    Name="ViewObj2"
    ViewLink="model.views.ViewLink"
    Type="oracle.jbo.RowIterator"
    IsUpdateable="false"/>
  <ResourceBundle>
    <PropertiesBundle
      PropertiesFile="model.ModelBundle"/>
  </ResourceBundle>
</ViewObject>



ViewObj2 (SELECT 1 VO1_id, VO2_ID 2, "ViewObj2" DOUBLE TITLE):

<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
  xmlns="http://xmlns.oracle.com/bc4j"
  Name="ViewObj2"
  Version="12.1.3.10.8"
  InheritPersonalization="merge"
  BindingStyle="OracleName"
  CustomQuery="true"
  PageIterMode="Full">
  <DesignTime>
    <Attr Name="_isExpertMode" Value="true"/>
  </DesignTime>
  <Properties>
    <SchemaBasedProperties>
      <LABEL
        ResId="model.views.ViewObj2_LABEL"/>
    </SchemaBasedProperties>
  </Properties>
  <SQLQuery><![CDATA[SELECT 1 VO1_id, 2 VO2_ID, 'ViewObj2' TITLE FROM DUAL]]></SQLQuery>
  <ViewAttribute
    Name="Vo1Id"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Type="java.math.BigDecimal"
    ColumnType="NUMBER"
    AliasName="VO1_ID"
    Expression="VO1_ID"
    SQLType="NUMERIC"/>
  <ViewAttribute
    Name="Vo2Id"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Type="java.math.BigDecimal"
    ColumnType="NUMBER"
    AliasName="VO2_ID"
    Expression="VO2_ID"
    SQLType="NUMERIC"/>
  <ViewAttribute
    Name="Title"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Precision="8"
    Type="java.lang.String"
    ColumnType="CHAR"
    AliasName="TITLE"
    Expression="TITLE"
    SQLType="CHAR">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="8"/>
    </DesignTime>
  </ViewAttribute>
  <AttrArray Name="KeyAttributes">
    <Item Value="Vo2Id"/>
  </AttrArray>
  <ResourceBundle>
    <PropertiesBundle
      PropertiesFile="model.ModelBundle"/>
  </ResourceBundle>
</ViewObject>


and created a link that joins the two on VO1_ID.

Finally, I created a display criteria in ViewObj1:

<ViewCriteria
    Name="ViewObj1Criteria"
    ViewObjectName="model.views.ViewObj1"
    Conjunction="AND">
    <Properties>
      <CustomProperties>
        <Property
          Name="displayOperators"
          Value="InAdvancedMode"/>
        <Property
          Name="autoExecute"
          Value="false"/>
        <Property
          Name="allowConjunctionOverride"
          Value="true"/>
        <Property
          Name="showInList"
          Value="true"/>
        <Property
          Name="mode"
          Value="Basic"/>
      </CustomProperties>
    </Properties>
    <ViewCriteriaRow
      Name="ViewObj1Criteria_row_0"
      UpperColumns="1">
      <ViewCriteriaItem
        Name="ViewObj1Criteria_ViewObj1Criteria_row_0_Title"
        ViewAttribute="Title"
        Operator="STARTSWITH"
        Conjunction="AND"
        Value=""
        Required="Optional"/>
      <ViewCriteriaItem
        Name="ViewObj1Criteria_ViewObj1Criteria_row_0_ViewObj2"
        ViewAttribute="ViewObj2"
        Operator="EXISTS"
        Conjunction="AND"
        IsNestedCriteria="true"
        Required="Optional">
        <ViewCriteria
          Name="ViewObj2NestedCriteria"
          ViewObjectName="model.views.ViewObj2"
          Conjunction="AND">
          <ViewCriteriaRow
            Name="ViewObj2NestedCriteria_row_0"
            UpperColumns="1">
            <ViewCriteriaItem
              Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Vo1Id"
              ViewAttribute="Vo1Id"
              Operator="="
              Conjunction="AND"
              Value=""
              Required="Optional"/>
            <ViewCriteriaItem
              Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Title"
              ViewAttribute="Title"
              Operator="STARTSWITH"
              Conjunction="AND"
              Value=""
              Required="Optional"/>
          </ViewCriteriaRow>
        </ViewCriteria>
      </ViewCriteriaItem>
    </ViewCriteriaRow>
  </ViewCriteria>


At run time, when searching on an attribute in the nested criteria (ViewObj2), I get: ORA-00904: "QRSLTSQ1." "' VO1_ID ': invalid identifier.

The query that is executed is:

SELECT *
FROM
  (SELECT 1 VO1_ID,
    'ViewObj1' TITLE
  FROM DUAL
  ) QRSLT
WHERE ( ( (EXISTS
  (SELECT *
  FROM
    (SELECT 1 VO1_id, 2 VO2_ID, 'ViewObj2' TITLE FROM DUAL
    ) QRSLTSQ2
  WHERE ( (VO1_ID      = :vc_temp_1 ) )
  AND (QRSLTSQ1.VO1_ID = QRSLTSQ2.VO1_ID)
  )) ) )


As you can see on line 13, it's with the help of QRSLTSQ1. VO1_ID when he is recommended to use QRSLT. VO1_ID.

I'm doing something wrong? If not, is there a fix or a workaround for this bug?

Thank you

Bill

It seams to be a strange behavior in the 12.1.3 sql builder. In this post VC Jdeveloper application encapsulating a user has reported something similar. He found a work around (last post of the thread) that you can try.

Anyway, if thre is a fix available for what you ha vet oask support.oracle.com (paid support contract). They are the only ones who can tell you if it's a bug, after all, and if a fix is available. If this isn't the case, you can request a.

Timo

Tags: Java

Similar Questions

  • 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

  • Base on attachments view Obj view criteria

    Hello world

    I use jdev 1.1.1.7.0

    I have a base on two EOs view obj, I want to create a view of criteria for this VO but when I want to add elements to which clause of the view criteria, I just select the attributes of the base OS then that I need to select the attributes of the secondary OS, is there any solution for this case?  I can not use either the place where the clause of the VO because there is also another view criteria existed.

    Habib

    Concerning

    Did you create attributes for the second EO VO - this should allow you to choose in the view criteria?

  • Is it possible to do under select in a view criteria

    Using JDev 11.1.1.6 I wonder if it is possible to make a under select in my criteria to display for a given view object.

    For example, I have two parent-child tables, one for research and one for the search values. The lookup_type is stored in the table of research and there is a relationship 1:M between the research and the research gathered by a code values. The display criteria on the search values view object I want to define a view of criteria that retrieves values from a type to search so my criteria should look like this.

    lookupvalues.lookups_row_id = (SELECT lookups_row_id FROM research WHERE lookups.lookup_type = 'STATUS')

    The above does not work. I am able to hardcode a value as below, but that doesn't make me a lot of good. I took the request that she produced and run it in sql plus, and he turns and returned very well but does not work when inside the ADF application. No idea if we use a sub query for criteria?

    lookupvalues.lookups_row_id = 123

    FYI - I was able to find a solution to his who must perform a join on this search view object with the object of search values and then added the attribute lookup_type the display of values search object view so I can add this attribute directly to the display criteria, but I'd really rather just make a sub query if I can.

    Thank you.

    I realize, this is an old thread, but I stumbled upon a solution to this. It seems that in order to use an SQL statement in the field of value to your criteria of view you have to go to the source of the view object and IsSqlFragment value = "true" for this element of particular display criteria. For example, if you want to use a criterion for display where the salary was higher than the average salary then your point of view criteria would look like

    <>

    Name = "salary".

    ViewAttribute = "salary".

    ' Operator =' > '.

    Concert = 'AND '.

    Required = "Optional."

    IsSqlFragment = 'true '.

    Value = "(SELECT AVG_SAL FROM EMPLOYEES (SALARY) AVG)" > "

  • ' The page you are trying to view cannot shown because it uses an invalid form or not support compression. ' This happens only in the Fire Fox browser.

    When I try to access sourcea.fr to check my account, after I get my ID and password a window opens with the message "the page you are trying to view cannot shown because it uses an invalid form or not support compression. '" This only happens in the Fire Fox browser.

    Hi BAMIRANGE,

    ·         You try to use Internet Explorer and check to see if you encounter the same problem?

    If the limited issue of Firefox then the number you posted would be better suited in the Forums of Mozilla Firefox. I would recommend posting your query using Mozilla's Firefox.

     

    Support for Mozilla Firefox

    http://support.Mozilla.org/en-us/KB

    Hope this information helps.

  • outer join in the view criteria

    Hello world

    I use jdeveloper 11.1.1.6.0

    I want to create outer join in the view criteria, so I had to substitute getCriteriaItemClause ViewObjImpl.java method

    my query is like this:

    SELECT t1. row_no, t2.type FROM table_1 t1, t2 from table_2

    WHERE t1. row_no (+) = t2. row_no

    and t1.user_Id (+) =: bindVar

    table_1 (row_no, user_Id)

    table_2 (row_no, type)

    the part " t1.user_Id (+) =: bindVar " should be put in the display criteria

    the method:

    @Override

    public String getCriteriaItemClause (ViewCriteriaItem viewCriteriaItem) {}

    String newQeury = this.getEntityDef (0) .getAliasName () + "." + viewCriteriaItem.getColumnName () + "(+) =:bindVar .

    Return newQeury;

    }

    but when I run the criteria see exception below raises:

    oracle.jbo.expr.JISyntaxError: Houston-36000: an unexpected token expression is found.

    When I remove the sign "(+)" of newQeury

    String newQeury = this.getEntityDef (0) .getAliasName () + "." + viewCriteriaItem.getColumnName () + "=:bindVar .  remove the sign "(+)" before =:bindVar

    raises the exception below

    Houston-29000: Unexpected exception caught: oracle.jbo.expr.JIEvalException, msg = Houston-25077: t1 name not found in the given object: ViewRow [[5-1-5] oracle.jbo.Key].

    Habib

    This is a duplicate of https://forums.oracle.com/thread/2577092

    Please do not post your questions several times.

    A possible solution posted to the original thread.

    Timo

  • It's as possible use IN the operation in view criteria?

    I use Jdeveloper 11 g R (11.1.2.3) & weblogic 10 G

    In my pages, I use JSF & Facelet

    Hi all

    Is there a way to implement operator in view criteria?

    My requirement is just a seelcte like this:

    Select * from EMPLOYEES where EMPLOYEE_ID IN (2339,2340)

    I want 2339,2340 as the variable to view the object then apply view criteria and link

    the list of parameters is not fixed, so I need to use IN the operation

    Thank you

    Mohsen

    Yes, you can do it. Reading decompilation binary ADF: using bind variable for SQL statements with the paragraph

    which shows how.

    Timo

  • Problem with between operator in the view criteria

    Hello

    We have a requirement. In the view criteria, we have a Timestamp attribute. We use between operator , so we have two variable bind fromDate and up to date . The search works fine if I give to plu date fromDate but if the same date for the bind variable, it does not return all records in the table .

    Any solution to overcome this peoblem?




    KR

    KR,

    So are the timestamps fromDate and up-to-date? Are they fair dates, then they will be interpreted as midnight as-des-than-present, and unless your timestamp is from midnight, it would not be between them more. You can also set - Djbo.debugoutput = console in the properties of your project to see the SQL query running in the log window.

    John

  • Control null to a variable binding in the view criteria

    Hi, greetings.

    I use Jdeveloper 11.1.2.0.

    I have a view object, LocationsView, for the locations of the database of the tenth Board.

    I want to apply a condition, ((: bind_var is null) or (: bind_var is not null and location_id =: bind_var), in this LocationsView.)

    In other words, I want to apply the condition only if the value of the bind variable is not null.

    How can I build this condition using a declarative view criteria?

    Any help and advice on this topic is greatly appreciated.

    Kind regards
    Guru K

    It should work if you set the box on her "ignore Null values" when you set criteria.

    Timo

  • Variable adjustment of binding of view criteria during the loading of the page

    Is there a way to define declarative variable bind according to which the page is loaded?

    I have a view object, a variable binding and a view criteria which makes use of this variable. I have two pages on each one I dropped my criteria to view as a table read-only ADF. I need the variable contains a value on the first page and others on the second. The values are static.

    In other words, I want the lines to filter a sense when I navigate to the first page, when I browse to the second.

    If there is no way to do so declaratively, I would like to know how to do it programmatically. I tried to add methods to the Module of the Application, but it seems that I can't use a custom method as an iterator of data control. I can only think of the use of two PagePhaseListeners to assign the value to this variable (using setNamedWhereClauseParam()), but this solution does not seem very right. Do not have two criteria seen separate.

    Hello

    Basically, you can use routers in your workflow, based on some properties of flow, you can determine what value to place, then call ExecuteWithParams as Chris mentioned previously.

    Kind regards
    Dimitris.

  • Invalid SQL syntax causes the removal of the view

    I have found that when you change a view through SQL Developer, entering the syntax invalid SQL and hit 'Cancel' causes in my opinion should be deleted. Here are the steps that present this problem for me:

    1. create, save, and close a valid database view by clicking right "views" on the Connections tab and selecting «New view...» »
    2. open the view via a right click on the view and selecting ' Edit... »
    3 change to point to a non-existent table
    4 try to save, select "OK".
    5. when presented with an error message, click OK in the dialog box "Edit Error object.
    6. click on 'Cancel' in the window "Edit View".
    7. right click on the view, and then select 'open '. The "SQL" tab is empty, even though you can see the value in the "Columns" tab
    8. after refreshing, the view is a party.

    I looked under the problems known and searched the forum to see if it had been reported. Please let know us if there is some setting I can change to avoid this problem. I hope it's a bug, because I can't imagine the changes not saved, causing the removal of the view would be the desired behavior. Please find below my contact information of the environment.

    -Matt

    Details of the environment
    ==============

    The version of SQL Developer: 3.0.04 build HAND - 04.34
    DB version:
    Oracle Database 10g Release 10.2.0.4.0 - Production
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE 10.2.0.4.0 Production."
    AMT for Linux: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Java version:
    Java version "1.6.0_16.
    Java (TM) SE Runtime Environment (build 1.6.0_16 - b01)
    The Client Java VM (build 14, 2 - b01, mixed mode, sharing)
    OS: Windows XP Pro SP2

    Yes.
    Changed to Bug 12334150: EDIT DELETED THE VIEW DIALOG box ON entering a not VALID AND the CANCELLATION of THE DIA SYNTAX

    -Rambeau

  • to DECLARE * ERROR at line 1: ORA-00900: invalid SQL statement

    This works fine when I use the System user to create a schema and then run this script.
    When I create another user with grant connect, resources, create view permissions I get this error:

    DECLARE
    *

    ERROR on line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at...


    DECLARE
    ID MY_TABLE.ID%TYPE;
    tNom my_table. % TABLENAME TYPE;
    PName MY_TABLE_TWO. PROPERTYNAME % TYPE;
    CURSOR c1 IS
    SELECT distinct evt.id, evt. TABLENAME, vid.propertyname
    FROM my_table evt, vid MY_TABLE_TWO
    WHERE the evt. COL_1 = 1
    AND evt. COL_2 = vid. COL_2
    and not exists (select facts FROM MY_TABLE_THREE 1)
    where evt.id = facts.eventid and facts.displayname = vid.propertyname);
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO id, tNom, pname;
    OUTPUT WHEN c1% NOTFOUND;
    INSERT INTO MY_TABLE_THREE (ID, COLUMNLENGTH)
    VALUES (S_ANALYTICS_SEQUENCE.nextval, 255);
    RUN IMMEDIATELY 'ALTER TABLE ' | tNom | 'Add ' | PName | ' _ NVARCHAR2 (255);
    END LOOP;
    CLOSE c1;
    END;

    Hello

    Maybe missing a privilege. If I were you, I'll try this first:

    DECLARE
       id    MY_TABLE.ID%TYPE;
       tname MY_TABLE.TABLENAME%TYPE;
       pname MY_TABLE_TWO.PROPERTYNAME%TYPE;
       CURSOR c1 IS
          SELECT DISTINCT evt.id,
                          evt.TABLENAME,
                          vid.propertyname
            FROM MY_TABLE     evt,
                 MY_TABLE_TWO vid
           WHERE evt.COL_1 = 1
             AND evt.COL_2 = vid.COL_2
             AND NOT EXISTS (SELECT 1
                    FROM MY_TABLE_THREE facts
                   WHERE evt.id = facts.eventid
                     AND facts.displayname = vid.propertyname);
    BEGIN
       OPEN c1;
       LOOP
          FETCH c1
             INTO id, tname, pname;
          EXIT WHEN c1%NOTFOUND;
          INSERT INTO MY_TABLE_THREE
             (ID,
              COLUMNLENGTH)
          VALUES
             (S_ANALYTICS_SEQUENCE.NEXTVAL,
              255);
          DBMS_OUTPUT.put_line('ALTER TABLE ' || tname || ' add ' || pname ||
                               '_ NVARCHAR2(255)');
          --EXECUTE IMMEDIATE 'ALTER TABLE ' || tname || ' add ' || pname || '_ NVARCHAR2(255)';
       END LOOP;
       CLOSE c1;
    EXCEPTION
       WHEN OTHERS THEN
          DBMS_OUTPUT.put_line(SQLERRM);
    END;
    /
    

    Using this approach, you can see the sentences to run without run, I also added an exception block.

    Kind regards

  • I'm getting "ORA-00900: invalid SQL statement" error. ?

    I installed oracle 11 GR 2. and 'DBMS_METADATA_DIFF.COMPARE_ALTER ('TABLE', 'TBL_A', 'TBL_A','USER1 ','USER2 ')"to see the result as below, but I'm" ORA-00900: invalid SQL statement "error.   Any idea?



    I use:


    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    PL/SQL Release 11.2.0.1.0 - Production

    CORE 11.2.0.1.0 Production

    AMT for 32-bit Windows: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production




    SQL > desc user1.tbl_a
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    FIELD_A1 NOT NULL NUMBER
    FIELD_A2 VARCHAR2 (20)
    FIELD_A4 NOT NULL NUMBER (5.2)
    FIELD_A5 VARCHAR2 (10)
    FIELD_A6 NOT NULL NUMBER (2)

    SQL > desc user2.tbl_a
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    FIELD_A1 NOT NULL NUMBER
    FIELD_A2 VARCHAR2 (50)
    FIELD_A3                                           DATE
    FIELD_A4 NUMBER (5.2)
    FIELD_A5 NOT NULL VARCHAR2 (10)




    SQL > select dbms_metadata_diff.compare_alter ('TABLE', 'TBL_A', 'TBL_A', 'USER1', 'USER2') of double

    expected result:

    DBMS_METADATA_DIFF.COMPARE_ALTER ('TABLE', 'TBL_A', 'TBL_A', 'U1', 'U2')
    --------------------------------------------------------------------------------
    ALTER TABLE 'U1 '. "" ADD TBL_A "(DATE OF THE"FIELD_A3")
    ALTER TABLE 'U1 '. "" TBL_A "DROP ("FIELD_A6")
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ("FIELD_A2' VARCHAR2 (50))
    ALTER TABLE 'U1 '. "" TBL_A ' CHANGE ("FIELD_A4" NUMBER (5.2) DEFAULT 0)
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ('FIELD_A4' NULL)
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ('FIELD_A5' ACTIVATE NOT NULL)

    Thanks for the reply rp,

    I got the result using "select dbms_metadata_diff.compare_alter ('TABLE', 'TBL_A', 'TBL_A', 'USER1', 'USER2') from dual"

  • error SQL ORA-00900: invalid SQL statement

    Hi all

    I'm new to sql and I'm trying to solve this problem, I have here.

    When I run this query (1) I get this message: ORA-00900: invalid SQL statement

    Query: 1


    WITH t1
    AS (SELECT CID,
    TYPE,
    TO_CHAR)
    TO_DATE (' 00:00:00 ', 'HH24:MI:SS')
    + (lg_end_time - lg_start_time).
    Call_time 'HH24:MI:SS'),
    ROW_NUMBER)
    COURSES (SORTING CID CID NULLS FIRST PARTITION)
    AS call_id1
    OF test_1
    )
    SELECT SUM (call_time)
    FROM t1;
    output:
    I get the error: ORA-01722: invalid number




    table structure:

    Select * form test_1;

    CID TYPE LG_END_TIME LG_START_TIME
    1508643 expedition 2012/12/03 14:05 2012/12/03 14:02
    1508643 treatment 2012/12/03 14:00 03/12/2012 14:00
    1508643 initiation 2012/12/03 14:00 03/12/2012 14:00
    1508662 expedition 2012/12/03 14:18 2012/12/03 14:16
    1508662 initiation 2012/12/03 14:01 03/12/2012 14:01
    1508662 treatment 2012/12/03 14:02 03/12/2012 14:01
    1508643 expedition 2012/12/03 14:02 03/12/2012 14:00
    1508662 expedition 2012/12/03 14:16 2012/12/03 14:02

    Thanks for your help

    I think this example might help.

    SQL> select decode(call_id1,99,null,cid)        cid,
      2         decode(call_id1,99,null,type)       type,
      3         decode(call_id1,99,null,to_char(call_time,'hh24:mi:ss'))  call_time,
      4         decode(call_id1,99,null,substr(call_id1,1,5))   call_id1,
      5         total_time
      6    from (select cid,
      7                 type,
      8                 call_time,
      9                 call_id1,
     10                 total_time
     11            from (select cid,
     12                         type,
     13                         call_time,
     14                         call_id1,
     15                         null total_time
     16                    from (SELECT CID ,
     17                                 TYPE,
     18                                 to_date(TO_CHAR (TO_DATE ('00:00:00', 'HH24:MI:SS') +
     19                                        (lg_end_time - lg_start_time),'HH24:MI:SS'),'HH24:MI:SS') call_time,
     20                                 ROW_NUMBER () OVER (PARTITION BY CID ORDER BY CID NULLS FIRST) AS call_id1
     21                            FROM test_1 ) t1
     22                  union all
     23                  select cid,
     24                         null type,
     25                         null call_time,
     26                         99   call_id1,
     27                         lpad(hours,2,'0')||':'||lpad(minutes,2,'0')||':'||lpad(seconds,2,'0') total_time
     28                    from (select cid,
     29                                 sum(to_number(to_char(call_time,'hh24'))) +
     30                                     trunc((sum(to_number(to_char(call_time,'mi'))) +
     31                                     (trunc(sum(to_number(to_char(call_time,'ss')))/60)))/24) hours,
     32                                 sum(to_number(to_char(call_time,'mi'))) +
     33                                    (trunc(sum(to_number(to_char(call_time,'ss')))/60)) minutes,
     34                                 (sum(to_number(to_char(call_time,'ss'))) -
     35                                     ((trunc(sum(to_number(to_char(call_time,'ss')))/60)) * 60)) seconds
     36                            from (SELECT CID ,
     37                                         TYPE,
     38                                         to_date(TO_CHAR (TO_DATE ('00:00:00', 'HH24:MI:SS') +
     39                                                (lg_end_time - lg_start_time),'HH24:MI:SS'),'HH24:MI:SS') call_time,
     40                                         ROW_NUMBER () OVER (PARTITION BY CID ORDER BY CID NULLS FIRST) AS call_id1
     41                                    FROM test_1 ) t1
     42                          group by cid) )
     43          order by cid, call_id1 );
    
    CID                                      TYPE                 CALL_TIME CALL_ID1 TOTAL_TIME
    ---------------------------------------- -------------------- --------- -------- ----------
    1508643                                  Dispatching          00:02:06  1
    1508643                                  Initiation           00:00:00  2
    1508643                                  Treatment            00:00:39  3
    1508643                                  Dispatching          00:02:50  4
                                                                                     00:05:35
    1508662                                  Treatment            00:01:03  1
    1508662                                  Initiation           00:00:00  2
    1508662                                  Dispatching          00:13:17  3
    1508662                                  Dispatching          00:02:43  4
                                                                                     00:17:03
    
    10 rows selected
    
    SQL> 
    
  • 00900 invalid SQL statement error

    I am myself to write stored procedures, teacher in TOAD 10.5 with Oracle 10 g. I get the error ORA-00900: invalid SQL statement. Here's the code, cut to the minimum sample size strip. I don't see where I'm doing something wrong.

    If I cut out the slider (take it down to just "Begin" and "End"), it runs, but I don't see anything wrong with the cursor.

    Any ideas?

    CREATE OR REPLACE PROCEDURE IN_PROCESS_CASES_BOS
    IS
    V_HELLO VARCHAR2 (10);

    CURSOR C_MAIN IS
    SELECT 'HELLO' FROM DUAL;

    BEGIN

    C_MAIN OPEN;

    LOOP
    EXTRACT THE C_MAIN IN V_HELLO;

    WHEN THE OUTPUT C_MAIN % NOTFOUND;

    END LOOP;

    CLOSE C_MAIN;
    END;
    END IN_PROCESS_CASES_BOS;
    /
    select * from user_errors;
    
    NAME                           TYPE           SEQUENCE       LINE   POSITION
    ------------------------------ ------------ ---------- ---------- ----------
    TEXT
    --------------------------------------------------------------------------------
    ATTRIBUTE MESSAGE_NUMBER
    --------- --------------
    IN_PROCESS_CASES_BOS           PROCEDURE             1         21          1
    PLS-00103: Encountered the symbol "END"
    ERROR                103
    

    You have an extra END; Remove it and the procedure compiles and runs.

Maybe you are looking for

  • How to enable java for my android mobile.

    I get an error "enable java for your browser. How to do that as I am unable to see the tab preferences anywhere.

  • How to use the data recovery disk

    I create data recovery in my hp envy m6 through portable dvd burner, but after the creation of recovery now when I try to install image recovery his does not work what do I do now?

  • Display Vista of horizontal to vertical change

    Quite embarrassed but my puppy walked acrossed my keyboard and somehow changed my display configuration in Windows Vista from horizontal to vertical.  I don't see a function key that will allow me to change it.  I'm sure it's easy but can't seem to f

  • Crop in InDesign CC markers

    Hi allI am based in Tokyo, and most of the printers here ask delivered work by using benchmarks of crop shown to the right:Unfortunately, the English version of InDesign offers only the marks of cropping on the left.I understand that in older version

  • Loss of quality of image while reducing size

    HelloIM new to adobe illustrator, im starting an online store for custom product photo and I want to use adobe illustrator to make it ready made models so simply place clients photos insideMy problem is that I have a card of 10 x 15 model and when I