Query in ASWE XML code doesn't return data

Hello, since people on the Oracle Metalink site are to lazy to give an answer to this question. I'll try it via this forum. Here we go:
I'm developing wireless applications running on Oracle9i Application Server Wireless Edition. I'v tried to implement the employee sample from Oracle Online Mobile Studio (studio.oraclemobile.com). The sample name is employee.jsp. This sample combines XML code with JSP.
(code at the end of the text)
When I test the sample I get no query results.
When you take the first option for example, (search by dept number) the query result will not be displayed. I think it has something to do with the "executeQuery" line.
rset = stmt.executeQuery("select * from EMP where EMPNO='" + empNum + "'");
After giving the following input (employeenumber) 7369 (which excists in the
database). I get the following errors:
The panama server log returns the following error:
1/14/02 5:19:28 PM NOTIFY : [Thread-13]
core.XSLTransformerImpl.getXSLProc(XSLTransformerImpl.java:120)
Create 10 number of XSL-processor for TINY_HTML
1/14/02 5:19:35 PM NOTIFY : [Thread-15]
adapter.URLAdapter.invoke(URLAdapter.java:240)
URL = http://host/portal/test/employee.jsp
1/14/02 5:19:37 PM NOTIFY : [Thread-17] adapter.URLAdapter.invoke(URLAdapter.java:240)
URL =http://host/portal/test/employee.jsp?choice=empNum
1/14/02 5:19:49 PM NOTIFY : [Thread-19]adapter.URLAdapter.invoke(URLAdapter.java:240)
URL =http://host/portal/test/employee.jsp?&empNum=7369
1/14/02 5:19:50 PM ERROR : [Thread-19]rt.common.Controller.reportServiceInvocationError(Controller.java:707)
Service Invocation Error: Stream closed.
The jserv.log returns the following error:
[14/01/2002 17:19:50:431 CET] Invalid column name
java.sql.SQLException: Invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:4383)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:667)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
at portal.test._employee._jspService(_employee.java:201)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
at oracle.jsp.JspServlet.internalService(JspServlet.java)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:402)
at org.apache.jserv.JServConnection.run(JServConnection.java:260)
at java.lang.Thread.run(Thread.java:479)
Does this have something to do with the encoding of the query result in the select statement? As you can see the variable is in the requeststring (URL = http://host/portal/test/employee.jsp?&empNum=7369)
My database connection works fine (I've also tested the query using SQL plus and the SQL adapter also works).
Is this the right statement?: ("select * from EMP where EMPNO='" + empNum + "'");
I can not do anything with the error in the jserv.log (java.sql.SQLException: Invalid column name).
The columnname EMPNO excists in the example table. The query in SQL plus gives a result.
Can someone give my any suggestions?
Thanks in advance.
Thomas Wesseling, UCC
### Code of employee.jsp ###
<?xml version="1.0" encoding="UTF-8"?>
<SimpleResult>
<SimpleContainer>
<%@ page language="java" import="java.sql.*, java.util.*, java.text.* "%>
<%
//URL variables
String choice = request.getParameter("choice");
String empNum = request.getParameter("empNum");
String lastName = request.getParameter("lastName");
String jobTitle = request.getParameter("jobTitle");
String deptNum = request.getParameter("deptNum");
String notFoundMsg = null; //String for containing varying not found msg
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@172.16.0.51:1521:ora816", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = null;
//**** Start of service - first card ****
if (choice==null && empNum==null && lastName==null &&
jobTitle==null && deptNum==null)
%>
<SimpleMenu title="Employee Search by:">
<SimpleMenuItem target="employee.jsp?choice=empNum">Employee Number</SimpleMenuItem>
<SimpleMenuItem target="employee.jsp?choice=lastName">Name</SimpleMenuItem>
<SimpleMenuItem target="employee.jsp?choice=jobTitle">Job Title</SimpleMenuItem>
<SimpleMenuItem target="employee.jsp?choice=deptNum">Dept Number</SimpleMenuItem>
</SimpleMenu>
<%
//**** SECOND CARD - which search criteria ****
if (choice!=null)
if (choice.equals("empNum") && empNum == null)
%>
<!-- show search by employee number -->
<SimpleForm target="employee.jsp?">
<SimpleFormItem name="empNum" format="*N">Enter Employee Number: </SimpleFormItem>
</SimpleForm>
<%
else if (choice.equals("lastName") && lastName == null)
%>
<!-- show search by last name -->
<SimpleForm target="employee.jsp?">
<SimpleFormItem name="lastName" format="*A">Enter Last Name: </SimpleFormItem>
</SimpleForm>
<%
else if (choice.equals("jobTitle") && jobTitle == null)
%>
<!-- show search by job title -->
<SimpleForm target="employee.jsp?">
<SimpleFormSelect name="jobTitle" title="Enter Job Title:">
<SimpleFormOption value="CLERK">Clerk</SimpleFormOption>
<SimpleFormOption value="SALESMAN">Salesman</SimpleFormOption>
<SimpleFormOption value="MANAGER">Manager</SimpleFormOption>
<SimpleFormOption value="ANALYST">Analyst</SimpleFormOption>
<SimpleFormOption value="PRESIDENT">President</SimpleFormOption>
</SimpleFormSelect>
</SimpleForm>
<%
else if (choice.equals("deptNum") && deptNum == null)
%>
<!-- show search by dept number -->
<SimpleForm target="employee.jsp?">
<SimpleFormItem name="deptNum" format="*N">Enter Dept Number: </SimpleFormItem>
</SimpleForm>
<%
//**** THIRD CARD - query DB based on criteria ****
//**** empNum entered as search criteria ****
if (empNum != null) //empNum is entered as search criteria- NEED TO TEST FOR NON-int
rset = stmt.executeQuery("select * from EMP where EMPNO='" + empNum + "'");
if (rset.next()) //if rset returns data, show data
do {
%>
<%@ include file="showResult.jsp" %>
<%
} while (rset.next());
} //end rset.next() is true
else
notFoundMsg = "Employee Number " + empNum + " Not Found";
%>
<%@ include file="notFound.jsp" %>
<% }
} //end if empNum != null
//**** lastName as search criteria ****
else if (lastName != null)
rset = stmt.executeQuery("select * from EMP where ENAME='" + lastName + "'");
if (rset.next())
do {
%>
<%@ include file="showResult.jsp" %>
<%
} while (rset.next());
} //end rset.next is true
else
notFoundMsg = "Name " + lastName + " Not Found";
%>
<%@ include file="notFound.jsp" %>
<% }
} //end if lastName != null
//**** jobTitle as search criteria ****
else if (jobTitle != null)
rset = stmt.executeQuery("select * from EMP where JOB='" + jobTitle + "'");
if (rset.next())
do {
%>
<%@ include file="showResult.jsp" %>
<%
} while (rset.next());
} //end rset.next is true
else
notFoundMsg = "Job Title " + jobTitle + " Not Found";
%>
<%@ include file="notFound.jsp" %>
<% }
} //end if jobTitle != null
//**** deptNum as search criteria ****
else if (deptNum != null) //deptNum is entered as search criteria
rset = stmt.executeQuery("select * from EMP where DEPTNO='" + deptNum + "'");
if (rset.next())
do {
%>
<%@ include file="showResult.jsp" %>
<%
} while (rset.next());
else
notFoundMsg = "Dept Number " + deptNum + " Not Found";
%>
<%@ include file="notFound.jsp" %>
<% }
} //end if deptNum != null
conn.close();
%>
</SimpleContainer>
</SimpleResult>
### Code of NotFound.jsp ###
<SimpleText>
<SimpleTextItem><%=notFoundMsg%></SimpleTextItem>
<Action label="Search" type="ACCEPT" task="GO" target="employee.jsp?"></Action>
</SimpleText>
### Code of ShowResult.jsp ###
<%
//format date from query
java.sql.Date date = rset.getDate("HIREDATE");
String hireDate = DateFormat.getDateInstance(DateFormat.MEDIUM).format(date);
%>
<SimpleText>
<SimpleTextItem>Emp#: <%=rset.getString("EMPNO")%></SimpleTextItem>
<SimpleTextItem>Name: <%=rset.getString("ENAME")%></SimpleTextItem>
<SimpleTextItem>Job: <%=rset.getString("JOB")%></SimpleTextItem>
<SimpleTextItem>Manager: <%=rset.getString("MGR")%></SimpleTextItem>
<SimpleTextItem>Hire Date: <%=hireDate %></SimpleTextItem>
<SimpleTextItem>Salary: <%=rset.getString("SAL")%></SimpleTextItem>
<SimpleTextItem>Commission: <%=rset.getString("COMM")%></SimpleTextItem>
<SimpleTextItem>Dept#: <%=rset.getString("DEPTNO")%></SimpleTextItem>
<SimpleTextItem>Email: <%=rset.getString("EMAIL")%></SimpleTextItem>
<SimpleTextItem>Phone: <%=rset.getString("PHONE")%></SimpleTextItem>
<Action label="Search" type="SOFT1" task="GO" target="employee.jsp"></Action>
<Action label="Call" type="OPTIONS" task="CALL" number="<%=rset.getString("PHONE")%>"></Action>
</SimpleText>

