Querying the Schema Definition

Hi All,
I have registered XML Schema using registerSchema() API using BFILE(). I want to see the schema definition which
is registered with the XML DB. How to query it using XML DB APIs.
Regards
Ramesh

Yes, I loaded the schema. Yes I can query from USER_XML_SCHEMAS.
Slight issue, the schema is decorated with lots of Oracle extras (oraxdb: attributes). Is that a problem for you?
Original schema:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Address">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Recipient" type="xs:string" />
        <xs:element name="House" type="xs:string" />
        <xs:element name="Street" type="xs:string" />
        <xs:element name="Town" type="xs:string" />
        <xs:element name="County" type="xs:string" minOccurs="0" />
        <xs:element name="PostCode" type="xs:string" />
        <xs:element name="Country">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="FR" />
              <xs:enumeration value="DE" />
              <xs:enumeration value="ES" />
              <xs:enumeration value="UK" />
              <xs:enumeration value="US" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>As queried from USER_XML_SCHEMAS, with oraxdb additions:
<?xml version="1.0" encoding="WINDOWS-1252"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oraxdb="http://xmlns.oracle.com/xdb" oraxdb:flags="289" oraxdb:schemaURL="http://lc.peferisco.com/address.xsd" oraxdb:schemaOwner="TESTUSER" oraxdb:numProps="8">
  <xs:element name="Address" oraxdb:propNumber="2447" oraxdb:global="true" oraxdb:SQLType="CLOB" oraxdb:SQLName="Address" oraxdb:memType="258">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Recipient" type="xs:string" oraxdb:propNumber="2440" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="House" type="xs:string" oraxdb:propNumber="2441" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="Street" type="xs:string" oraxdb:propNumber="2442" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="Town" type="xs:string" oraxdb:propNumber="2443" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="County" type="xs:string" minOccurs="0" oraxdb:propNumber="2444" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="PostCode" type="xs:string" oraxdb:propNumber="2445" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        <xs:element name="Country" oraxdb:propNumber="2446" oraxdb:global="false" oraxdb:memType="259" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="FR"/>
              <xs:enumeration value="DE"/>
              <xs:enumeration value="ES"/>
              <xs:enumeration value="UK"/>
              <xs:enumeration value="US"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>I guess you can write an Xquery extract that would get rid of these extras... Let me know if you need help doing that...
HTH
Regards Nigel

