Can we generate the output of SQL Query in XML format ..

Hi Team,
Can we generate an XML doc for an SQL Query.
I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
select * from emp for xml auto
The output looks like
<emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>

Just a little bit of short hand.
Get the XML out of your database, via HTTP
Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
CREATE OR REPLACE VIEW emps_and_depts AS
SELECT e.employee_id AS "EmployeeId",
e.last_name AS "Name",
e.job_id AS "Job",
e.manager_id AS "Manager",
e.hire_date AS "HireDate",
e.salary AS "Salary",
e.commission_pct AS "Commission",
XMLFOREST (
d.department_id AS "DeptNo",
d.department_name AS "DeptName",
d.location_id AS "Location"
) AS "Dept"
FROM employees e, departments d
WHERE e.department_id = d.department_id
Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
(usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
objects in our instance, we can use that to access the data as a URL.
The format for the URL call is http://<machinename>:<port>/<DBURI>
In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
view (in my case HR). You should now get an XML document displayed in your browser.
And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
Create a table or view
Open your web browser
Enter a URL
Enter a user ID and password
View your XML
If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
return results into an XML format.
And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them.

Similar Messages

  • How can we generate the reports in html or text file formats?

    Hi,
    Is there any package that can help in creating HTMLDB reports in .txt files or .html files? (Similar to TEXT_IO in Oracle Forms)
    How can we generate the reports in html or text file formats from HTMLDB?
    Thanks in Advance
    Renjith

    Hello all.
    Bi Publisher is great, but has a very high price tag. It's even more expensive than Forms & Reports Services. We are considering APEX to replace Forms & Reports on the web, but the reporting limitations are still a problem.
    I wonder if there is another option.
    Thanks

  • How to generate the output of BSP application in PDF format?

    Hi,
    I need to modify one BSP application, which generates its output in the form of PDF. I have checked all the methods in the bsp pages and its corresponding controller class's. I couldn't find any relevant method, which deals with generating the output in PDF.
    Could you please share your valuable thoughts on this?
    Again it would be helpful, If anyone of you share some knowledge on Interactive Adobe Forms.
    Thanks,
    John

    okay, awesome
    i'd use DOM or some high level API for this (don't write it by hand using plain File IO)
    okay, try this site, it goes through building a document, adding elements, writing to file, etc.
    http://www.roseindia.net/xml/dom/

  • How can I use the Rownum/Customized SQL query in a Mapping?

    Hi,
    * I need to use a Rownum for populating one of the target field? How to create a mapping with Rownum?
    * How can I use an Dual table in OWB mapping?
    * Can I write Customized SQL query in OWB? How can I achieve this in a Mapping?
    Thanks in Advance
    Kishan

    Hi Niels,
    As I'm sure you know, the conundrum is that Reports doesn't know how many total pages there will be in the report until it is all done formatting, which is too late for your needs. So, one classical solution to this problem is to run the report twice, storing the total number of pages in the database using a format trigger, and throwing away the output from the first run when you don't know the total number of pages.
    Alternatively, you could define a report layout so that the number of pages in the output is completely predictable based upon, say, the number of rows in the main query. E.g., set a limit of one, two, ... rows per page, and then you'll know how many pages there will be simply because you can count the rows in a separate query.
    Hope this helps...
    regards,
    Stewart

  • How to get the metadata (in xml format) of all the fileds in SQl query ?

    Good day ,
    I am using the dbms_xmlgen.getXMLfunction to get the result of any query in xml format.
    With this XML I also want the metadata information about all the fields used in the query (passed to getXML function). Is it possible and how can I achieve this.
    I tried to Google it but couldn't find any solution , it's easy to do it in java where I can get the resultset meta data from the resultset but I have to do it in Oracle function since I want the result in xml format and want to use the oracle XML API.
    You may think why I need metadata , the reason is the application will later use this information to sort the data contained in these fields according to their data type provided to.
    Regards
    Sajjad Ahmed Paracha

    Hi,
    Please always say which version of Oracle you're using (SELECT * FROM v$version).
    With this XML I also want the metadata information about all the fields used in the query (passed to getXML function). Is it possible and how can I achieve this.It is possible but with a bit of effort.
    I would use DBMS_SQL utility to parse the query, extract each column's description and then build a METADATA element with the required information.
    Here's an example (11g) :
    DECLARE
      v_query      varchar2(30) := 'select * from scott.emp';
      v_cur        integer;
      v_desc_tab   dbms_sql.desc_tab;
      v_col_cnt    number;
      v_col_lst    varchar2(4000);
      v_xml_query  varchar2(32767);
      xml_metadata_coll xmlsequencetype := xmlsequencetype();
      xml_metadata      xmltype;
      res          clob;
    BEGIN
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_query, dbms_sql.native);
      dbms_sql.describe_columns(v_cur, v_col_cnt, v_desc_tab);
      dbms_sql.close_cursor(v_cur);
      for i in 1 .. v_col_cnt loop
        if i > 1 then
          v_col_lst := v_col_lst || ', ';
        end if;
        v_col_lst := v_col_lst || v_desc_tab(i).col_name;
        xml_metadata_coll.extend;
        select xmlelement("COLUMN"
               , xmlattributes(v_desc_tab(i).col_name as "name")
               , xmlforest(
                   case v_desc_tab(i).col_type
                     when 1   then 'VARCHAR2'
                     when 2   then 'NUMBER'
                     when 12  then 'DATE'
                     when 180 then 'TIMESTAMP'
                     else 'UNKNOWN'
                   end as "DATATYPE"
                 , v_desc_tab(i).col_max_len as "MAX_LENGTH"
                 , v_desc_tab(i).col_precision as "PRECISION"
                 , v_desc_tab(i).col_scale as "SCALE"
        into xml_metadata_coll(i)
        from dual;
      end loop;
      v_xml_query :=
    'SELECT XMLSerialize(document
             XMLElement("ROOT"
             , :1
             , XMLElement("ROWSET"
               , XMLAgg(
                   XMLElement("ROW", XMLForest(' || v_col_lst || '))
             ) as clob indent
    FROM ( ' || v_query || ')';
      select xmlelement("METADATA", xmlagg(column_value))
      into xml_metadata
      from table(xml_metadata_coll)
      execute immediate v_xml_query into res using xml_metadata;
      dbms_output.put_line(res);
    END;
    /Ouput :
    <ROOT>
      <METADATA>
        <COLUMN name="EMPNO">
          <DATATYPE>NUMBER</DATATYPE>
          <MAX_LENGTH>22</MAX_LENGTH>
          <PRECISION>4</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
        <COLUMN name="ENAME">
          <DATATYPE>VARCHAR2</DATATYPE>
          <MAX_LENGTH>10</MAX_LENGTH>
          <PRECISION>0</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
        <COLUMN name="JOB">
          <DATATYPE>VARCHAR2</DATATYPE>
          <MAX_LENGTH>9</MAX_LENGTH>
          <PRECISION>0</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
        <COLUMN name="MGR">
          <DATATYPE>NUMBER</DATATYPE>
          <MAX_LENGTH>22</MAX_LENGTH>
          <PRECISION>4</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
        <COLUMN name="HIREDATE">
          <DATATYPE>DATE</DATATYPE>
          <MAX_LENGTH>7</MAX_LENGTH>
          <PRECISION>0</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
        <COLUMN name="SAL">
          <DATATYPE>NUMBER</DATATYPE>
          <MAX_LENGTH>22</MAX_LENGTH>
          <PRECISION>7</PRECISION>
          <SCALE>2</SCALE>
        </COLUMN>
        <COLUMN name="COMM">
          <DATATYPE>NUMBER</DATATYPE>
          <MAX_LENGTH>22</MAX_LENGTH>
          <PRECISION>7</PRECISION>
          <SCALE>2</SCALE>
        </COLUMN>
        <COLUMN name="DEPTNO">
          <DATATYPE>NUMBER</DATATYPE>
          <MAX_LENGTH>22</MAX_LENGTH>
          <PRECISION>2</PRECISION>
          <SCALE>0</SCALE>
        </COLUMN>
      </METADATA>
      <ROWSET>
        <ROW>
          <EMPNO>7369</EMPNO>
          <ENAME>SMITH</ENAME>
          <JOB>CLERK</JOB>
          <MGR>7902</MGR>
          <HIREDATE>1980-12-17</HIREDATE>
          <SAL>800</SAL>
          <DEPTNO>20</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7499</EMPNO>
          <ENAME>ALLEN</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
          <HIREDATE>1981-02-20</HIREDATE>
          <SAL>1600</SAL>
          <COMM>300</COMM>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7521</EMPNO>
          <ENAME>WARD</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
          <HIREDATE>1981-02-22</HIREDATE>
          <SAL>1250</SAL>
          <COMM>500</COMM>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7566</EMPNO>
          <ENAME>JONES</ENAME>
          <JOB>MANAGER</JOB>
          <MGR>7839</MGR>
          <HIREDATE>1981-04-02</HIREDATE>
          <SAL>2975</SAL>
          <DEPTNO>20</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7654</EMPNO>
          <ENAME>MARTIN</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
          <HIREDATE>1981-09-28</HIREDATE>
          <SAL>1250</SAL>
          <COMM>1400</COMM>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7698</EMPNO>
          <ENAME>BLAKE</ENAME>
          <JOB>MANAGER</JOB>
          <MGR>7839</MGR>
          <HIREDATE>1981-05-01</HIREDATE>
          <SAL>2850</SAL>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7782</EMPNO>
          <ENAME>CLARK</ENAME>
          <JOB>MANAGER</JOB>
          <MGR>7839</MGR>
          <HIREDATE>1981-06-09</HIREDATE>
          <SAL>2450</SAL>
          <DEPTNO>10</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7839</EMPNO>
          <ENAME>KING</ENAME>
          <JOB>PRESIDENT</JOB>
          <HIREDATE>1981-11-17</HIREDATE>
          <SAL>5000</SAL>
          <DEPTNO>10</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7844</EMPNO>
          <ENAME>TURNER</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
          <HIREDATE>1981-09-08</HIREDATE>
          <SAL>1500</SAL>
          <COMM>0</COMM>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7900</EMPNO>
          <ENAME>JAMES</ENAME>
          <JOB>CLERK</JOB>
          <MGR>7698</MGR>
          <HIREDATE>1981-12-03</HIREDATE>
          <SAL>950</SAL>
          <DEPTNO>30</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7902</EMPNO>
          <ENAME>FORD</ENAME>
          <JOB>ANALYST</JOB>
          <MGR>7566</MGR>
          <HIREDATE>1981-12-03</HIREDATE>
          <SAL>3000</SAL>
          <DEPTNO>20</DEPTNO>
        </ROW>
        <ROW>
          <EMPNO>7934</EMPNO>
          <ENAME>MILLER</ENAME>
          <JOB>CLERK</JOB>
          <MGR>7782</MGR>
          <HIREDATE>1982-01-23</HIREDATE>
          <SAL>1300</SAL>
          <DEPTNO>10</DEPTNO>
        </ROW>
      </ROWSET>
    </ROOT>A couple of comments :
    <li> I handle only four datatypes here (VARCHAR2, NUMBER, DATE, TIMESTAMP). Of course you can add more.
    The list of Oracle Type Number is available here : http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements001.htm#i54330
    Starting with 11g (not sure which release), DBMS_SQL package also declares these numbers through named constants.
    <li> I don't use DBMS_XMLGEN in this example. Instead I rebuild the query using SQL/XML functions and the list of columns that's just been described.

  • How to generate the output of a BSP application in PDF format?

    Hi,
    I need to modify one BSP application, which generates its output in the form of PDF. I have checked all the methods in the bsp pages and its corresponding controller class's. I couldn't find any relevant method, which deals with generating the output in PDF.
    Could you please share your valuable thoughts on this?
    Again it would be helpful, If anyone of you share some knowledge on Interactive Adobe Forms.
    Thanks,
    John

    >
    I am using oracle version 11.2.0.1, I have set a cronjob which will run on every 15 minutes and give us a log file mentioning the execution time taken for that SQL query:-
    The above query will return the output as well as the time taken for execution of the query. I want to suppress the output of the query and only want the time taken to be printed. Is it possible by set commands. I have marked the output as bold and made it Italic.
    >
    How would that even be useful?
    A query from a tool such as sql*plus is STILL going to send the output to the client and the client. You can keep sql*plus from actually displaying the data by setting autotrace to trace only.
    But that TIME TAKEN is still going to include the network time it takes to send ALL rows that the query returns across the network.
    That time is NOT the same as the actual execution time of the query. So unless you are trying to determine how long it takes to send the data over the network your 'timing' method is rather flawed.
    Why don't you tell us WHAT PROBLEM you are trying to solve so we can help you solve it?

  • Spooling the output of a Query with out displaying the rows

    Hello All,
    Is it possible to spool the output of
    a query/dbms_output.put_line with out displaying
    the Query output on the console.
    In my case,list of rows in the output is huge, I want
    to eliminate displaying the output of query
    so that spooling will complete faster.
    Thanks in advance.
    -Srini

    You can do:
    SET TERMOUT OFFIn your script before doing the spool command.
    You will have to write your query as a .SQL script and run it from SQL*Plus in order for it to work the way you expect.
    sqlplus -s username/password @query_script.SQL

  • Unable to generate the output for S_ALR_87012048

    Dear All,
    We are trying to execute the report  S_ALR_87012048 for the first period in 2015.  We have tried execute this report with report date 25.01.2015 (which is the last day in period 01), but it is giving no data was selected.
    Can anybody suggest whether I need to give any further inputs to generate the output apart from the below.
    Co.code : 9000
    Reporting date : 25.01.2015 (which is the last day in our fiscal period 01 /2015)
    Dep area : 01
    Sort Variant : 03 (co.code / bs  accounts / asset class)
    User able to execute this report in the last month successfully.
    We have completed all year ending process as well.
    I have tried execute this report in our quality system with reporting date as 31.12.2014 and 31.12.2015.
    Do we need to give reporting date as year ending date ? or last date of current period.
    Thanks in Advance.
    Prasad

    Hi Prasad,
    I do believe that you should consider the authorization side of the matter carefully as pointed out by Mahmoud on Feb 6th. Please check again the mentioned SAP Notes in that thread.
    For example, I just tested in my system, I can trigger a report even in a closed fiscal year with a report date end of each period. The only difference is that I get a information message:
    Report date is in a closed fiscal year
    Message no. AU172
    Diagnosis
    The report date is in the past.
    Here the report date is allowed to be the end of the year as well as any
    period end during the fiscal year.
    System Response
    In an asset report during the fiscal year (report date for a period end
    within the year) in a closed fiscal year, it can be the case that the results
    for depreciation or the net book value are different between the historical
    calculation and the current calculation for the report date. The reason for this
    are any changes to asset-related depreciation terms, such as the depreciation
    key, useful life, and so on. In the case of such changes, the asset values are
    recalculated with the currently entered depreciation terms.
    In an open fiscal year and a report date end of period I do not get AU172 and get an output.
    Beside above provided SAP Notes, also see another couple of SAP Notes with some interesting information are also:
    1566099  Reporting in Asset Accounting
    1491612  Authorization concept in FI-AA
    1394450  Reporting: Authorization check for report assignment
    929732    Authorization checks: Correction Note 856248
    856248   Authorization checks in asset reporting
    Regards,
    Brigitte

  • Procedure to save the output of a query into excel file or flat file

    Procedure to save the output of a query into excel file or flat file
    I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
    I have run the query --
    DECLARE @cmd VARCHAR(255)
    SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
    Exec xp_cmdshell @cmd
    error message--
    SQLState = 28000, NativeError = 18456
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
    NULL
    Goel.Aman

    Hello,
    -T:
    Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
    login_id, and password are not required. If
    –T is not specified, you need to specify
    –U and –P to successfully log in.
    -U:
    Specifies the login ID used to connect to SQL Server.
    Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
    -T option (trusted connection) instead of the
    user name and password combination
    I would suggest you take a look at the following article:
    bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
    A similar thread regarding this issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
    Regards,
    Elvis Long
    TechNet Community Support

  • How can we generate the report of backup,tablesapcefrom OEM / RMAN

    How can we generate the report of backup status,tablesapce(usedf,free space) for all the databases from OEM / RMAN
    1.)we need generate the report of tablespace used,free, archive...
    2.)How can we generate the Backup status report also

    user13584223 wrote:
    How can we generate the report of backup status,tablesapce(usedf,free space) for all the databases from OEM / RMAN
    1.)we need generate the report of tablespace used,free, archive...There are DBA_* views that expose the necessary information. They are documented in the Reference Manual.
    2.)How can we generate the Backup status report alsoThere are rman commands that give that. They are documented in the Backup and Recovery User's Guide.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to [url tahiti.oracle.com]tahiti.oracle.com.
    Locate the link for your Oracle product and version, and click on it.
    You are now at the entire documentation set for your selected Oracle product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab (for 10.x) or the "Master Book List" link (for 11.x) you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • How can i retrieve the output of procedure using a select statement ?

    Hi every one.
    this mite be dumm ?
    how can i use the output of the a procedure containing multiple rows of data in a select statement ?

    This is not  a SQL Developer question. You should ask it in the SQL and PL/SQL forum.
    The short answer is you can't.  Sounds is if you are trying to use MSSQL techniques in oracle. Learn oracle techniques

  • Get the output of a query in a textpad..

    Hi..
    I need to get the output of a query in a notepad..
    Can anyone help me..

    spool c:\emp.txt
    fire select * from emp;
    spool off;
    go to c: and check your text file.
    hare krishna
    Alok

  • How to insert the records using sql query

    hi,
    i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
    how can i solve this problem?
    Regards,
    M.Thippa Reddy

    You are not support use Insert / Update / Delete on SAP Databases directly.
    SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
    Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • Can't see the output of cast/multicast

    Hi, I can't see the output of cast/multicast.. but in sql*plus, i can..
    regards

    Hello, here's a sample...
    ops$rringor@RLR9204> create or replace type
    2 myarraytype as table of varchar2(2000)
    3 /
    Type created.
    ops$rringor@RLR9204> drop table t;
    Table dropped.
    ops$rringor@RLR9204> create table t
    2 ( id number not null ,
    3 name varchar2(10) ) ;
    Table created.
    ops$rringor@RLR9204> begin
    2 for i in 1..10
    3 loop
    4 insert into t values ( i, i||'abc');
    5 end loop;
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    ops$rringor@RLR9204>
    ops$rringor@RLR9204> select a.id,
    2 CAST( MULTISET( select b.name
    3 from t b
    4 where b.id = a.id ) as myArrayType ) as names
    5 from t a ;
    ID NAMES
    1 MYARRAYTYPE('1abc')
    2 MYARRAYTYPE('2abc')
    3 MYARRAYTYPE('3abc')
    4 MYARRAYTYPE('4abc')
    5 MYARRAYTYPE('5abc')
    6 MYARRAYTYPE('6abc')
    7 MYARRAYTYPE('7abc')
    8 MYARRAYTYPE('8abc')
    9 MYARRAYTYPE('9abc')
    10 MYARRAYTYPE('10abc')
    10 rows selected.
    I can see the records under NAMES but I can't view it using SQLDeveloper.

Maybe you are looking for