Convert Query to OracleXMLQuery

Hi,
We're trying to convert a query to XML using OracleXMLQuery, inside a servlet using OAS.
When we compile and run it in JDeveloper, it works fine. But in the OAS 4.8.0.2 the aplication bail's out!
Thanx in advance.
Here is the code we are experimenting with:
/*we are putting the output to a file for debugging
import java.sql.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.dml.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class TestServlet extends HttpServlet {
//Initialize global variables
public void init(ServletConfig config) throws ServletException {
super.init(config);
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = new PrintWriter (response.getOutputStream());
try {
FileOutputStream f =new FileOutputStream("output.log");
PrintWriter fout = new PrintWriter(f,true);
fout.println("<html>");
fout.println("<head><title>TestServlet</title></head>");
fout.println("<body>Hello From TestServlet doGet()");
//Load (and therefore register ) the Oracle Driver
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
// get a connection name
Connection con =(Connection) DriverManager.getConnection("jdbc:oracle:thin:system/[email protected]:1521:SIGLABD");
//create a stament object
Statement stmt = con.createStatement();
//Execute a SQL Query
ResultSet rs = stmt.executeQuery("SELECT IDENTIFICADOR, NOME FROM SYSTEM.USERNAME");
fout.println("ligacao obtida");
String query = "select * from responsabilidade";
Statement stmt2 = con.createStatement();
fout.println("Statement created");
ResultSet rs2 = stmt2.executeQuery (query);
fout.println("Query done!!!");
OracleXMLQuery qry=new OracleXMLQuery(con, rs2);
fout.println("XML conversion!!! Ok");
String str = qry.getXMLString();
qry.close();
fout.println("ExecutaQuery(String):Fim "+ str);
fout.println("</body></html>");
fout.close();
} catch (Exception e){ out.println(e.toString());}
//Get Servlet information
public String getServletInfo() {
return "TestServlet Information";
Our OAS cartridge classpath is:
:\wwwsigla\servlets\oraclexmlsql.jar;c:\wwwsigla\servlets\dcxjp.zip;%ORAWEB_HOME%\classes\services.jar;%ORACLE_HOME%\ows\cartx\jweb\classes\jweb.jar;%ORACLE_HOME%\ows\cartx\jweb\cl asses\jservlet.jar;%ORACLE_HOME%\orb\classes\yoj.jar;%ORAWEB_HOME%\classes\cosnam.jar;%ORACLE_HOME%\orb\classes\session.jar;%ORACLE_HOME%\orb\classes\cache.jar;%ORACLE_HOME%\jdbc\l ib\classes111.zip;%ORACLE_HOME%\ots\classes\oraclejts.jar;%ORACLE_HOME%\ots\classes\jtsjdbc.jar;%ORAWEB_HOME%\classes\ecoapi.jar;%ORAWEB_HOME%\classes\ejbapi.jar;%ORAWEB_HOME%\clas ses\oasdeploy.jar

I have a similar problem. I can get a class that I've written to work with JDeveloper.
However when I try to use it as a stored procedure I can't get it deployed nor compiled in the db if I load it using loadjava. I have spent hours on this problem And have sent two Topics in here regarding this.
I have also tried do load the whole jar into the database but after loading it, it is also not compilable. Someone suggest that this whole problem had to do with db priviliges but I've checked that and I can rule that out.
I then tried to use the Oracexmlsql package int a servlet but I can't get that to work either (I have got other servlets working but not using the one using oraclexmlsql.jar).
I reckon that the problem lies within the package or OAS.
If you find out something about this problem, please keep me posted.
Andre
null

Similar Messages

  • PLS CONVERT QUERY-  UPDATE to MERGE

    Hi all,
    Can you help me in converting this update statement into merge? I will really appreciate your help. Thanks
    UPDATE dm_organizations tt
    SET (cost_ctr_desc, cost_ctr_hier_lvl_1, cost_ctr_hier_lvl_2,
    cost_ctr_hier_lvl_3, cost_ctr_hier_lvl_4, cost_ctr_hier_lvl_5, rgn_nm,
    cntry_nm, load_date, update_date) =
    (SELECT t.cost_ctr_desc, t.cost_ctr_hier_lvl_1,
    t.cost_ctr_hier_lvl_2, t.cost_ctr_hier_lvl_3,
    t.cost_ctr_hier_lvl_4, t.cost_ctr_hier_lvl_5, t.rgn_nm,
    t.cntry_nm, t.load_date, SYSDATE
    FROM dmi_cc_upload_stg t
    WHERE t.run_id = 1831
    AND t.status = 'Published'
    AND t.cost_ctr_id = tt.cost_ctr_id
    AND t.div_code = tt.div_code
    AND t.fcn_code = tt.fcn_code
    AND t.mkt_code = tt.mkt_code
    AND t.corp_id = tt.corp_id
    AND ROWNUM = 1)
    WHERE EXISTS (
    SELECT t.cost_ctr_desc, t.cost_ctr_hier_lvl_1,
    t.cost_ctr_hier_lvl_2, t.cost_ctr_hier_lvl_3,
    t.cost_ctr_hier_lvl_4, t.cost_ctr_hier_lvl_5, t.rgn_nm,
    t.cntry_nm, t.load_date, SYSDATE
    FROM dmi_cc_upload_stg t
    WHERE t.run_id = 1831
    AND t.status = 'Published'
    AND t.cost_ctr_id = tt.cost_ctr_id
    AND t.div_code = tt.div_code
    AND t.fcn_code = tt.fcn_code
    AND t.mkt_code = tt.mkt_code
    AND t.corp_id = tt.corp_id);

    Duplicate thread!
    PLS HELP CONVERT QUERY FROM UPDATE TO MERGE

  • How to convert query

    Hi all,
    how to convert the below query using EXISTS so tht i can give better performance
    select count(distinct material_no) from ot_raw_demand_plan_stg stg
    where material_no in (select distinct produced_part from ot_flat_bom bom)

    One alternative which <b>might</b> give you better performance:
    <br><br>
    select count(distinct material_no) from ot_raw_demand_plan_stg stg<br>
    where exists (select 1 from ot_flat_bom bom where bom.produced_part = stg.material_no)
    <br><br>
    Also, make sure that your tables are properly analyzed and use EXPLAIN PLAN to compare execution plans.

  • Convert query results to a list

    Have a query which returns 20 records or so. I need to
    convert the results to a list and then search through the list to
    populate checkboxes. Simple query which returns 20 records:
    <CFQUERY NAME="GetTest" datasource="test">
    SELECT * FROM data
    WHERE brid = '012345'
    </CFQUERY>
    How can I convert these results to a list so I can use
    listfind?

    <CFSET foo = ValueList(getTest.bar)> converts the
    database field bar to the comma-delimited list foo.

  • Convert query from other database

    Hi all,
    Please help me,
    I need convert this query for oracle, this originaly from postgres.
    I appreciate anyone who can help me... thanks a lot
    select
         CASE catg_id
              WHEN 1 THEN 'RESIDENCIAL'
              WHEN 2 THEN 'COMERCIAL'
              WHEN 3 THEN 'INDUSTRIAL'
              WHEN 4 THEN 'PÚBLICO'     
         END                                         as "Categoria",
         sum(coalesce(vlr_arrec_tot,0))                         as "Arrecadação Provisória Novembro_2010"
    from
    -- ARRECADAÇÃO DIÁRIA     
         select
              coalesce(arrec1.catg_id,devol.catg_id)                                   as catg_id,
              sum(coalesce(arrec1,0) - coalesce(devol,0))                              as vlr_arrec_tot
         from                              
                   select catg_id,
                        sum(ardd.ardd_vlpagamentos) as arrec1
                   from      arrecadacao.arrecadacao_dados_diarios ardd
                   where      ardd.ardd_amreferenciaarrecadacao = 201011
                   group by 1
                   order by 1
              ) as arrec1           
              full outer join
                   select catg_id,
                        sum(dvdd.dvdd_vldevolucoes) as devol
                   from arrecadacao.devolucao_dados_diarios dvdd
                   where dvdd.dvdd_amreferenciaarrecadacao = 201011
                   and dvdd.dvdd_tipodevolucao in ('C','D','N')
                   group by 1
                   order by 1
              ) as devol      on devol.catg_id = arrec1.catg_id
              group by 1
              order by 1
         ) as arrec     
    group by 1
    order by 1

    saddones wrote:
    Hi all,
    Please help me,
    I need convert this query for oracle, this originaly from postgres.
    I appreciate anyone who can help me... thanks a lot
    select
         CASE catg_id
              WHEN 1 THEN 'RESIDENCIAL'
              WHEN 2 THEN 'COMERCIAL'
              WHEN 3 THEN 'INDUSTRIAL'
              WHEN 4 THEN 'PÚBLICO'     
         END                                         as "Categoria",
         sum(coalesce(vlr_arrec_tot,0))                         as "Arrecadação Provisória Novembro_2010"
    from
    -- ARRECADAÇÃO DIÁRIA     
         select
              coalesce(arrec1.catg_id,devol.catg_id)                                   as catg_id,
              sum(coalesce(arrec1,0) - coalesce(devol,0))                              as vlr_arrec_tot
         from                              
                   select catg_id,
                        sum(ardd.ardd_vlpagamentos) as arrec1
                   from      arrecadacao.arrecadacao_dados_diarios ardd
                   where      ardd.ardd_amreferenciaarrecadacao = 201011
                   group by 1
                   order by 1
              ) as arrec1           
              full outer join
                   select catg_id,
                        sum(dvdd.dvdd_vldevolucoes) as devol
                   from arrecadacao.devolucao_dados_diarios dvdd
                   where dvdd.dvdd_amreferenciaarrecadacao = 201011
                   and dvdd.dvdd_tipodevolucao in ('C','D','N')
                   group by 1
                   order by 1
              ) as devol      on devol.catg_id = arrec1.catg_id
              group by 1
              order by 1
         ) as arrec     
    group by 1
    order by 1What exactly about the query doesn't work now? It all looks compliant to me (though i'm not sure about the group by 1 stuff, you may or may not, have to put the actual column name). I also think your alias is too long (just based on visual inspection), it's going to need to be 30 chars or less
    "Arrecadação Provisória Novembro_2010"Keep in mind that we don't have your tables (nor your Oracle version since we don't know it) so if you really want help you'll have to put in a little more effort to make this manageable.

  • Converting query to SP; ListQualify is breaking string for SQL

    Hello, all.
    I'm attempting to convert a number of queries into SPs; for the most part, it's going smoothly.
    However, there is one query (quite large) that I am having problems converting to SP because the query is using ListQualify to insert apostrophes around each list element, and it's breaking the string being sent.
    How can I keep the apostrophes without breaking the SQL string?
    Thanks,
    ^_^

    Just escape the apostrophe with another apostrophe?  OR, do you mean surround the apostrophe with quotes? (" ' ")
    Thanks,
    ^_^

  • Help on converting query with case into decode

    Hi Can anyone help me to revise my plsql query? Below is a portion og the procedure I am changing to meet Oracle 8i.
    SELECT SUM(NVL(CASE WHEN (weeks='wk1' ) THEN qty END, 0)) wk1,
    SUM(NVL(CASE WHEN (weeks='wk2' ) THEN qty END, 0)) wk2,
    SUM(NVL(CASE WHEN (weeks='wk3' ) THEN qty END, 0)) wk3,
    SUM(NVL(CASE WHEN (weeks='wk4' ) THEN qty END, 0)) wk4
    FROM TABLE1
    Thanks in advance.

    pls try this....(code not tested as no create table etc provided).
    select dt
    from (select decode(is_tbd,
    'yes',
    decode(is_tbd_order,
    'no',
    'tbd',
    decode(sign(ex_fac_date - (v_asofdate + 131)),
    1,
    'tbd',
    null),
    decode(sign(ex_fac_date - (v_asofdate + 131)),
    1,
    'tbd',
    null)),
    null) dt
    from dual
    union all
    select decode(sign(ex_fac_date - (v_asofdate - 1)),
    1,
    decode(sign(ex_fac_date - (v_asofdate + 5)),
    0,
    decode(is_tbd, 'no', 'wk1', null),
    null),
    null)
    from dual
    union all
    select decode(sign(ex_fac_date - (v_asofdate + 6)),
    1,
    decode(sign(ex_fac_date - (v_asofdate + 12)),
    0,
    decode(is_tbd, 'no', 'wk2', null),
    null),
    null)
    from dual
    select decode(sign(ex_fac_date - (v_asofdate + 13)),
    1,
    decode(sign(ex_fac_date - (v_asofdate + 19)),
    0,
    decode(is_tbd, 'no', 'wk3', null),
    null),
    null)
    from dual
    union all
    select decode(sign(ex_fac_date - (v_asofdate - 1)),
    0,
    decode(is_tbd, 'no', 'past_due', null),
    null)
    from dual
    where dt is not null
    Regards

  • Converting Query results into HTML email

    Hi,
    I am using oracle 11g. I' m using the following procedure to send out html emails from a static query in the procedure and it works fine. I wanted to make it dynamic and pass the sql query as a parameter to procedure and build the html tags based on the query. Any thoughts?
    CREATE OR REPLACE PROCEDURE html_sql_results
    is
        v_rows clob;
        v_header clob;
        cursor v_cursor is
        select SR_NO,STATE,DUE_DT,PROCESS_DT,STATUS,DAY_NO,SEQ_NO
        from T_TABLE;
        BEGIN
        v_header := '<table border=1>
                  <tr style=''background:#8DB3E2''>
                  <td><p><b>SR_NO</b></p></td>
                  <td><p><b>STATE</b></p></td>
                  <td><p><b>DUE_DT</b></p></td>
                  <td><p><b>PROCESS_DT</b></p></td>
                  <td><p><b>STATUS</b></p></td>
                  <td><p><b>DAY_NO</b></p></td>
                  <td><p><b>SEQ_NO</b></p></td>
                  </tr>';
        v_rows := Null;
        FOR i in v_cursor
        LOOP
        v_rows  := v_rows ||
                '<tr>
                <td> <p>' || I.SR_NO||'</p></td>
                <td> <p>' || I.STATE||'</p></td>
                <td> <p>' || I.DUE_DT ||'</p></td>
                <td> <p>' || I.PROCESS_DT ||'</p></td>
                <td> <p>' || I.STATUS||'</p></td>
                <td> <p>' || I.DAY_NO ||'</p></td>
                <td> <p>' || I.SEQ_NO||'</p></td>
                </tr> ';
        END LOOP;
        if v_rows is not null then
        v_rows:= v_header ||v_rows ||' </table> ' ;
        dbms_output.put_line(v_rows); 
        email_results(v_rows);
        end if ;
        end ;
    /

    A possible way :
    SQL> var result clob
    SQL> DECLARE
      2
      3    ctx  dbms_xmlgen.ctxHandle;
      4    qry  varchar2(2000) := 'SELECT * FROM hr.employees WHERE department_id = :1';
      5
      6    xsl  xmltype := xmltype('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      7   <xsl:output method="html"/>
      8   <xsl:template match="/ROWSET">
      9    <table border="1">
    10     <tr style="background:#8DB3E2">
    11      <xsl:for-each select="ROW[1]/*">
    12       <td><p><b><xsl:value-of select="name()"/></b></p></td>
    13      </xsl:for-each>
    14      <xsl:apply-templates/>
    15     </tr>
    16    </table>
    17   </xsl:template>
    18   <xsl:template match="ROW">
    19    <tr><xsl:apply-templates/></tr>
    20   </xsl:template>
    21   <xsl:template match="ROW/*">
    22    <td><p><b><xsl:value-of select="."/></b></p></td>
    23   </xsl:template>
    24  </xsl:stylesheet>');
    25
    26    res  clob;
    27
    28  BEGIN
    29
    30    ctx := dbms_xmlgen.newContext(qry);
    31    dbms_xmlgen.setBindValue(ctx, '1', 90);
    32    dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.EMPTY_TAG);
    33    dbms_xmlgen.setXSLT(ctx, xsl);
    34
    35    :result := dbms_xmlgen.getXML(ctx);
    36    dbms_xmlgen.closeContext(ctx);
    37
    38    --dbms_output.put_line(res);
    39
    40  END;
    41  /
    PL/SQL procedure successfully completed.
    SQL> print result
    RESULT
    <table border="1"><tr style="background:#8DB3E2"><td><p><b>EMPLOYEE_ID</b></p></
    td><td><p><b>FIRST_NAME</b></p></td><td><p><b>LAST_NAME</b></p></td><td><p><b>EM
    AIL</b></p></td><td><p><b>PHONE_NUMBER</b></p></td><td><p><b>HIRE_DATE</b></p></
    td><td><p><b>JOB_ID</b></p></td><td><p><b>SALARY</b></p></td><td><p><b>COMMISSIO
    N_PCT</b></p></td><td><p><b>MANAGER_ID</b></p></td><td><p><b>DEPARTMENT_ID</b></
    p></td><tr><td><p><b>100</b></p></td><td><p><b>Steven</b></p></td><td><p><b>King
    </b></p></td><td><p><b>SKING</b></p></td><td><p><b>515.123.4567</b></p></td><td>
    <p><b>17/06/03</b></p></td><td><p><b>AD_PRES</b></p></td><td><p><b>24000</b></p>
    </td><td><p><b></b></p></td><td><p><b></b></p></td><td><p><b>90</b></p></td></tr
    <tr><td><p><b>101</b></p></td><td><p><b>Neena</b></p></td><td><p><b>Kochhar</b></p></td><td><p><b>NKOCHHAR</b></p></td><td><p><b>515.123.4568</b></p></td><td><
    p><b>21/09/05</b></p></td><td><p><b>AD_VP</b></p></td><td><p><b>17000</b></p></t
    d><td><p><b></b></p></td><td><p><b>100</b></p></td><td><p><b>90</b></p></td></tr
    <tr><td><p><b>102</b></p></td><td><p><b>Lex</b></p></td><td><p><b>De Haan</b></p></td><td><p><b>LDEHAAN</b></p></td><td><p><b>515.123.4569</b></p></td><td><p><
    b>13/01/01</b></p></td><td><p><b>AD_VP</b></p></td><td><p><b>17000</b></p></td><
    td><p><b></b></p></td><td><p><b>100</b></p></td><td><p><b>90</b></p></td></tr></
    tr></table>Typically, XSLT stylesheets may be stored in the database too, so that you can modify and use different presentation templates without touching the code.

  • PLS HELP CONVERT QUERY FROM UPDATE TO MERGE

    Hi all,
    Can you help me in converting this update statement into merge? I will really appreciate your help. Thanks
    UPDATE dm_organizations tt
    SET (cost_ctr_desc, cost_ctr_hier_lvl_1, cost_ctr_hier_lvl_2,
    cost_ctr_hier_lvl_3, cost_ctr_hier_lvl_4, cost_ctr_hier_lvl_5, rgn_nm,
    cntry_nm, load_date, update_date) =
    (SELECT t.cost_ctr_desc, t.cost_ctr_hier_lvl_1,
    t.cost_ctr_hier_lvl_2, t.cost_ctr_hier_lvl_3,
    t.cost_ctr_hier_lvl_4, t.cost_ctr_hier_lvl_5, t.rgn_nm,
    t.cntry_nm, t.load_date, SYSDATE
    FROM dmi_cc_upload_stg t
    WHERE t.run_id = 1831
    AND t.status = 'Published'
    AND t.cost_ctr_id = tt.cost_ctr_id
    AND t.div_code = tt.div_code
    AND t.fcn_code = tt.fcn_code
    AND t.mkt_code = tt.mkt_code
    AND t.corp_id = tt.corp_id
    AND ROWNUM = 1)
    WHERE EXISTS (
    SELECT t.cost_ctr_desc, t.cost_ctr_hier_lvl_1,
    t.cost_ctr_hier_lvl_2, t.cost_ctr_hier_lvl_3,
    t.cost_ctr_hier_lvl_4, t.cost_ctr_hier_lvl_5, t.rgn_nm,
    t.cntry_nm, t.load_date, SYSDATE
    FROM dmi_cc_upload_stg t
    WHERE t.run_id = 1831
    AND t.status = 'Published'
    AND t.cost_ctr_id = tt.cost_ctr_id
    AND t.div_code = tt.div_code
    AND t.fcn_code = tt.fcn_code
    AND t.mkt_code = tt.mkt_code
    AND t.corp_id = tt.corp_id);

    why not use existing UPDATE?
    UPDATE dm_organizations tt
    SET    ( cost_ctr_desc, cost_ctr_hier_lvl_1, cost_ctr_hier_lvl_2,
             cost_ctr_hier_lvl_3,
             cost_ctr_hier_lvl_4, cost_ctr_hier_lvl_5, rgn_nm, cntry_nm,
             load_date, update_date ) = (SELECT t.cost_ctr_desc,
                                                t.cost_ctr_hier_lvl_1,
                                                t.cost_ctr_hier_lvl_2,
                                                t.cost_ctr_hier_lvl_3,
                                                t.cost_ctr_hier_lvl_4,
                                                t.cost_ctr_hier_lvl_5,
                                                t.rgn_nm,
                                                t.cntry_nm,
                                                t.load_date,
                                                SYSDATE
                                         FROM   dmi_cc_upload_stg t
                                         WHERE  t.run_id = 1831
                                                AND t.status = 'Published'
                                                AND t.cost_ctr_id = tt.cost_ctr_id
                                                AND t.div_code = tt.div_code
                                                AND t.fcn_code = tt.fcn_code
                                                AND t.mkt_code = tt.mkt_code
                                                AND t.corp_id = tt.corp_id
                                                AND ROWNUM = 1)
    WHERE  EXISTS (SELECT t.cost_ctr_desc,
                          t.cost_ctr_hier_lvl_1,
                          t.cost_ctr_hier_lvl_2,
                          t.cost_ctr_hier_lvl_3,
                          t.cost_ctr_hier_lvl_4,
                          t.cost_ctr_hier_lvl_5,
                          t.rgn_nm,
                          t.cntry_nm,
                          t.load_date,
                          SYSDATE
                   FROM   dmi_cc_upload_stg t
                   WHERE  t.run_id = 1831
                          AND t.status = 'Published'
                          AND t.cost_ctr_id = tt.cost_ctr_id
                          AND t.div_code = tt.div_code
                          AND t.fcn_code = tt.fcn_code
                          AND t.mkt_code = tt.mkt_code
                          AND t.corp_id = tt.corp_id); 

  • Convert query made u200Bu200Bin SQ01, SQ02 and SQ03 for a transaction set

    Hello people, how do I create a transaction for a report I did in queries with the transaction SQ01, SQ02 and SQ03? ...
    hugs

    Hi Stelio Mucavele
    i had the same issue resolved by below steps
    1>go to SQVI t code and  enter your query name and press enter
    2>In the menu path select Quick view--> additional functions-->Generate Program
    3>After Generating the program In the menu path select Quick view--> additional functions-->Display report Name
    4>Now in se38 enter the report name in Program field and execute
    5>You will get the Initial Selection screen of the report . Go to Menu of System -->Status
    6> Note down the Program name and Screen number
    7>Go to SE93 and Create a Z tcode for the query, Enter the description  and importantly you have to select the 2nd Option radio Button Program and Selection Screen (Report Transaction) and Press enter
    8>In the next screen enter the Report name In Program field and enter the screen number
    9>In the classification Section select Professional user  Transaction
    10>In GUI support section select all the options  i.e SAPGUI for HTML,Java,Windows
    and save
    the system will ask for Package select your package if not there then select local object
    now execute the Z tcode your report will run sucessfully
    Regards
    Vijay hebbal

  • Converting query to use joins

    My current query works perfectly.
    SELECT so.* FROM shipping_order so WHERE (so.submitter = 20) OR (so.requestor_id IN (SELECT poc.objid FROM point_of_contact poc WHERE poc.ain = 20)) OR so.objid IN (SELECT ats.shipping_order_id FROM ac_to_so ats WHERE (ats.access_control_id IN (selectac. objid FROM access_control ac WHERE ac.ain = 20 OR ac.group IN ('buyers', 'managers'))))
    But when I try to create it using join statements I do not get the correct results, or any results for that matter.
    Here is the query with joins.
    SELECT so.* FROM shipping_order so INNER JOIN point_of_contact ON (so.requestor_id = poc.objid AND poc.ain = 20) INNER JOIN ac_to_so ats ON (so.objid = ats.shipping_order_id) INNER JOIN access_control ac ON (ats.access_control_id = ac.objid AND (ac.group IN ('buyers', 'managers') OR ac.ain = 20)) WHERE (so.submitter = 20)
    Any ideas on what I am doing wrong. I tried outer joins as well and did not get the results either.
    TIA.
    Edited by: user9522282 on Mar 11, 2009 6:27 AM fixed typo

    Oh sorry. Here is the sql. Thanks!
    create table point_of_contact
         objid number not null,
         ain number not null,
         constraint point_of_contact_pk primary key (objid)
    create table access_control
         objid number not null,
         ain number,
         user_group varchar2(64 byte),
         constraint access_control_pk primary key (objid)
    create table shipping_order
         objid number not null,
         submitter number not null,
         requestor_id number not null,
         constraint shipping_order_pk primary key (objid)
    create table ac_to_so
         shipping_order_id number not null,
         access_control_id number not null,
         constraint ac_to_so_pk primary key (shipping_order_id, access_control_id),
         constraint ac_to_so_access_control_fk1 foreign key (access_control_id)
              references access_control (objid),
         constraint ac_to_so_shipping_order_fk1 foreign key (shipping_order_id)
              references shipping_order (objid),
    insert into point_of_contact (objid,ain) values (2,37);
    insert into point_of_contact (objid,ain) values (1,20);
    insert into access_control (objid, ain) values (1, 20);
    insert into access_control (objid, user_group) values (2, 'managers');
    insert into shipping_order (objid, submitter, requestor_id) values (1,20,1);
    insert into shipping_order (objid, submitter, requestor_id) values (2,23,2);
    insert into shipping_order (objid, submitter, requestor_id) values (3,23,2);
    insert into ac_to_so (shipping_order_id, access_control_id) values (1, 1);
    insert into ac_to_so (shipping_order_id, access_control_id) values (2, 2);
    select so.* from shipping_order so where (so.submitter = 20)
         or (so.requestor_id in (select poc.objid from point_of_contact poc where poc.ain = 20))
         or so.objid in (select ats.shipping_order_id from ac_to_so ats where
         (ats.access_control_id in (select ac.objid from access_control ac where ac.ain = 20
         or ac.user_group in ('buyers', 'managers'))));

  • Issue with SQL converter: Query Migration Tool for Microsoft SQL Server to SAP HANA

    Hello,
    I found the following blog : http://scn.sap.com/community/business-one/blog/2013/04/10/how-to-convert-sql-from-ms-sql-server-to-sap-hana
    I am trying out this migration tool for converting my MS SQL queries to HANA.
    I am running into issue while converting certain queries.
    The issue is specific to "set" commands which set local variables inside "create procedure" commands.
    e.g.
    a standalone set command:
    SET @var = (SELECT TOP 1 name FROM mytable ORDER BY name)
    is converted well:
    SELECT (SELECT TOP 1 "name" FROM "mytable" ORDER BY "name") INTO var FROM DUMMY;
    But when the same is part of create procedure:
    CREATE PROCEDURE [dbx].[XXXXX_YYYY_ZZZZ]
    AS
    SET @var = (SELECT TOP 1 name FROM mytable ORDER BY name)
    it fails in converting the same:
    --Statements in the input file contain errors; conversion was canceled
    I would like to understand who can help me here.
    Thanks...

    Hi Mayur,
    that tool cannot convert stored procedures. it is still being developed. For these you have to do it manually.

  • Convert Query to Formula: BexSetData - Create New Characteristic Combinatio

    Hello experts,
    I try to save data from an excel workbook via formula BexSetData.
    When I change only Key Figures and save data, everything works fine.
    But when I try to change the value of a characteristic, the result of the BexSetData-Formula is #NV. This is just the case when I change the characteristic value to a value which doesn't exist in the cube. If I change to an characterisitc combination, which already exist on the cube, everything works fine.
    Is it possible to create new charecteristic combinations by using BexSetData?
    Master Data is available for the characteristic value.
    Thanks in advance
    Johannes

    Hello Rik,
    thanks a lot for your answer.
    the master data for the characterisitc values already exist.
    but there is no data record in the cube with the same characterisitc combination.
    example:
    The following data is on the cube
    Plan   |   Period      |     Key Figure
    A       |   012.2009 |         1000
    Now I want to create a new data record on the cube with a new Period (master data exist in info object) via BexSetData
    Plan   |   Period         |  Key Figure
    A       |   012.2010    |      1000
    Thanks
    Johannes
    Edited by: Johannes Hilscher on May 28, 2010 5:09 PM

  • Converted access app to apex when run get no data found; table does have da

    COnverfted MS Access app to apex. WHen I run the appliation I get no data found.
    However the table does have data. HOw do I see what is actually running?
    The pre-converted form saids its based on a query. The form and the query shows up as valid. I then converted the form. When I run it I get no data found. If I take the query that the form is based on and run in sqlplus I get data.
    Another confusing thing is when I look at the page for the converted form, there is nothing in the source area for the region where the converted query results should be.
    Did the conversion not work? How can I tell what is the source? Where should the results from the query be located?

    Its a standard SQL query:
    SELECT xtbl_MSDS_to_CAS.msds_id,
    xtbl_MSDS_to_CAS.cas,
    xtbl_MSDS_to_CAS.alias,
    xtbl_MSDS_to_CAS.amount,
    xtbl_MSDS_to_CAS.veh_prod,
    xtbl_MSDS_to_CAS.compliance
    FROM xtbl_MSDS_to_CAS
    The name of the above query lets say for example purposes is MYQUERY.
    After looking at the page def I see that the way the conversion tool worked is that in the page definition it has this in the Processes Section:
    After Header:
    Fetch Row from MYQUERY.
    Then it says automated Row fetch.
    I compared this to another form that was converted thru the migration APex tool as well and on that form that does work I found that:
    The query(form) was converted and placed in a region and the source has the query. THat is, it was not in the process section but in the region: source section.
    So why does the conversion tool decide to convert one and populate as a region source and the other as a process in the page definition?
    THis is all very confusing.
    Hope you were able to follow me.

  • Unable to create visual composer table view from the Bex Query

    Hi
    I am trying to create the visual composer lay out from a Bex query. The Bex query contains a set of Key figures and a structure.
    These key figure and structure combination is forming a table in the query output. Key figure parameters are coming as rows and Structure parameters are coming as columns.
    example query out put:
    Total, HPC, FDS excel ICe etc are as Structure elements and coming as columns in query out put and
    Invoice value, Gross sale value, Efficient operations etc are as Key figure elements in query and coming as rows in query out put.
    But if I map this query to visual composer table view all these are coming as columns as given below.
    Total Invoice value ,             Total Gross sale value,    Total Efficient operations,      HPC Invoice vale,.........
    And if execute the query will giving the out put in single row.
    Can anybody help me out to map this in the row column format?
    Is it really possible to do in VC?
    I am using CE 7.2. The VC model I need to be embedding in BPM.
    Please help me to solve this issue. I completely stuck up this issue.
    Regards
    Sajith P
    Edited by: Sajith P on Aug 17, 2010 3:07 PM
    Edited by: Sajith P on Aug 17, 2010 3:15 PM

    Hi,
    Try to use some function module which will convert query data into flat tables. (eg., RS_VC_GET_QUERY_VIEW_DATA_FLAT).
    Hope this solves your issue.
    Regards,
    Vinay

Maybe you are looking for

  • Problems reading PDF files with i Pad and Mac with 10.8.3 Mountain Lion OS

    I assume InDesign uses the Acrobat XI resources to generate the exported PDFs. I have many 1-7 page articles from which I created PDFs via the export function in ID. They all read OK on PC/Apple/Linux based computers. I assembled all of the articles

  • XI messages status "Message scheduled on outbound side" with Green flag

    Dear,           On My XI system , i have too old messages and i want to clear those.           In moni messages status is "Message scheduled on outbound side" with Green flag .          When i am trying to cancel these messages i am getting a popup s

  • Price will be negative - CKM3N

    I run de material ledger but apear this error in one material. What can i do? FLAVIA Errors During Price Determination: Price will be negative

  • Iphoto library unfideable

    I have a program called Gradn Perspective that i essence scans your hard drive and give you a visual plan od what's in there, and how much space each thing uses up. This is very practical on a mac book Air because it fills up right away given the sma

  • Installing Windows 7 on Mac OSX Snow Leopard 10.6.4

    Before i install Windows 7 on my mac, i read a lot of posts involving driver problems with the keyboard and windows not working on the windows partition. So i was wondering what should i do to avoid this problem