Similar Messages

  • How to query the "Schema" in the Reporting Schema?

    I need to be able to report on a specific set of tables with my model.
    I have elected to group them under one Schema.
    I was thinking I could write a custom report via the Reporting Schema and select the tables based on the schema they are associated with.
    However, I dont see the table within the SQLDeveoper Model Reporting Schema that containes the mapping of tables to a schema.
    Is this missing from the export?
    If yes, what would be a better way of doing this type of grouping?
    Thanks
    Mark

    Hi Mark,
    Schema is not exported to reporting repository.
    You can use Classifications types to group tables, entities etc. And you can create your own classification types. There is field classification_type_ovid in dmrs_tables table which can be used as filter.
    Another way of grouping is using Sub Views. In that case these are the queries:
    --This returns all main views + sub views, exported to DB, filter in Where clause for specific design could be applied
    SELECT CASE
    WHEN d.diagram_type = 'MainView' THEN d.model_name
    ELSE ''
    END as "Model Name",
    d.model_ovid as "Model OVID",
    CASE
    WHEN d.diagram_type = 'Subview' THEN d.diagram_name
    ELSE ''
    END as "Sub View",
    d.ovid as "OVID"
    FROM dmrs_vdiagrams d,
    dmrs_models m
    WHERE d.model_ovid = m.model_ovid
    --AND    d.design_ovid = column design_ovid from DMRS_DESIGNS table
    --AND    m.model_type = 'Relational' (or 'Logical')
    ORDER BY d.model_name,d.diagram_type, d.diagram_name
    - This return all all tables withing specific sub view
    SELECT t.table_name as "Table Name",
    t.ovid as "OVID"
    FROM dmrs_tables t,
    dmrs_diagram_elements de,
    dmrs_vdiagrams d
    WHERE de.ovid = t.ovid
    AND de.diagram_ovid = d.ovid
    AND d.ovid = -> this is subview ovid from above query
    Regards

  • Querying the schema for table name with column value!

    In my schema i have 500+ tables and other objects.
    i have a column with the name BO_PRODUCT_CODE.
    I wants to know in what tables the value of BO_PRODUCT_CODE='FX03'.
    i have query the user_tab_columns which gives me the result with 90 tables having the column BO_PRODUCT_CODE.
    What is query which will give me the exact number/name of the table whose column value is FX03. ie, BO_PRODUCT_CODE='FX03'.

    Hi you can use this approach:
    BEGIN
    v_str VARCHAR2(250);
    v_count NUMBER :=0;
    DECLARE
    FOR loop_tbl IN ( SELECT DISTINCT table_name FROM USER_TAB_COLUMNS
    WHERE column_name ='BO_PRODUCT_CODE' )
    LOOP
    v_str := 'SELECT COUNT(*) FROM ' || loop_tbl.table_name || ' WHERE BO_PRODUCT_CODE=||'''' ||'FX03' || '''' '
    EXECUTE IMMEDIATE v_str INTO v_count ;
    IF v_count > 0 THEN
    DBMS_OUTPUT.PUT_LINE ('Table Name :'|| loop_tbl.table_name || ' Count :'||v_count);
    END IF;
    v_count :=0;
    END LOOP;
    EXCEPTION
    WHEN others THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;
    Please remove if any syntax error.
    Regards

  • IDOC field schema definition cannot be loaded in the configuration

    hi experts,
    i'm having an issue in the configuration side of the xi server. when i'm trying to access a particular field in an IDOC in the condition editor it is givin me the message the 'schema definition of the corresponding field's parent segment is missing'. But in the design side when i'm using the idoc i'm able to access every field in the mapping as well as wen i'm openin it . i've taken care that i'm using the IDOC of the same software component as in design.
    Any suggestions given will be highly useful.
    thanks in advance,
    regards,
    Rahul

    Hi Rahul,
    Firstly check out this blog by Shabarish, which discusses how you can give the condition in the editor using XPath expression. It also mentions the importance of specifying the correct parent node:-
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    Also, you must've imported the Idoc or an abstract type of the IDoc as the sender interface right?
    Only then you will be able to see it in the condition editor rite?
    Well if its the IDoc itself, just check if you have chosen the right IDoc while defining the rcvr determintation.
    If it is the abstract message interface of the IDoc, then check if you have added the correct IDoc to the message interface in repository and also if you have chosen the correct message interface while configuring the rcvr determination.
    If the above checks are all fine, also do a cache
    Regards,
    Sushumna

  • Bpelc issues with WSDL schema definition

    Hi,
    I have been attempting to deploy a relative simple BPEL example, developed using the BPEL Designer Eclipse plugin and deployed on BPEL Process Manager.
    The BPEL consists of receiving a SOAP message, copying variables using assign from the input message to a message defined in an external WSDL, invoking that WSDL's service and copying the results of that service into the output message.
    To design the external service, I developed a simple Java class in Apache Axis and used the Java2WSDL tool to create all the interfaces. I then copied that WSDL to the BPEL designer and started to design the BPEL.
    The problem is to do with the definition of messages within the WSDL, the following snippet is from the WSDL generated in Apache Axis:
    <wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://mdsuk.com/wsdl/example/PSP1">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="OutputCT">
    <sequence>
    <element name="message" nillable="true" type="xsd:string"/>
    <element name="paymentReference" nillable="true" type="xsd:string"/>
    <element name="success" nillable="true" type="xsd:boolean"/>
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    I then tried to create the <assign> statement for the External Service Message -> BPEL Output Message using BPEL Designer using the visual editor, it generated the following code:
    <assign name="assign-2">
    <copy>
         <from variable="pspOutput" part="outputCT" query="/message"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:result"/>
    </copy>
    <copy>
         <from variable="pspOutput" part="outputCT" query="/success"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:success"/>
    </copy>
    </assign>
    Trying to compile this generated code resulted in:
    [bpelc] [Error ORABPEL-10057]: invalid query
    [bpelc] [Description]: in line 94 of "D:\EclipseWorkspace\OrderTest\OrderTest.bpel", query "/message" is invalid, because step 'message' is not valid..
    [bpelc] [Potential fix]: Check the XML schema and make sure your query string is valid.
    [bpelc]
    [bpelc] [Error ORABPEL-10057]: invalid query
    [bpelc] [Description]: in line 98 of "D:\EclipseWorkspace\OrderTest\OrderTest.bpel", query "/success" is invalid, because step 'success' is not valid..
    [bpelc] [Potential fix]: Check the XML schema and make sure your query string is valid.
    So, the generated code from BPEL Designer was failing to compile. This resulted in a long check of the code, finally I realised that it expected the inputCT variable to be present in the XPath, so I manually changed the code to
    <assign name="assign-2">
    <copy>
         <from variable="pspOutput" part="outputCT" query="/outputCT/message"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:result"/>
    </copy>
    <copy>
         <from variable="pspOutput" part="outputCT" query="/outputCT/success"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:success"/>
    </copy>
    </assign>
    This allowed to code to compile, so I deployed the BPEL to the Process Manager, and invoked a query using the Web Interface.
    The BPEL started up fine, it invoked my external Axis Web Service, Axis produced the output (visible via debugging) however Process Manager tried to process the output, it crashed with the following exception:
    06/01/19 16:29:11 com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {null}
    parts: {{summary=<summary>empty variable/expression result.
    xpath variable/expression expression "/outputCT/message" is empty at line 94, when attempting reading/copying it.
    Please make sure the variable/expression result "/outputCT/message" is not empty.
    </summary>}}
    So, the compiled BPEL code, which had the WSDL schema to compare against was failing during execution, I inspected the output from the Axis Web Service, which was:
    <?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <processPaymentResponse xmlns="http://mdsuk.com/wsdl/example/PSP1">
    <outputCT xmlns="">
    <ns1:message xmlns:ns1="http://mdsuk.com/wsdl/example/PSP1">Payment Succesful</ns1:message>
    <ns2:paymentReference xmlns:ns2="http://mdsuk.com/wsdl/example/PSP1">1137688175137</ns2:paymentReference>
    <ns3:success xmlns:ns3="http://mdsuk.com/wsdl/example/PSP1">true</ns3:success>
    </outputCT>
    </processPaymentResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    The key difference was that the message / paymentReference and success attributes were prefixed with the namespace "http://mdsuk.com/wsdl/example/PSP1" , this makes sense as the schema has the attribute targetNamespace="http://mdsuk.com/wsdl/example/PSP1".
    However, when I tried to modify the BPEL to read:
    <assign name="assign-2">
    <copy>
         <from variable="pspOutput" part="outputCT" query="/outputCT/nsxml1:message"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:result"/>
    </copy>
    <copy>
         <from variable="pspOutput" part="outputCT" query="/outputCT/nsxml1:success"></from>
         <to variable="output" part="payload" query="/tns:OrderTestResponse/tns:success"/>
    </copy>
    </assign>
    It complained:
    [bpelc] [Error ORABPEL-10057]: invalid query
    [bpelc] [Description]: in line 94 of "D:\EclipseWorkspace\OrderTest\OrderTest.bpel", query "/outputCT/nsxml1:message" is invalid, because step 'nsxml1:message' is not valid..
    [bpelc] [Potential fix]: Check the XML schema and make sure your query string is valid.
    [bpelc]
    [bpelc] [Error ORABPEL-10057]: invalid query
    [bpelc] [Description]: in line 98 of "D:\EclipseWorkspace\OrderTest\OrderTest.bpel", query "/outputCT/nsxml1:sucess" is invalid, because step 'nsxml1:sucess' is not valid..
    [bpelc] [Potential fix]: Check the XML schema and make sure your query string is valid.
    [bpelc] .
    So, the BPEL would not validate against the WSDL schema that was being produced, I read up on the W3 Schema specification, and found that the schema can take the attribute elementFormDefault - this attribute takes the values 'qualified' or 'unqualified'. If qualified, then it explicitly states that all children elements should be beloning to the namespace of this element.
    So, I changed the schema to read:
    <wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://mdsuk.com/wsdl/example/PSP1"
         elementFormDefault="qualified">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="OutputCT">
    <sequence>
    <element name="message" nillable="true" type="xsd:string"/>
    <element name="paymentReference" nillable="true" type="xsd:string"/>
    <element name="success" nillable="true" type="xsd:boolean"/>
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    The BPEL compiled and ran succesfully.
    However, the problem/issue here is, Oracle bpelc assumed that if the elementFormDefault attribute was missing from the schema definition, it defaulted to unqualified, even with the targetNamespace attribute present.
    Axis and <oXygen/> XML Editors, in which I tested the WSDL code, assumed that if the elementFormDefault attribute was missing, it defaulted to qualified.
    I cannot find anything in the Schema Specification to say which is correct - can anyone shed any light on this? I also want to make Oracle BPEL users aware of this issue.
    Regards,
    Peter Dolukhanov

    I resolved this issue by adding the following to the 2nd schema in the wsdl
    xmlns:xsdLocal1="urn:/crmondemand/xml/integrationevent"
    inside the 2nd schema
    <xsd:schema
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns:xsdLocal1="urn:/crmondemand/xml/integrationevent"
    targetNamespace="urn:crmondemand/ws/integrationevent/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    and this line immediately below it
    <xsd:import namespace="urn:/crmondemand/xml/integrationevent" />
    I could then create a proxy class using wsdl.exe

  • Views - SELECT from VIEW and SELECT from the query inside view definition returning different results

    Hi,
    I am facing this weird issue. Any help would be appriciated.
    I have view with the following definition:
    CREATE VIEW [marketing].[OpenedMails]
    AS
    SELECT
    ID_EmailAddress, 
    ID_Date_Opened, 
    ID_Contact, 
    ID_MailSendJobs,
    COUNT(ID_OpenedMails) AS OpenCount,
    CASE
    WHEN ROW_NUMBER() OVER (PARTITION BY CAST(ID_EmailAddress AS VARCHAR(10)) + ' ' + CAST(ID_MailSendJobs AS VARCHAR(10)) ORDER BY ID_Date_Opened) = 1 THEN 1 
    ELSE 0 
    END
    AS UniqueOpenCount
    FROM            
    dbo.Fact_OpenedMails
    where ID_Contact = 382340
    GROUP BY ID_EmailAddress, ID_Date_Opened, ID_Contact, ID_MailSendJobs;
    order by ID_MailSendJobs 
    When I run the the select statement in the view definition I get combination of both 1 and 0 for the 'UniqueOpenCount' column.
    But when I run the select from the view itself using the following query:
    SELECT [ID_EmailAddress]
          ,[ID_Date_Opened]
          ,[ID_Contact]
          ,[ID_MailSendJobs]
          ,[OpenCount]
          ,[UniqueOpenCount]
      FROM [marketing].[OpenedMails]
    I get equal amount of rows but only 0 values for the 'UniqueOpenCount' column which seems to be very weird to me. Why is this happening ? Can anyone help regarding how to solve this ??
    Result from the select inside view definition:
    Result from the select query directly from the view:
    Thanks in advance.
    Vivek Kamath

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You failed. Temporal
    data should use ISO-8601 formats – you failed again. Code should be in Standard SQL AS much AS possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    Things like “ID_Date_Opened” are wrong. The affixes “id” and “date” are called attribute properties in ISO-11179 and data modeling. Since a date is a unit of measurement on a temporal scale, it cannot be an identifier by definition. My guess is this would be
    “open_date” if it were done right. And the only display format in ANSI/ISO Standard SQL is ISO-8601 (yyyy-mm-dd)
    An email address of -1?? Email addresses are VARCHAR(256), not numeric. There is no reason to cast them AS string!
    Your vague “mail_send_jobs” is plural, but columns hold scalars and cannot be plural by definition. The partition cause can hold a list of columns: 
    WHEN ROW_NUMBER() 
         OVER (PARTITION BY email_address, mail_send_job 
                   ORDER BY open_date)
         = 1 
    THEN 1 ELSE 0 END 
    This still makes no sense, but the syntax is better. You do not understand how ROW_NUMBER() works. 
    Would you like to try again with proper Netiquette? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • JPA: how to organize multiple databases having the same schema definition?

    Hi there,
    I'm new to Java EE but I could finish some test projects on GlassFish 3 / Java EE 6 platform.
    Now it's time to build the actual system and I need some help in that.
    So, I can't really tell you the exact purpose of this system but let's look at the following example which is very close to what I need.
    Say there is a database schema definition (DDL) for Oracle 11g and this schema is storing the inventory of a shop. So tables like product, category, price etc
    Say there are 50 shops, and I'm getting a new database for each shop every month holding their inventory.
    So every month I'm receiving a SQL file with INSERTs (DML) for every shop for the DDL I mentioned above.
    I'm getting 50 SQL files for the 50 shops every month, so in a year you're talking about 600 SQL files to import.
    If it was php/MySQL I could import them into a separate database each, call it shop1_May11, shop2_May11 etc reflecting the shop name and the month in the database name.
    This is my question how you guys think I should achieve this in Jave EE / Oracle.
    As the DDL is the same I thought to create an Entity for each table and use the Java Persistance API to create the databases and then I'd import the month/shop specific SQL files.
    But this means I'm gonna create 50 new schemas in Oracle every month?
    Or what's the best way to achieve this?
    Thanks in advance
    Edited by: 833519 on May 18, 2011 5:28 AM
    Edited by: 833519 on May 18, 2011 5:29 AM
    Edited by: 833519 on May 18, 2011 5:31 AM

    JPA helps a lot in persisting and retrieving data that has relationships without having to worry about the relationships at a sQL level.
    So you get a java programmer that builds relationships using Java classes (the entities) and a persistence provider worries about the sql required to materialize those relationships.
    You seem to be using SQL inserts for persisting the data and you want to generate the reports from SQL as well.
    You can use it but you won't be gaining much of its advantages for this project.
    Consider reporting applications like the jasperserver for the reports.
    Also, I have seen people get away with using one database for this type of thing and just adding a clientid (and optionally branchid) to each table.

  • Problems with putting the Schema on the query!!!! Need Help.

    Hi guys!
    I have a problem and a doubt about putting schema name on my query. I want to know if is neccesery specify the schema name on the query I want to execute. All my queries are on my application, I connect from the begging to my oracle data base with a user and password, this user is only alow for that schema. So my question is if I can ommit the schema name on the query.
    Explample
    Select * From Table
    Select * from Student
    Select * from Schema.Table
    Select * from Institution.Student
    Thanks, and I hope you can help me,
    Yuni.

    YOU WROTE "I have a problem and a doubt about putting schema name on my query. I want to know if is neccesery specify the schema name on the query I want to execute. All my queries are on my application, I connect from the begging to my oracle data base with a user and password, this user is only alow for that schema. So my question is if I can ommit the schema name on the query."
    don't use words that you don't know!
    also, your example (in the first post) gave the schema.table as INSTITUTION.STUDENT
    so these are all words that you started with.
    now, PAY ATTENTION and RUN THE EXAMPLE SQLS I GAVE
    connect to the database as INSTITUTION (user, schema, I don't care which).
    execute the sql statement "select * from student".
    did it do anything? did it return data, did it say "no rows", or did it have an error? my magic 8 ball and x-ray glasses are broken and I can't see you monitor (my old computer only has that one way window). if it works, then you clearly do not need to put be "putting the Schema on the query!!!!". if it didn't work, then TELL US EXACTLY WHAT HAPPENED (copy AND paste).
    and where are my cigars ;-)
    MERGE AGAIN????? PLZ Somebody HELP ME!!!!!

  • Same the same query against all the schemas

    Hi all,I am a newbie to databases
    I have a requirement where in in need to run the same query against all the schema s in the database.what would be the best way to do it.other than logging into each user and running query.Its a complex query I can't do a direct select  from sys or other even for I will have to change a lot of things.Is there a easier way to do it ??
    Thanks in advance

    990051 wrote:
    Hi all,I am a newbie to databases
    I have a requirement where in in need to run the same query against all the schema s in the database.what would be the best way to do it.other than logging into each user and running query.Its a complex query I can't do a direct select  from sys or other even for I will have to change a lot of things.Is there a easier way to do it ??
    Thanks in advance
    you have a choice between logging into each user & running the SQL or you can log into each user & run the SQL.

  • Query to find the string in the schema for different tables

    Hi all,
    Is the output possible :
    1) Schema with N number of tables where N>100
    2) You have string Say 'abc' and u dont know which column of the 100 tables of the schema this string falls.
    3)you want to retrieve the table name, column name and expected string
    Output:
    Table name column name expected string
    A a_id “abc”
    D d_add “abc”

    You could probably adapt this solution that michaels provided ages ago (and which you'd have found if you bothered to search)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"

  • How to create the XSD(XML Schema Definition) ?

    Dear All,
         How to create an XSD for the following XML defined ?
    <?xml version="1.0" encoding="utf-8"?>
    <formulations name="Formulations">
        <formulation name="Formulation-1" type="formulation">
            <intermediateFormulation name="IntermediateFormulation-1" type="intermediate">
                <grade name="Grade-1" type="grade">
                    <rawMaterial name="Raw Material-1" type="raw" />
                </grade>
            </intermediateFormulation>
            <grade name="Grade-1" type="grade">
                <rawMaterial name="Raw Material-1" type="raw" />
            </grade>
        </formulation>
    </formulations>
    Thank You,
    Supreet R

    Hi Sivaram,
    Unfortunately, the 8.1 IDE did not have special tooling for schema generation.
    You will need to create it by hand or using an external tool
    If you are using an external tool to create the file within the schema project, you might want to disable the schema project auto build, which will be triggered every time a file save takes place
    cheers
    Raj

  • Query on schema validator

    I have a schema which defines as follows...
                   <!-- Annualization Amount for Annualization Period #3 -->
                   <xsd:element name="AnnualizationAmount3" minOccurs="0">
                        <xsd:annotation>
                             <xsd:documentation>
                                  <Description>Annualization amount for annualization period #3</Description>
                                  <LineNumber>Schedule A Line 22c</LineNumber>
                             </xsd:documentation>
                        </xsd:annotation>
                        <xsd:simpleType>
                             <xsd:restriction base="AnnualizationAmountType">
                                  <xsd:enumeration value="2"/>
                                  <xsd:enumeration value="1.71429"/>
                                  <xsd:enumeration value="1.5"/>
                                  <!-- Standard Option -->
                                  <!-- Option 1 -->
                                  <!-- Option 2 -->
                             </xsd:restriction>
                        </xsd:simpleType>
                   </xsd:element>---------------
         <xsd:simpleType name="AnnualizationAmountType">
              <xsd:annotation>
                   <xsd:documentation>A decimal amount that allows up to 6 total digits and 5 fraction digits</xsd:documentation>
              </xsd:annotation>
              <xsd:restriction base="xsd:decimal">
                   <xsd:totalDigits value="6"/>
                   <xsd:fractionDigits value="5"/>
              </xsd:restriction>
         </xsd:simpleType>---------------
    when used the following value in the .xml file the validation seems to be valid, I wanted to know
    <AnnualizationAmount3>2.</AnnualizationAmount3>
    I would like to know using Java 1.5 XML Validator would the Enumeration take not precedence over Decimal type definition....
    java code used is
                // Parse an XML document into a DOM tree.
                DocumentBuilder parser =
                    DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document document = parser.parse(new File(xmlFN));
                // Create a SchemaFactory capable of understanding WXS schemas.
                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                // Load a WXS schema, represented by a Schema instance.
                Source schemaFile = new StreamSource(new File(schemaFN));
                Schema schema = factory.newSchema(schemaFile);
                // Create a Validator object, which can be used to validate
                // an instance document.
                Validator validator = schema.newValidator();
                // Validate the DOM tree.
                validator.validate(new DOMSource(document));

    The query is resolved.
    1) Implement Notes No 1896983, 1881948 ( Both the notes need to be implemented using S notes no manual corrections need to be done
    2) Assign the product in the schema under the product assignment block
    3) Ensure that the schema consists of the application area's subject profile and transaction type catalog categories
    4) Once the Product is entered in the header level in the product or object id field the schema would get triggered automatically.
    Kind Regards
    Atul

  • IDOC invoic /INVOIC02 Schema Definition

    Please help me
    Currently, I am working on one project which require me to translate from IDOC to EDI X12. The company mainly supports all EDI messages and I have no problem to translate to X12. But what I face with is IDOC Schema definition which the company does not have SAP system to generate it. So can you guys please send me an IDOC schema definition for Invoice 810(invoic/invoic02)? If you guys know some site which allow me to download that file please send a me direct link to that web site as I really need this file in order to complete my project.
    I used to download Idoc schema definitions from the sap website http://ifr.sap.com/catalog/query.asp but this site now no longer exist.
    Thank you so much for your help hope to hear good respond from you guys soon

    Hi Rahul,
    Firstly check out this blog by Shabarish, which discusses how you can give the condition in the editor using XPath expression. It also mentions the importance of specifying the correct parent node:-
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    Also, you must've imported the Idoc or an abstract type of the IDoc as the sender interface right?
    Only then you will be able to see it in the condition editor rite?
    Well if its the IDoc itself, just check if you have chosen the right IDoc while defining the rcvr determintation.
    If it is the abstract message interface of the IDoc, then check if you have added the correct IDoc to the message interface in repository and also if you have chosen the correct message interface while configuring the rcvr determination.
    If the above checks are all fine, also do a cache
    Regards,
    Sushumna

  • How to access the text definition of sql indexes

    I am able to access the text definition of stored procedures, views, triggers and functions from sys.sql_modules. I want to get the text definition of indexes.
    Can somebody help me in getting the text definition of indexes in sql server.
    Thanks,
    Puneet

    No, Actually I am trying to compare the indexes of two database programmatically.
    I am able to compare the stored procedures, views, triggers and functions by getting text definition directly from 'sys.sql_modules',  on similar lines do we have any way from where I could get the text definition of indexes
    Not sure if there is any table which stores Index defination but there is a table "sys.indexex" which stores index details.
    You may use below query to get index information (It will list out index details but not defination)
    SELECT s.NAME 'Schema'
    ,t.NAME 'Table'
    ,i.NAME 'Index'
    ,c.NAME 'Column'
    FROM sys.tables t
    INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
    INNER JOIN sys.indexes i ON i.object_id = t.object_id
    INNER JOIN sys.index_columns ic ON ic.object_id = t.object_id
    INNER JOIN sys.columns c ON c.object_id = t.object_id
    AND ic.column_id = c.column_id
    WHERE i.index_id > 0
    AND i.type IN (
    1
    ,2
    ) -- clustered & nonclustered only
    AND i.is_primary_key = 0 -- do not include PK indexes
    AND i.is_unique_constraint = 0 -- do not include UQ
    AND i.is_disabled = 0
    AND i.is_hypothetical = 0
    AND ic.key_ordinal > 0
    ORDER BY ic.key_ordinal
    - Also there is one more SP which you can create and then execute it by specifying DB names. It will list out table columns, indexes, constraints difference in one go.
    EXEC SP_Comparedb db1,db2
    Technet Gallary: Compare two databases for objects differences
    Cheers,
    Vaibhav Chaudhari

  • Can not see the schema under the new connection -- Please help

    The database is Oracle.  Recently I requested our DBA to do a database refresh, and here was she did.
    1. Drop the user (TDEV, schema owner) in Dev.
    2. Recreate the user, TDEV, with the same password, roles and tablespaces.
    3. Using Oracle export command to export data from production under schema owner, TPROD.
    4. Using Oracle import command to import the dump file from TPROD to TDEV.
    5. Both export and import were successful.
    Dev and Production are in two different databases.
    After the importing, using SQL*PLUS I logged into Dev database as schema owner "TDEV", and were able to select all tables.  I also verified there was no schema or user called TPROD in Dev database, and there is no TDEV in Production database.
    However, in Crystal Report, both 10 and XI, when I made the new ODBC (RDO) connection to Dev DSN and logged in as the schema owner user "TDEV", I noticed there is TPROD listed below, but no TDEV.  I tried to select the tables listed underneath TPROD, and got the following error message: "Query Engine Error: '42S02:[Oracle][ODBC][Ora]ORA-00942: table or view doesn't exist'"
    Any ideas or helps are welcome!!

    Try to create a brand new DSN connecting to Dev

Maybe you are looking for

  • How to maintain original lines when converting a word file in a PDF

    Unfortunately the table lines often change when converting a word file in a PDF, e.g. dotted/broken lines into straight lines or different kinds of broken lines. How can I maintain the original lines when converting the documents? Many thanks in adva

  • Backing up pictures to external hard drive???

    When I try to "drag" my pictures to my external hard drive it wont let me (circle with slash through it). I have tried do drag from iphoto and my pictures. I read to do it through time machine but when I go to time machine it says it is going to eras

  • Hi different vendor for goods supplier and main vendor

    There are two vendors one is main vendor and second vendor is goods supplier.How to use these two vendor when ordering material. Whether we have to create two purchase orders one for the main vendor and one for the goods supplier? What is process the

  • Air travel with iMac (21")

    I will be traveling by air with my iMac and have already checked with the airline that it will fit into the overhead and that it is ok to bring onboard. However, I wonder whether I can just use the box the iMac came in (which I understand how iMacs a

  • [BPM] problem with

    Hi, I created a BPM, that split an incoming message into three parts: hardware, software and service. Then I I open a fork with three branches. Every branch is for one of the splitted parts and include a forEach-block that sends emails. After the for