Is EMPNO really a string field and not a numeric field? Your query is like
... where EMPNO='1949'
and should it perhaps be
... where EMPNO=1949
?

Similar Messages

  • Disco Report doesn't return data for a responsibilty

    Hi Guys,
    We have a report, we have shared with XXX Tax Manager. When we login through XXX Tax Manager, it doesn`t return data. But when we do similer with XXX Payables Manager, report runs fine and return data?
    Can any one help me on this.
    Note: Both Responsibility have access to the Business Area.
    Thanks,
    Nick

    Please find the below query:
    SELECT /*+ NOREWRITE */
    o101613.expense_account_num AS e264170,
    o271954.description AS e271961, o271954.po_number AS e272013,
    o271954.project AS e272033, o271954.task AS e272035,
    o271954.expenditure_type AS e272036, o272183.amount AS e275461,
    (o272183.gl_date) AS e275566, (o272183.invoice_date) AS e275578,
    o272183.invoice_id AS e275580, o275448.invoice_id AS e275581,
    o272183.invoice_number AS e275584,
    o272183.self_assessed_flag AS e275674,
    o272183.ship_to_location_code AS e275681, o272183.state AS e275685,
    o272183.tax_amount AS e275695,
    o272183.tax_jurisdiction_code AS e275698,
    o272183.tax_rate AS e275700, o272183.vendor_name AS e275720,
    o272183.vendor_number AS e275723, (o278494.gl_date) AS e278500,
    o278494.liability_account AS e278501
    FROM apfg_ap_invoices o101612,
    apfg_ap_invoice_distributions o101613,
    apps.ap_invoice_lines_v o271954,
    (SELECT ap.invoice_id, aps.vendor_name, aps.segment1 vendor_number,
    ap.invoice_num invoice_number, ap.invoice_date, ap.gl_date,
    apl.amount amount, zxl.tax_amt tax_amount,
    zxr.percentage_rate tax_rate, zxl.tax_jurisdiction_code,
    apl.ship_to_location_code, zxl.self_assessed_flag,
    hzg.geography_element2_code state, apl.line_number
    FROM ap.ap_suppliers aps,
    ap.ap_invoices_all ap,
    zx.zx_lines zxl,
    apps.ap_invoice_lines_v apl,
    zx.zx_rates_b zxr,
    zx.zx_jurisdictions_tl zxj,
    zx.zx_jurisdictions_b zxb,
    ar.hz_geographies hzg
    WHERE aps.vendor_id = ap.vendor_id
    AND ap.invoice_id = zxl.trx_id
    AND zxl.trx_id = apl.invoice_id
    AND zxl.trx_line_number = apl.line_number
    AND zxl.entity_code = 'AP_INVOICES'
    AND zxl.event_class_code = 'STANDARD INVOICES'
    AND zxl.self_assessed_flag = 'Y'
    --AND zxr.tax_rate_code         = zxl.tax_rate_code
    AND zxr.tax_rate_id = zxl.tax_rate_id
    AND zxj.tax_jurisdiction_id = zxl.tax_jurisdiction_id
    AND zxb.tax_jurisdiction_id = zxj.tax_jurisdiction_id
    AND zxb.zone_geography_id = hzg.geography_id
    AND zxl.tax_amt <> 0
    AND apl.line_type_lookup_code IN
    ('ITEM', 'FREIGHT', 'MISCELLANEOUS')
    AND apl.line_source IN
    ('HEADER MATCH',
    'MANUAL LINE ENTRY',
    'IMPORTED',
    'CHRG ITEM MATCH'
    AND ap.cancelled_date IS NULL
    ORDER BY aps.vendor_name, ap.invoice_num) o272183,
    apps.ap_invoices_v o275448,
    (SELECT xte.source_id_int_1 invoice_id, gcc.code_combination_id,
    xte.transaction_number, xal.accounting_date gl_date,
    gcc.segment1
    || '.'
    || gcc.segment2
    || '.'
    || gcc.segment3
    || '.'
    || segment4
    || '.'
    || segment5
    || '.'
    || segment6
    || '.'
    || segment7 liability_account
    FROM xla.xla_transaction_entities xte,
    xla.xla_ae_headers xah,
    xla.xla_ae_lines xal,
    gl.gl_code_combinations gcc
    WHERE 1 = 1
    AND xte.entity_id = xah.entity_id
    AND xte.application_id = xah.application_id
    AND xah.ae_header_id = xal.ae_header_id
    AND xal.accounting_class_code = 'SELF_ASSESSED_TAX_LIAB'
    AND xal.code_combination_id = gcc.code_combination_id) o278494
    WHERE ( (o101612.invoice_id = o101613.invoice_id(+))
    AND ( o101613.invoice_id = o271954.invoice_id
    AND o101613.invoice_line_number = o271954.line_number
    AND ( o272183.invoice_id = o271954.invoice_id
    AND o272183.line_number = o271954.line_number
    AND (o272183.invoice_id = o275448.invoice_id)
    AND (o278494.invoice_id = o275448.invoice_id)
    AND (o101613.dist_line_type_code IN
    ('ITEM', 'FREIGHT', 'MISCELLANEOUS'')')
    AND (o101612.invoice_number = :"Invoice Number ")
    AND ((o272183.gl_date) <= :"Ending GL DATE")
    AND ((o272183.gl_date) >= :"Beginning GL DATE")
    ORDER BY o271954.project ASC, o272183.invoice_number ASC;
    It does not contain any security profiles, only contains view that might be not returning data.
    thanks

  • SQL statement doesn't return data

    Hi,
    Please I am facing a problem where I took the sql statement from an oracle report and I'm applying it on TOAD 9.0 but it is not returning any data. The thing is that on the application the report returns data but as I checked on the TOAD it showed that some tables have no data.
    How is this possible??
    Do I need to apply some code before I apply my select statement??
    Hope you can help here,
    Thanks in Advance,
    Ashraf

    Hi Ashraf,
    As it should be if a Query in Report is returning data so should the same query return data if used either in Toad or SQL Plus.
    In your report do check if you have any parameters and do this parameters have any default values and are you using the same parameters.
    Also do check the source of the Report which the application is executing and the one from where you are using the Query is same.
    Best Regards
    Arif Khadas

  • Answers report displaying 0s even though SQL returns data from sqlplus

    OBIEE 10.1.3.3.3
    I created a few measures in the RPD and when I run a report against them I get all zeros. I pulled the query from the session log and I ran it from SQL Plus and found that the query generated by BI Server was actually returning data (numbers other than zeros) from the SQL plus prompt.
    However for some reason those numbers are not being displayed in Answers.
    The report is a simple one with name and count as 2 columns. The count column is showing all zeros.
    When I put a filter on the report on the name column, i do get a record without the zero.
    Can someone let me know if I am missing something ?
    Edited by: qqq on Sep 9, 2009 9:50 AM

    I dont think so i understood the problem.
    Can you copy paste the query here so we would understand the problem and exactly whats going wrong?
    You are saying count column.count() of what are you taking??And whats the filter your applying??

  • SQL Query (PL/SQL Function Body returning SQL query) doesn't return any row

    I have a region with the following type:
    SQL Query (PL/SQL Function Body returning SQL query).
    In a search screen the users can enter different numbers, separated by an ENTER.
    I want to check these numbers by replacing the ENTER, which is CHR(13) || CHR(10) I believe, with commas. And then I can use it like this: POD IN (<<text>>).
    It's something like this:
    If (:P30_POD Is Not Null) Then
    v_where := v_where || v_condition || 'POD IN (''''''''||REPLACE(''' || :P30_POD || ''', CHR(13) || CHR(10), '','')||'''''''''')';
    v_condition := ' AND ';
    End If;
    But the query doesn't return any rows.
    I tried to reproduce it in Toad:
    select * from asx_worklistitem
    where
    POD IN (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    ==> This is the query that does't return any rows
    select (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    from dual;
    ==> This returns '541449200000171813','541449206006341366'
    select * from asx_worklistitem
    where pod in ('541449200000171813','541449206006341366');
    ==> and when I copy/paste this in the above query, it does return my rows.
    So why does my first query doesn't work?
    Doe anyone have any idea?
    Kind regards,
    Geert
    Message was edited by:
    Zorry

    Thanks for the help.
    I made it work, but via the following code:
    If (:P30_POD Is Not Null) Then
    v_pods := REPLACE(:P30_POD, CHR(13) || CHR(10));
    v_where := v_where || v_condition || 'POD IN (';
    v_counter := 1;
    WHILE (v_counter < LENGTH(v_pods)) LOOP
    v_pod := SUBSTR(v_pods, v_counter, 18);
    IF (v_counter <> 1) THEN
    v_where := v_where || ',';
    END IF;
    v_where := v_where || '''' || v_pod || '''';
    v_counter := v_counter + 18;
    END LOOP;
    v_where := v_where || ')';
    v_condition := ' AND ';
    End If;But now I want to make an update of all the records that correspond to this search criteria. I can give in a status via a dropdownlist and that I want to update all the records that correspond to one of these POD's with that status.
    For a region you can build an SQL query via PL/SQL, but for a process you only have a PL/SQL block. Is the only way to update all these records by making a loop and make an update for every POD that is specified.
    Because I think this will have a lot of overhead.
    I would like to make something like a multi row update in an updateable report, but I want to specify the status from somewhere else. Is this possible?

  • XI doesn't return an xml file

    Hi,
    I've made a scenario using XI 3.0. I use a file adapter with an inbound synchronous interface to send a xml file to XI. XI consumes a function from CRM using a RFC adapter and an outbound synchronous interface. I've setted "Best Effort" as quality of service too.
    The xml file arrives correctly to CRM and CRM returns the BAPI result to XI correctly too. The problem is XI doesn't return the xml file which it should, that's to say, the xml file sent by XI isn't in the specified target directory (using an inbound synchronous interface and a XI adapter).
    Could someone explain me what happens?
    Thanks in advance,
    Samantha.

    Hi Samantha,
    bad news: File Adapter is always asynchronous, cant get any response. And if you use an interface to send data it is an outbound interface.
    To realize your business logic you must use BPM like
    file (outbound asynchronous) -> BP (abstract asynchronous)
    BP (abstract synchronous) <-> CRM (inbound synchronous)
    BP (abstract asynchronous) -> file (inbound asynchronous)
    Regards,
    Udo

  • Query with subquery containing group clause doesn't return any rows - WHY ?

    Hi,
    My query doesn't return any values :
    select g1.NTRX from gtrx g1
    where exists
    (SELECT b.cfunctrx, b.cpro1trx, b.nmsgitrx, b.nmrc, b.ncrd, b.namtstrx,
    b.dltimtrx, b.nrtrftrx,count(*)
    FROM gtrxacq a, gtrx b
    WHERE a.ntrx = b.ntrx AND a.acq_bus_date = (SELECT curr_bus_date -1
    FROM gmbr
    WHERE nmbr = 0)
    and g1.NTRX=b.NTRX
    GROUP BY b.cfunctrx,
    b.cpro1trx,
    b.nmsgitrx,
    b.nmrc,
    b.ncrd,
    b.namtstrx,
    b.dltimtrx,
    b.nrtrftrx
    HAVING COUNT (*) > 1);
    but such query returns some number of rows :
    SELECT b.cfunctrx, b.cpro1trx, b.nmsgitrx, b.nmrc, b.ncrd, b.namtstrx,
    b.dltimtrx, b.nrtrftrx,count(*)
    FROM gtrxacq a, gtrx b
    WHERE a.ntrx = b.ntrx AND a.acq_bus_date = (SELECT curr_bus_date -1
    FROM gmbr
    WHERE nmbr = 0)
    /*and g1.NTRX=b.NTRX*/
    GROUP BY b.cfunctrx,
    b.cpro1trx,
    b.nmsgitrx,
    b.nmrc,
    b.ncrd,
    b.namtstrx,
    b.dltimtrx,
    b.nrtrftrx
    HAVING COUNT (*) > 1
    AND when i put results from query above into query :
    select g1.NTRX from gtrx g1
    where
    g1.CFUNCTRX= 200 and g1.CPRO1TRX= 000 and g1.NMSGITRX= 1240 and
    g1.NMRC= '000000000000675' and g1.NCRD= 405671**********
    and g1.NAMTSTRX=14.26 and g1.DLTIMTRX=to_date('07/08/2008 15:07:02','MM/DD/YYYY HH24:MI:SS')
    and g1.NRTRFTRX= '000414598393';
    it returns values.
    what is wrong ?
    Best Regards Arkadiusz Masny

    but such query returns some number of rows :
    /*and g1.NTRX=b.NTRX*/Add b.NTRX into group by and recheck.

  • Cannot send XML request message - TREX doesn't return FQDN

    Hello all,
    is there any way to configure TREX, so that it always returns it's FQDN?
    I get the following error message from our SAP XECO (Shop) Java System.
    Full Message Text
    Object with category com.sap.isa.catalog.trex.TrexCatalogServerEngine could not be instantiated. Reason: cannot send XML request to http://saptx3:30305/TREX; reason: saptx3 (Errorcode 7262)
    The problem is, that TREX doesn't return it's FQDN.
    The TREX service as such is correctly configured in TREX Service "nameserver.address", "tcpip://hostname.domain:30301".
    I added the line
    SAPGLOBALHOST=saptx3.domain
    to the sapprofile.ini file. This didn't do the trick, unfortunately.
    Thanks a lot for your advice !
    Best Rgs,
    Thorsten

    HI Thorsten,
    Please ensure that your setting match that of note: 1479923 -  TREX: Queue server missing in KM TREX Monitor
    and also please check the following:
    Also do you have any proxy or firwall between TREX and the portal?
    It can to be that the problem is related to the proxy configuration in
    the Portal. Could you please check if you specified proxy in the
    System Administration -> System Configuration ->Service Configuration->
    Applications (Content Catalog) -> com.sap.portal.ivs.httpservice ->
    Services -> Proxy
    If a proxy server is entered there, you have to enter the TREX host in
    the http - bypass Proxy Servers.
    many thanks
    Orla.

  • CONNECT BY query doesn't return any results...

    Hi All
    I am trying to execute this CONNECT BY query...but it does not return any result.
    Could anyone please suggests what am I doing wrong. Or how should I modify the query to get the results.
    SELECT Distinct dt.DID FROM DEPT dt left outer join EMPLOYEE emp on dt.DID = emp.DID WHERE dt.parentid in (SELECT DEPT.DID FROM DEPT CONNECT BY PRIOR DEPT.DID = DEPT.PARENTID START WITH DEPT.PARENTID in (2000,-2000)) or dt.parentid=2000
    Any help would be really really appreciated.
    Thanks and Regards
    -Josef

    Take the nested query and run it in SQL developer (or SQL Plus) against the database directly. Does it give any results? That query returning no results is the most likely cause of the problem.

  • This code doesn't run

    This code doesn't pass run time. Can you please help me.
    * Copyright (c) 2004 David Flanagan.  All rights reserved.
    * This code is from the book Java Examples in a Nutshell, 3nd Edition.
    * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
    * You may study, use, and modify it for any non-commercial purpose,
    * including teaching and use in open-source projects.
    * You may distribute it non-commercially as long as you retain this notice.
    * For a commercial use license, or to purchase the book,
    * please visit http://www.davidflanagan.com/javaexamples3.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.lang.*;
    * This program is a very simple Web server.  When it receives a HTTP request
    * it sends the request back as the reply.  This can be of interest when
    * you want to see just what a Web client is requesting, or what data is
    * being sent when a form is submitted, for example.
    public class HttpMirror {
        public static void main(String args[]) {
            try {
                // Get the port to listen on
                int port = Integer.parseInt(args[0]);
                // Create a ServerSocket to listen on that port.
                ServerSocket ss = new ServerSocket(port);
                // Now enter an infinite loop, waiting for & handling connections.
                for(;;) {
                    // Wait for a client to connect.  The method will block;
              // when it returns the socket will be connected to the client
                    Socket client = ss.accept();
                    // Get input and output streams to talk to the client
                    BufferedReader in = new BufferedReader(
                          new InputStreamReader(client.getInputStream()));
                    PrintWriter out = new PrintWriter(client.getOutputStream());
                    // Start sending our reply, using the HTTP 1.1 protocol
                    out.print("HTTP/1.1 200 \r\n");        // Version & status code
                    out.print("Content-Type: text/plain\r\n"); // The type of data
              out.print("Connection: close\r\n");        // Will close stream
                    out.print("\r\n");                         // End of headers
                    // Now, read the HTTP request from the client, and send it
                    // right back to the client as part of the body of our
                    // response.  The client doesn't disconnect, so we never get
                    // an EOF.  It does sends an empty line at the end of the
                    // headers, though.  So when we see the empty line, we stop
                    // reading.  This means we don't mirror the contents of POST
                    // requests, for example.  Note that the readLine() method
              // works with Unix, Windows, and Mac line terminators.
                    String line;
                    while((line = in.readLine()) != null) {
                        if (line.length() == 0) break;
                        out.print(line + "\r\n");
                    // Close socket, breaking the connection to the client, and
              // closing the input and output streams
              out.close();     // Flush and close the output stream
              in.close();      // Close the input stream
                    client.close();  // Close the socket itself
                } // Now loop again, waiting for the next connection
            // If anything goes wrong, print an error message
            catch (Exception e) {
                System.err.println(e);
                System.err.println("Usage: java HttpMirror <port>");
       * Copyright (c) 2004 David Flanagan.  All rights reserved.
       * This code is from the book Java Examples in a Nutshell, 3nd Edition.
       * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
       * You may study, use, and modify it for any non-commercial purpose,
       * including teaching and use in open-source projects.
       * You may distribute it non-commercially as long as you retain this notice.
       * For a commercial use license, or to purchase the book,
       * please visit http://www.davidflanagan.com/javaexamples3.
      class MulthServ extends Thread
      Socket s;
      BufferedReader i;
    PrintWriter o;
      public MulthServ(Socket s) throws Exception
      this.s = s;
      this.i = new BufferedReader(new
      InputStreamReader(s.getInputStream()));
      this.o = new PrintWriter(s.getOutputStream(), true);
      public void run()
      try {
      o.close();
      i.close();
      s.close();
      catch(Exception e) {}
    }

    just compiled and ran it on my machine. runs fine, just as the comments say it should.
    i ran it using this java command:
    F:\Software\Java\Forum>java HttpMirror 9999which starts the server listening for http requests on port 9999.
    i entered this url into my browser:
    http://localhost:9999/?first=foo&last=bari got this response back in my browser, just as the comments said i would:
    GET /?first=foo&last=bar HTTP/1.1
    Host: localhost:9999
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alivewhat does "not running" look like to you? maybe you don't know what http is all about.
    %

  • Code Doesn't Run - Not Sure Why.....

    Hello Everyone:
    I have an Oracle “program” (I wouldn’t call it a program, but just some code for a one off move of data). I use TORA as the interface for Oracle. I do not have a copy of TOAD. But for some reason, when I run this code, it takes all of 0.003 seconds and doesn’t actually move any data. Below is a copy of the code. If I take the query being used in the cursor, it does return data and takes about 1.5 seconds to execute, but when trying to run this code, it takes 1/10th of that time, so I am doing something wrong but I can’t figure out what.
    I also tried to copy this code into SQLPlus, but that also does not run. Can anyone spot what I am doing wrong? I am not sure if it is my environment and how I am trying to run this or the code itself is flawed.
    DECLARE
    -- Local Variables
    l_gm_master_label VARCHAR2(20);
    l_active_flag VARCHAR2(1);
    l_currdate DATE;
    l_comp_id VARCHAR2(2);
    l_site_id VARCHAR2(2);
    l_gm_master_id NUMBER;
    c_serial_number VARCHAR(40);
    c_creation_date DATE;
    c_interface_date DATE;
    c_ebiz_sku_no NUMBER;
    c_ebiz_ord_no NUMBER;
    -- Cursor
    CURSOR serial_number_data IS
    SELECT
    S.serial_number,
    S.creation_date,
    S.interface_date,
    S.ebiz_sku_no,
    O.ebiz_ord_no
    FROM
    dmlogic.trn_rm_serial_number S
    INNER JOIN ebiznet.trn_ordhead O ON S.ord_no = O.ord_no;
    BEGIN
    DBMS_OUTPUT.ENABLE(2000);
    -- Set default values
    l_gm_master_label := 'DMLogic001';
    l_active_flag := 'N';
    l_currdate := SYSDATE;
    l_comp_id := 'XE';
    l_site_id := 'OHIO';
    l_gm_master_id := 0;
    -- Get the next value
    SELECT
    trn_gm_master_seq.NEXTVAL
    INTO
    l_gm_master_id
    FROM
    dual;
    -- Insert generic Gray Number master record that will be joined to all the DMLogic serial numbers
    INSERT INTO trn_gm_master
    (gm_master_id,
    gm_master_label,
    active_flag,
    currdate,
    comp_id,
    site_id)
    VALUES
    (l_gm_master_id,
    l_gm_master_label,
    l_active_flag,
    l_currdate,
    l_comp_id,
    l_site_id);
    -- Open the cursor
    OPEN serial_number_data;
    LOOP
    -- Fetch the values
    FETCH serial_number_data INTO c_serial_number, c_creation_date, c_interface_date, c_ebiz_sku_no, c_ebiz_ord_no;
    EXIT WHEN serial_number_data%NOTFOUND;
    INSERT INTO ebiznet.trn_gm_serial_number
    (gm_serial_number_id,
    gm_master_id,
    gm_serial_number,
    received_by,
    received_date,
    picked_by,
    picked_date,
    ebiz_sku_no,
    comp_id,
    site_id,
    ebiz_ord_no,
    interface_date)
    VALUES
    (trn_gm_serial_number_seq.NEXTVAL,
    l_gm_master_id,
    c_serial_number,
    1,
    c_creation_date,
    1,
    c_creation_date,
    c_ebiz_sku_no,
    l_comp_id,
    l_site_id,
    c_ebiz_ord_no,
    c_interface_date);
    EXIT WHEN serial_number_data%NOTFOUND;
    END LOOP;
    CLOSE serial_number_data;
    -- Commit the changes
    COMMIT;
    -- Rollback if an error has occured
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    DBMS_OUTPUT.PUT_LINE('ERROR HAS OCCURED');
    END;

    When running it in SQL Plus, remember to put the / at the end of the script;
    Also, remember to print out your error in your exception handler;
    DECLARE
      -- Local Variables
      l_gm_master_label VARCHAR2(20);
      l_active_flag VARCHAR2(1);
      l_currdate DATE;
      l_comp_id VARCHAR2(2);
      l_site_id VARCHAR2(2);
      l_gm_master_id NUMBER;
      c_serial_number VARCHAR(40);
      c_creation_date DATE;
      c_interface_date DATE;
      c_ebiz_sku_no NUMBER;
      c_ebiz_ord_no NUMBER;
      -- Cursor
      CURSOR serial_number_data IS
        SELECT
          S.serial_number,
          S.creation_date,
          S.interface_date,
          S.ebiz_sku_no,
          O.ebiz_ord_no
        FROM
          dmlogic.trn_rm_serial_number S
        INNER JOIN ebiznet.trn_ordhead O ON S.ord_no = O.ord_no;
    BEGIN
      DBMS_OUTPUT.ENABLE(2000);
      -- Set default values
      l_gm_master_label := 'DMLogic001';
      l_active_flag := 'N';
      l_currdate := SYSDATE;
      l_comp_id := 'XE';
      l_site_id := 'OHIO';
      l_gm_master_id := 0;
      -- Get the next value
      SELECT trn_gm_master_seq.NEXTVAL
      INTO   l_gm_master_id
      FROM   dual;
      -- Insert generic Gray Number master record that will be joined to all the DMLogic serial numbers
      INSERT INTO trn_gm_master
                (gm_master_id,
                gm_master_label,
                active_flag,
                currdate,
                comp_id,
                site_id)
                VALUES
                (l_gm_master_id,
                l_gm_master_label,
                l_active_flag,
                l_currdate,
                l_comp_id,
                l_site_id);
      -- Open the cursor
      OPEN serial_number_data;
      LOOP
        -- Fetch the values
        FETCH serial_number_data INTO c_serial_number
                                     ,c_creation_date
                                     ,c_interface_date
                                     ,c_ebiz_sku_no
                                     ,c_ebiz_ord_no;
        EXIT WHEN serial_number_data%NOTFOUND;
        INSERT INTO ebiznet.trn_gm_serial_number
                    (gm_serial_number_id,
                    gm_master_id,
                    gm_serial_number,
                    received_by,
                    received_date,
                    picked_by,
                    picked_date,
                    ebiz_sku_no,
                    comp_id,
                    site_id,
                    ebiz_ord_no,
                    interface_date)
                    VALUES
                    (trn_gm_serial_number_seq.NEXTVAL,
                    l_gm_master_id,
                    c_serial_number,
                    1,
                    c_creation_date,
                    1,
                    c_creation_date,
                    c_ebiz_sku_no,
                    l_comp_id,
                    l_site_id,
                    c_ebiz_ord_no,
                    c_interface_date);
        EXIT WHEN serial_number_data%NOTFOUND;
      END LOOP;
      CLOSE serial_number_data;
      -- Commit the changes
      COMMIT;
      -- Rollback if an error has occured
      EXCEPTION
        WHEN OTHERS THEN
        ROLLBACK;
        DBMS_OUTPUT.PUT_LINE('ERROR HAS OCCURED ' || sqlerrm);
    END;
    /

  • Storing the SQL Query results as XML

    Hi All,
    I have a proc to select all the data from emp table and insert into another table. For some reason it inserts only one column and one record.
    I don't have any row limit or skip ...
    CREATE OR REPLACE procedure Convert_Data_Into_XML1
    as
    -- Var Declartion
    qryCtx DBMS_XMLGEN.ctxHandle;
    result CLOB;
    BEGIN
    qryCtx := dbms_xmlgen.newContext('SELECT * from emp');
    -- set the row header to be EMPLOYEE
    DBMS_XMLGEN.setRowTag(qryCtx, 'Employee-ROW');
    DBMS_XMLGEN.setRowsetTag(qryCtx, 'Employee-rowset');
    LOOP
    -- now get the result
    result := DBMS_XMLGEN.getXML(qryCtx);
    DBMS_OUTPUT.PUT_LINE ('In the Loop');
    EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
    INSERT INTO temp_clob_tab VALUES (result);
    END LOOP;
    COMMIT;
    --close context
    DBMS_XMLGEN.closeContext(qryCtx);
    exception
    when others then
    dbms_output.put_line(TO_CHAR(sqlerrm));
    END;
    Basically I got this sample proc from Oracle website. As per the website I should be able to store all the records from emp table.
    How can I debug this.
    Here is the output from SQLPLUS&gt;
    SQL&gt; select result from temp_clob_tab;
    RESULT
    &lt;?xml version="1.0"?&gt;
    &lt;Employee-rowset&gt;
    &lt;Employee-ROW&gt;
    &lt;EMPNO&gt;7369&lt;/EMPNO&gt;
    &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
    Thanks in advance
    Siva

    I am able to convert the SQL query output and I am able to store it in a XMLTYPE column.
    But the code doesn't work when I took the same code and try to Implement inside a Trigger. The reason I am doing this is, when there is an update or delete, I want to store the whole record as a XMLTYPE doc (before and After). But the code compiles fine, but when I tried to update a record it gives error.
    CREATE OR REPLACE TRIGGER INS_UPDDEV_EMP3_F
    BEFORE UPDATE OR DELETE ON EMP
    FOR EACH ROW
    DECLARE
    V_DBUSER VARCHAR2(50);
    V_CHANGETYPE VARCHAR2(20) := 'INSERT' ;
    QRYCTX DBMS_XMLGEN.CTXHANDLE ;
    OLDVALUE XMLTYPE;
    NEWVALUE XMLTYPE;
    BEGIN
    IF :OLD.EMPNO &lt;&gt; :NEW.EMPNO or DELETING then
    ---------- old Value
    QRYCTX := DBMS_XMLGEN.NEWCONTEXT ('SELECT :OLD.EMPNO, :OLD.ENAME, :OLD.JOB, :OLD.MGR, :OLD.HIREDATE, :OLD.SAL, :OLD.COMM, :OLD.DEPTNO FROM EMP WHERE EMPNO=:OLD.EMPNO ');
    DBMS_XMLGEN.SETROWTAG (QRYCTX, 'DEPTROW');
    DBMS_XMLGEN.SETROWSETTAG(QRYCTX, 'DEPTSET');
    OLDVALUE := XMLTYPE(DBMS_XMLGEN.GETXML(QRYCTX));
    ------------------------- new Value
    QRYCTX := DBMS_XMLGEN.NEWCONTEXT ('Select * WHERE EMPNO=:NEW.EMPNO '); -- WHERE :OLD.EMPNO
         DBMS_XMLGEN.SETROWTAG (QRYCTX, 'DEPTROW');
    DBMS_XMLGEN.SETROWSETTAG(QRYCTX, 'DEPTSET');
    NEWVALUE := XMLTYPE(DBMS_XMLGEN.GETXML(QRYCTX));
    V_CHANGETYPE := 'UPDATE' ;
    INSERT INTO ADM_RECAUDITHISTORY VALUES ('table emp', 'fIELD all', OLDVALUE, OLDVALUE,
    V_CHANGETYPE , SYSDATE, 'TIGER TRIG');
    commit;
    END IF;
    END;
    I am getting the following error while updating the record.
    &gt;&gt;&gt;&gt;
    ERROR at line 1:
    ORA-19206: Invalid value for query or REF CURSOR parameter
    ORA-06512: at "SYS.DBMS_XMLGEN", line 83
    ORA-06512: at "SCOTT.INS_UPDDEV_EMP3_F", line 13
    ORA-04088: error during execution of trigger 'SCOTT.INS_UPDDEV_EMP3_F'
    &gt;&gt;&gt;&gt;&gt;
    Is anyone knows why I am getting this error.
    Thanks
    Siva

  • Need to return data from a query in different ways - Please help

    We are using 10g R2
    I have a proc as follows that has a query with over 100 values in the select clause:
    proc one( input param1, input_param2,.... output_cursor )
    as
    begin
    open cursor for
    select ...about 100 values with most of them being calculated
    from table1, view 1, table2, table 3, view 2 ...
    where ....
    and table1.col1 = input param1
    and table1.col2 = input param 2
    and view1.col5 = input param5...
    end;
    I need to return the data that comes from the above query in different formats, columns for a report would be different from columns for screen A and different for screen B. I need only certain columns for a report and different set of columns for another screen. I have wrapper procs that get different input params. From the wrapper procs I intend to call the above proc but would like only selected values.
    How can I accomplish this? Since my main goal is to select different columns for each wrapper I was thinking of insert the data from the above proc into global temp table and selecting whatever columns and order I want from the wrappers.
    What do you think? Any other solutions?
    Thanks
    Edited by: user565033 on Jan 21, 2013 7:50 PM

    You need to clearly separate roles and responsibilities. The PL/SQL code that creates and supplies a cursor handle is server code tasked to supply data. The code that makes the call for server data, is responsible for formatting and rendering that data.
    Thus moving data formatting into the server code needs to be question. Simple example. Cursor does not return invoice date as a date - but formats it into a string using TO_CHAR().
    This works for client1 - as that is the date format expected. However, client2 has different International settings and specifies a different date format. Invoice date, formatted into a string by the server, now renders in the wrong format on client2.
    Server code should not be concerned with rendering and formatting of data send to a client.
    As for the idea to use a global temp table is ..., well to put it nicely, it smells. Badly.
    The single most expensive operation on a database platform is I/O. And now you want to read server data and write it to temporary storage, and the read data from temporary storage to return to the client? What on earth for!? Why purposefully increase the size of the I/O workload? Why decrease performance and undermine scalability?
    Provide a proper abstraction interface to the client. Enable it to specify (as simplistically as possible) what it wants ito data. There are a number of ways to design and implement this in PL/SQL. Simplistic example:
    SQL> create or replace package Employees as
      2 
      3          EMP_FULL_DETAILS        constant integer := 1;
      4          EMP_BASIC_DETAILS       constant integer := 2;
      5 
      6          procedure GetEmpByID(
      7                  cur out sys_refcursor,
      8                  empID in emp.empno%type,
      9                  template in integer default EMP_BASIC_DETAILS
    10          );
    11 
    12          procedure GetEmpByName(
    13                  cur out sys_refcursor,
    14                  empName in emp.ename%type,
    15                  template in integer default EMP_BASIC_DETAILS
    16          );
    17  end;
    18  /
    Package created.
    SQL>
    SQL> create or replace package body Employees as
      2 
      3  type TArray is table of varchar2(32767);
      4 
      5  TemplateList       constant TArray :=
      6          new TArray(
      7                  'EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO ',
      8                  'EMPNO, ENAME, JOB '
      9          );
    10 
    11  procedure GetEmpByID(
    12          cur out sys_refcursor,
    13          empID in emp.empno%type,
    14          template in integer default EMP_BASIC_DETAILS
    15  ) is
    16          sqlSelect       varchar2(32767);
    17  begin
    18          sqlSelect :=
    19                  'select '||TemplateList(template)||
    20                  'from emp where empno = :empID';
    21 
    22          open cur for sqlSelect using empID;
    23  end;
    24 
    25  procedure GetEmpByName(
    26          cur out sys_refcursor,
    27          empName in emp.ename%type,
    28          template in integer default EMP_BASIC_DETAILS
    29  ) is
    30          sqlSelect       varchar2(32767);
    31  begin
    32          sqlSelect :=
    33                  'select '||TemplateList(template)||
    34                  'from emp where ename like :empName';
    35          open cur for sqlSelect using empName;
    36  end;
    37 
    38 
    39  end;
    40  /
    Package body created.
    SQL>
    SQL> var c refcursor
    SQL>
    SQL> exec Employees.GetEmpByID( :c, 7499 );
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB
          7499 ALLEN      SALESMAN
    SQL>
    SQL> exec Employees.GetEmpByName( :c, 'A%', Employees.EMP_FULL_DETAILS );
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB               MGR HIREDATE                   SAL       COMM     DEPTNO
          7499 ALLEN      SALESMAN         7698 1981/02/20 00:00:00       1600        300         30
          7876 ADAMS      CLERK            7788 1987/05/23 00:00:00       1100                    20
    SQL>

  • ISF/javascript code doesn't work for non-English RequestCenter proile

    ISF/javascript code doesn't work for non-English RequestCenter proile
    Hello,
    I am not sure if i posted the same question before also. We have some customers who have set thier language profile in newScale requestcenter to French. However, all the javascript customizations configured on the service forms do not function for 'French' as a Langauge preference. Has anyone encountered the similar issue before and can anyone please suggest a solution for it?
    Thanks,
    Mihir

    we had a similar issue a while back where the Approval button was not working in Spanish, needed a fix from nS for it
    The way to fix this would be to locate the language XML file, override the French caption with Submit and on onLoad write a global JS that would write the button label again (not so sure about this)
    But really its an major defect and they should be able to fix it.

  • Active Directory -- returning data through ldap query

    I am using the tcUtilLDAPController to connect to AD and wish to run a query however only 1000 records are getting returned, how do i get the next set of 1000 records?
    ---------Code--------
    ldapController = ldapUtil.connectLDAP(adServerAddress, adServerRootContext, adServerAdminFQDN, adServerAdminPwd, adServerUseSSL);
    ldapController.searchResult("", "(objectclass=user)");

    You either reconfigure your AD server to have a higher max returned entries or you start using paged searches.
    Code for paged searches using JNDI: http://iamreflections.blogspot.com/2010/10/adldap-reconciliation-using-paging.html
    It may also be possible to get tcUtilLDAPController to do paged searches.
    Best regards
    /Martin

Maybe you are looking for

  • PDFMaker ファイルが見つかりません

    Microsoft Office WordやMicrosoft Office Excelのファイルを AcrobatでPDFに変換しようとしました. が.「PDFMaker ファイルが見つかりません.インストーラを修復モードで実行しますか?」というエラーを吐いて変換できません. テキストファイル.画像などのMicrosoft Office シリーズ以外のファイルはちゃんと変換できますのに. 今Adobe Acrobat 8 Professionalを使っていますが.この前のAdobe Acrob

  • Dual screen mac mini 2015

    bonjour a tous, je voudrais acheter un mac mini de 2015. je voudrais brancher en thunderbolt 2 un écran 21/9 de 3440x1440p, est ce possible ? et en meme temps une télévision sur le port HDMI en 1080p ? merci pour vos réponses et bonne journée a tous.

  • Credit Memo User Exit

    Hi Guru's, In transaction VA01 when we try to create memo by clicking on "create with reference" and giving the invoice no. there, it should copy all the line items of the invoice to that particular credit memo but it is not doing in my client but in

  • User Profile Services - need-full-object

    During a Delta import over the past 5-6 days there has been one discovery error with a "need-full-object" as the error code. Now when looking at the user profile in sharepoint I see the user and all custom fields. However it is flagging daily.  We do

  • Super Drive not reading discs...

    My eMac is ejecting the majority of dics (both CD's & DVD's) after inserted even the system discs that came with the computer. The discs are not damaged in anyway. Any suggestions??