Need help on order by in PL/SQL
Hi all,
I know this problem would have occurred a lot of times before, but me being a beginner want to know all the possible solution for this one.Now I am having a procedure in which I am declaring a cursor to select rows from a table
create or replace procedure call_me(sortstring IN Varchar2(200))
IS
cursor cur is
select * from EMP order by (sortstring);
BEGIN
for rec in cur
Loop
DBMS_OUTPUT.PUT_LINE(cur.EMPNAME)
END LOOP;
END;
Assume the EMP table has
EMPID,EMPNAME,EMPCITY,EMPDEPT as its fields
I am calling the procedure like
exec procedure_call('EMPCITY,EMPDEPT')
but I get an unsorted output, worse still
exec procedure_call('EMPCITY')
itself is not working.If I hard-code the order by columns in the query it is working, but when I pass it as argument it is not working.Please help me resolve this issue.
In your case,
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.33
satyaki>
satyaki>select * from emp order by '&str';
Enter value for str: empno
old 1: select * from emp order by '&str'
new 1: select * from emp order by 'empno'
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7499 Travor SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
13 rows selected.
Elapsed: 00:00:01.00
satyaki>In our case,
satyaki>select * from emp order by &str;
Enter value for str: empno
old 1: select * from emp order by &str
new 1: select * from emp order by empno
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 Travor SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
13 rows selected.
Elapsed: 00:00:00.31
satyaki>/
Enter value for str: empno,job
old 1: select * from emp order by &str
new 1: select * from emp order by empno,job
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 Travor SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
13 rows selected.
Elapsed: 00:00:00.18
satyaki>So, capitalizing this ->
satyaki>
satyaki>declare
2 cursor cur
3 is
4 select *
5 from EMP
6 order by &sortstring;
7
8 rec cur%rowtype;
9 begin
10 for rec in cur
11 Loop
12 DBMS_OUTPUT.PUT_LINE(rec.ENAME);
13 END LOOP;
14 END;
15 /
Enter value for sortstring: empno,job
old 6: order by &sortstring;
new 6: order by empno,job;
Travor
WARD
JONES
MARTIN
BLAKE
SOURAV
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.84
satyaki>Got my point?
Regards.
Satyaki De.
Similar Messages
-
I had to put my computer by together without migration or time machine I NEED help with order of the files?
Hi, where are these other files exactly?
-
Need Help in Splitting a String Using SQL QUERY
Hi,
I need help in splitting a string using a SQL Query:
String IS:
AFTER PAINT.ACOUSTICAL.1..9'' MEMBRAIN'I would like to seperate this string into multiple lines using the delimeter .(dot)
Sample Output should look like:
SNO STRING
1 AFTER PAINT
2 ACOUSTICAL
3 1
4
5 9" MEMBRAIN
{code}
FYI i am using Oracle 9.2There's this as well:
with x as ( --generating sample data:
select 'AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN' str from dual union all
select 'BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN' str from dual)
select str,
row_number() over (partition by str order by rownum) s_no,
cast(dbms_xmlgen.convert(t.column_value.extract('//text()').getstringval(),1) as varchar2(100)) res
from x,
table(xmlsequence(xmltype('<x><x>' || replace(str,'.','</x><x>') || '</x></x>').extract('//x/*'))) t;
STR S_NO RES
AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN 1 AFTER PAINT
AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN 2 ACOUSTICAL
AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN 3 1
AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN 4
AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN 5 9" MEMBRAIN
BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN 1 BEFORE PAINT
BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN 2 ELECTRIC
BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN 3 2
BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN 4
BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN 5 45 caliber MEMBRAIN
{code} -
Need help in order to buy Toshiba notebook from Toshiba directly
Good morning.
I want to buy a laptop in http://www.toshibadirect.com/ and chose the product,
I have credit card.
I have a family who will receive the laptop
What I want is someone advise me on the east or purchase I need help to complete the purchase.
Personal toshiba to help me to complete this purchase. .
Thanks
Note:
I live in Peru.
I have some queries about the product.Hi
First of all you should know that this is a user to user forum. So you will not find any people from Toshiba here.
Secondly I have checked the page which you have posted in the posting and find this phone number. Call 800-316-0920 for shopping assistance.
Otherwise I recommend searching for some online dealers who provide the notebook which you want to buy.
Good luck -
Need help with ORDER BY clause
Hey,
I have a table:
Name: Year:
Eagle 2000
Tiger 2001
Eagle 2002
Lion 2006
Lion 1999
Fox 1991
Lion 1995
I need a query which will return in such order:
Name: Year: Position:
Eagle 2000 1
Eagle 2002 2
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
So, of course to get Name and Year in this order is quite easy:
select Name, Year from Animals order by Name, Year;
but how about Position, is there a way to count it with SQL?
any help is welcome,
SilvestrasSQL> with rt as
2 (select 'Eagle' nm, 2000 yr from dual union all
3 select 'Tiger', 2001 from dual union all
4 select 'eagle', 2002 from dual union all
5 select 'Lion', 2006 from dual union all
6 select 'Lion', 1999 from dual union all
7 select 'Fox', 1991 from dual union all
8 select 'Lion', 1995 from dual)
9 select nm,yr,row_number() over(partition by (nm) order by nm,yr) position from rt;
NM YR POSITION
Eagle 2000 1
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
eagle 2002 1
7 rows selected.
SQL> with rt as
2 (select 'Eagle' nm, 2000 yr from dual union all
3 select 'Tiger', 2001 from dual union all
4 select 'eagle', 2002 from dual union all
5 select 'Lion', 2006 from dual union all
6 select 'Lion', 1999 from dual union all
7 select 'Fox', 1991 from dual union all
8 select 'Lion', 1995 from dual)
9 select nm,yr,row_number() over(partition by lower(nm) order by nm,yr) position from rt;
NM YR POSITION
Eagle 2000 1
eagle 2002 2
Fox 1991 1
Lion 1995 1
Lion 1999 2
Lion 2006 3
Tiger 2001 1
7 rows selected.
SQL> -
Need help on how to code this SQL statement! (one key has leading zeros)
Good day, everyone!
First of all, I apologize if this isn't the best forum. I thought of putting it in the SAP Oracle database forum, but the messages there seemed to be geared outside of ABAP SELECTs and programming. Here's my question:
I would like to join the tables FMIFIIT and AUFK. The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
The problem I'm having is this: All of the values in AUFNR are preceeded by two zeros. For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'. Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
Unfortunately, I don't have a lot of experience coding SQL, so I'm not sure how to resolve this.
Please help! As always, I will award points to ALL helpful responses!
Thanks!!
Dave>
Dave Packard wrote:
> Good day, everyone!
> I would like to join the tables FMIFIIT and AUFK. The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
>
> The problem I'm having is this: All of the values in AUFNR are preceeded by two zeros. For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'. Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
> Dave
You can't do a join like this in SAP's open SQL. You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a) modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc.
Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round).
I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data. -
Need help converting Oracle PIVOT script to SQL Server
I hope it is not inappropriate to ask for SQL Server question in a .NET forum. I can not understand SQl 2k5+ syntax for pivoting. I am pivoting on company name and storenbr in the following. Thanks for any help.
WITH dummydata AS
SELECT 'Store1' AS storenbr, 2 AS period, 1 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 16 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store1' AS storenbr, 2 AS period, 1 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 87 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store1' AS storenbr, 2 AS period, 2 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 26 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store1' AS storenbr, 2 AS period, 2 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 97 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store2' AS storenbr, 2 AS period, 1 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 16 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store2' AS storenbr, 2 AS period, 1 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 87 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store2' AS storenbr, 2 AS period, 2 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 26 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store2' AS storenbr, 2 AS period, 2 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 97 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store3' AS storenbr, 2 AS period, 1 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 18 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store3' AS storenbr, 2 AS period, 1 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 89 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store3' AS storenbr, 2 AS period, 2 AS weeknbr, '40' AS PLU, 'tomato' as descrip, 28 AS used, 100 AS wasted from dual UNION ALL
SELECT 'Store3' AS storenbr, 2 AS period, 2 AS weeknbr, '50' AS PLU, 'bacon' as descrip, 99 AS used, 100 AS wasted from dual
, store_details as
SELECT 'Store3' AS storenbr, 'D-Bingham' as districtname, 'R-15 James' as regionname, 'C-Atlantic' as companyname from dual UNION ALL
SELECT 'Store2' AS storenbr, 'D-Dunley' as districtname, 'R-15 James' as regionname, 'C-Atlantic' as companyname from dual UNION ALL
SELECT 'Store1' AS storenbr, 'D-Murdoc' as districtname, 'R-16 Reynolds' as regionname, 'C-Soutn' as companyname from dual
, pivoted as
select storenbr
, plu
, max(descrip) as Descrip
, max(decode(dd.weeknbr, 1, used , 0)) as Week1used
, max(decode(dd.weeknbr, 1, wasted , 0)) as Week1wasted
, max(decode(dd.weeknbr, 2, used , 0)) as Week2used
, max(decode(dd.weeknbr, 2, wasted , 0)) as Week2wasted
, max(decode(dd.weeknbr, 3, used , 0)) as Week3used
, max(decode(dd.weeknbr, 3, wasted , 0)) as Week3wasted
, max(decode(dd.weeknbr, 4, used , 0)) as Week4used
, max(decode(dd.weeknbr, 4, wasted , 0)) as Week4wasted
, max(decode(dd.weeknbr, 5, used , 0)) as Week5used
, max(decode(dd.weeknbr, 5, wasted , 0)) as Week5wasted
from dummydata dd
group by storenbr, plu
order by storenbr, plu
select decode(grouping(stores.storenbr), 0, stores.storenbr, decode(grouping(districtname), 0, districtname, decode(grouping(regionname), 0, regionname, decode(grouping(companyname), 0, companyname, 'GRAND')))) as storenbr
, decode(grouping(descrip), 0, descrip, 'TOTAL') as descrip
--== I substited Description for clarity
, sum(Week1used) as Week1used
, sum(Week1wasted) as Week1wasted
, sum(Week2used) as Week2used
, sum(Week2wasted) as Week2wasted
, sum(Week3used) as Week3used
, sum(Week3wasted) as Week3wasted
, sum(Week4used) as Week4used
, sum(Week4wasted) as Week4wasted
, sum(Week5used) as Week5used
, sum(Week5wasted) as Week5wasted
, companyname
from pivoted pvt
inner join store_details stores on pvt.storenbr = stores.storenbr
group by companyname
, rollup ( regionname
, districtname
, stores.storenbr
, descrip
;New output:
STORENBR DESCRIP WEEK1USED WEEK1WASTED WEEK2USED WEEK2WASTED WEEK3USED WEEK3WASTED WEEK4USED WEEK4WASTED WEEK5USED WEEK5WASTED COMPANYNAME
Store1 bacon 87 100 97 100 0 0 0 0 0 0 C-Soutn
Store1 tomato 16 100 26 100 0 0 0 0 0 0 C-Soutn
Store1 TOTAL 103 200 123 200 0 0 0 0 0 0 C-Soutn
D-Murdoc TOTAL 103 200 123 200 0 0 0 0 0 0 C-Soutn
R-16 Reynolds TOTAL 103 200 123 200 0 0 0 0 0 0 C-Soutn
C-Soutn TOTAL 103 200 123 200 0 0 0 0 0 0 C-Soutn
Store2 bacon 87 100 97 100 0 0 0 0 0 0 C-Atlantic
Store2 tomato 16 100 26 100 0 0 0 0 0 0 C-Atlantic
Store2 TOTAL 103 200 123 200 0 0 0 0 0 0 C-Atlantic
D-Dunley TOTAL 103 200 123 200 0 0 0 0 0 0 C-Atlantic
Store3 bacon 89 100 99 100 0 0 0 0 0 0 C-Atlantic
Store3 tomato 18 100 28 100 0 0 0 0 0 0 C-Atlantic
Store3 TOTAL 107 200 127 200 0 0 0 0 0 0 C-Atlantic
D-Bingham TOTAL 107 200 127 200 0 0 0 0 0 0 C-Atlantic
R-15 James TOTAL 210 400 250 400 0 0 0 0 0 0 C-Atlantic
C-Atlantic TOTAL 210 400 250 400 0 0 0 0 0 0 C-AtlanticArthurZ thank you, it was just a minor bug:
(DT_DATE)(SUBSTRING("20001211", 1,4) + "-" + SUBSTRING("20001211",
5,2) + "-" + SUBSTRING("20001211",
7,2) )
Working fine now :) thanks!
Sorry if I caused it, but glad you found it
Arthur
MyBlog
Twitter -
Need help in storing XML data in SQL server using EJB
Hi all...
i have one XML file and i need to store the data of XML in one of the table of SQL server ..i want to do this using EJB..
like this
Example :
Data i XML :
========
<Employee>
<Details>
<empid> 101 </empid>
<name> Ajitha </name>
</Details>
</Employee>
Table i have Created in SQL SERVER:
==============================
Empid || name
Final output should be :
=================
Empid || name
101 || AjithaHI,
Please check your settings as per following.
Goto T code> DC20>Define data carrier type "server, front end"---> Then check the setting as per below
Type Description Path Online
PC give descriptio maintain path Tick
Then Select this entry and click on " Define servers and files or folders"--->Then check the setting as per below
Data Carrier Type Description
DEFAULT PC default
Then Select this entry and click on "Identify front computer"--> Then check the setting as per below
Data Carrrier Type Net. address Description
Default PC DEFAULT Default for local PC
I have explained above so that u can co relate your settings with above..
I hope this will help you.
Thanks
Yogesh -
Need help in resolving the below error - SQL statement to execute cannot be
Here is my CO as below , which creates a callable statement.
try {
OAApplicationModule oaapplicationmodule = pageContext.getApplicationModule(webBean);
OADBTransactionImpl t = (OADBTransactionImpl)oaapplicationmodule.getOADBTransaction();
OracleCallableStatement proc = (OracleCallableStatement)t.createCallableStatement(lquery, -1);
proc.execute();
t.commit();
catch(SQLException sqlexception)
throw OAException.wrapperException(sqlexception);
After running the page , getting the below error ... ( Please find the below error stack )
I reffered the developement guide but did not get helpful things.
Please provide me any clues on the same.
Regards Raghu
-- Error Stack ---------------------------------------------------------
Error Page
Exception Details.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27123: SQL error during call statement preparation. Statement: null
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2637)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: SQL statement to execute cannot be empty or null
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
java.sql.SQLException: SQL statement to execute cannot be empty or null
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
Edited by: Raghu on Sep 14, 2010 2:58 AMcheck the code pasted by me again
Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
Connection conn = oaapplicationmodule.getOADBTransaction().getJdbcConnection(); //Right oneThanks
--Anil -
[10g] Need help with order by clause in hierarchical query
I have the following sample data:
CREATE TABLE bill_test1
( parent_part CHAR(25)
, child_part CHAR(25)
, line_nbr NUMBER(5)
, qty_per NUMBER(9,5)
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-10',100,1);
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-20',200,2);
INSERT INTO bill_test1 VALUES ('ABC-1','ABC-30',300,3);
INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-1',401,10);
INSERT INTO bill_test1 VALUES ('ABC-1','HARDWARE-2',402,5);
INSERT INTO bill_test1 VALUES ('ABC-10','ABC-155',100,2);
INSERT INTO bill_test1 VALUES ('ABC-10','HARDWARE-1',200,1);
INSERT INTO bill_test1 VALUES ('ABC-155','RAW-2',100,4.8);
INSERT INTO bill_test1 VALUES ('ABC-155','HARDWARE-3',200,3);
INSERT INTO bill_test1 VALUES ('ABC-20','RAW-1',100,10.2);
INSERT INTO bill_test1 VALUES ('ABC-30','RAW-3',100,3);And the query below gives me exactly what I want, in the order I want it. However, I am wondering if there is a way to get this order without creating the SEQ column, since I don't need it in my results
SELECT part_nbr
, parent_part
, child_part
FROM (
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
, dual
CONNECT BY parent_part = PRIOR child_part
WHERE part_nbr = 'ABC-1'
ORDER BY seq
Results of above query, except with SEQ included in SELECT (just to show what I'm sorting off of):
PART_NBR PARENT_PART CHILD_PART SEQ
ABC-1 ABC-1 ABC-10 100
ABC-1 ABC-10 ABC-155 100 100
ABC-1 ABC-155 RAW-2 100 100 100
ABC-1 ABC-155 HARDWARE-3 100 100 200
ABC-1 ABC-10 HARDWARE-1 100 200
ABC-1 ABC-1 ABC-20 200
ABC-1 ABC-20 RAW-1 200 100
ABC-1 ABC-1 ABC-30 300
ABC-1 ABC-30 RAW-3 300 100
ABC-1 ABC-1 HARDWARE-1 401
ABC-1 ABC-1 HARDWARE-2 402Hi,
As long as there's only one root, you can say ORDER SIBLINGS BY, but you can't do that in a sub-query (well, you can, but usually there's no point in doing it in a sub-query). If the CONNECT BY is being done in a sub-query, there is no guarantee that the main query will preserve the hierarchical order that the sub-query provides.
The query you posted doesn't require a suib-query, so you can say:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
--, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
WHERE CONNECT_BY_ROOT b.parent_part = 'ABC-1'
CONNECT BY parent_part = PRIOR child_part
ORDER SIBLINGS BY b.line_nbr
;I said the query you posted doesn't require a sub-query. It also doesn't require dual, so I suspect what you posted is a simplification of what you're really doing, and that may need a sub-query. In particular, if you intend to GROUP BY part_nbr, then you need the sub-query. We can repeat the CONNECT_BY_ROOT expression in the WHERE clause (or, now that I think about it, use a START WITH clause instead of WHERE), but, for some reason, we can't use CONNECT_BY_ROOT in a GROUP BY clause; we need to compute CONNECT_BY_ROOT in a sub-query, give it a name (like part_nbr), and GROUP BY that column in a super-query.
This assumes that there is only one root node. ORDER SIBLINGS BY means just that: children of a common parent will appear in order, but the root nodes, who have no parents, will not necessarily be in order.
Here's what I meant by using START WITH instead of WHERE:
SELECT CONNECT_BY_ROOT b.parent_part AS part_nbr
, b.parent_part
, b.child_part
--, SYS_CONNECT_BY_PATH(b.line_nbr,' ') AS seq
FROM bill_test1 b
START WITH b.parent_part = 'ABC-1'
CONNECT BY parent_part = PRIOR child_part
ORDER SIBLINGS BY b.line_nbr
;This should be much more efficient, because it narrows down the results before you waste time getting their descendants.
Using a START WITH clause here is analagous to me sending you an e-mail, saying "Come to a meeting a my office at 3:00."
Using a WHERE clause here is analagous to me sending an e-mail to everyone in the company, saying "Come to a meeting a my office at 3:00", and then, as people get here, telling everyone except you that they can go back.
ORDER SIBLINGS BY was introduced in Oracle 9.
Edited by: Frank Kulash on Dec 9, 2010 2:39 PM
Added version with START WITH clause -
Need help in order to recovery my Satellite L450-16Q
My laptop had a virus so I used the Product Recovery disk that came with it, thinking that it would fix it but it ended up erasing the whole of my computer even windows 7.
So now I have a computer I can't use I have bought windows 7 directly from microsoft which I have downloaded and tried to install but it doesn't work.
I have also bought the product recovery disks from toshiba's backup media site in hope that they will work.
Can anyone help/advise on what I need to do.
Thank you
SharronHello
The whole story is a little bit confusing for me. So lets see what you wrote:
>... thinking that it would fix it but it ended up erasing the whole of my computer even windows 7.
Thinking is wrong. What you need is exact info about recovery installation and this can be found in users manuals document. Recovery disc is not like Microsoft installation disc and cannot be used for repair. Recovery disc contains recovery image and can be used for clean OS installation (recovery image installation) only.
> So now I have a computer I can't use
Why you cannot use it? Recovery image installation installs OS again. Which OS is installed after running recovery image installation?
> I have also bought the product recovery disks from toshiba's backup media site
But why if you already have recovery disc that you have used at the beginning of the whole story?
What you need to do is to use this original disc for OS installation.
-start your notebook and press F12 several times to enter BOOT menu
-when the menu is shown put recovery disc into ODD
-select CD/DVD drive in the menu and press ENTER
-follow the menu on the screen
After recovery image installation you will have factory settings again and everything should be OK.
More questions? -
Need help in resolving ORA-06502: PL/SQL: related to WF objects
Hi,
We are getting the following error "Oracle error -6502: ORA-06502: PL/SQL: numeric or value error: character string buffer too small has been detected in FND_USER_RESP_GROUPS_API.UPDATE_ASSIGNMENT" when we add a new user or make changes to the existing user or anything associated with Workflow process. We have an SR open for over a week, but no resolution yet...!
We ran autoconfig few times, complied Invalid objects etc ...but no luck!
This is ERP 11.5.10.2 on Red Hat Linux 4.0 on a 2-node RAC cluster and 2-node Apps Cluster (PCP) ---; thanks in advance..!
SubrotoDid this work successfully before ? If so, what has changed ? Can this error be reproduced consistently on all instances ? Can you pl provide the navigation path to reproduce the error ?
Are you using the Internal Controls Manager module ? If so, MOS Doc 456950.1 (Preventive Segregation of Duties Constraints On Users Form Fails With Ora-6512, Ora-4088) may help.
HTH
Srini -
Need help, Trouble in uploading records using sql loader in Forms 6i
Hi,
I am trying to develop a screen for uploading records to a table by using a ctl file, batch file and sql loader.
Env: Forms 6i, Oracle 8
Table to be updated is: shy_upload_table
My TSN entry looks similar to this,
TEST_AXA.CNB.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.23.11.123)(PORT = 1234))
(CONNECT_DATA =
(SID = axdabc)
My intention is whenever i press the upload_button, I should truncate the table and upload it with the contents of the file.
In the when-button-pressed event of the upload_button I have the following code. always I am able to truncate the table but am not able to upload it with the contents of the file. Can any of you help me fix this problem ?
declare
var_control varchar2(256);
VAR_DATA VARCHAR2(256);
VAR_OUTPUT VARCHAR2(500);
var_filename varchar2(256);
str varchar2(50);
cnt number;
begin
FORMS_DDL('TRUNCATE TABLE shy_upload_table ');
select count(*) into cnt from shy_upload_table;
message('count '||cnt);
MESSAGE('');
If NOT form_success Then
MESSAGE('Upload Failed');
MESSAGE('Upload Failed');
else
set_item_property('DISPLAY_PB',enabled,property_true);
--when ever i run, i am able to see the display_pb enabled. it means form_success is true.
end if;
var_filename := :txt_filename;
--I have tried with each of the below option,
--sqlldr userid/[email protected] control=F:\ERP\file_upload.ctl
--sqlldr userid/password@axdabc control=F:\ERP\file_upload.ctl
--sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl
VAR_DATA :='data=' || var_filename ;
VAR_OUTPUT := var_control|| ' ' ||VAR_DATA;
host('F:\a.bat');
end;
batch file contents...
# I have tried with each of the below options
sqlldr userid/[email protected] control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
#sqlldr userid/password@axdabc control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
#sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
pause
Thanks
vishHi Francois,
Thanks for responding, I am not very sure of what you want me to try out.
When I double click the batch file containing the below, the record gets inserted in the table. Only when using my form and trying to upload, it fails to insert the record.
batch file contents...
#sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
pause
Thanks
Vish -
Need help with order booking tutorial
Hi
I am new to OracleFusion.
Started Learning By practising OrderBooking tutorial for 10g.
I am practising parellel branching in the tutorial .
I ve invoked Rapid distributors service in branch 1 of the flow activity.
and
i ve invoked Select manufacturing service in branch 2 of flow activity.
I ve deployed order booking service,rapid distributed service,select manufacturing service in the server.
Select manufacturing service is an asynchronous service .for this service to be complete it requires user to manually set price for the item ordered.
So I accesed SelectManufacturinUI in browser as instructed in book.The problem is tht it is directing me to login page where User id and password should be submitted.
In the tutorial no info is given regarding login details fot this page.Hence i am not able to set price for order.
So the Select manufacturing service is not completed ..hence i am not able to move further in the tutorial..
Kindly help with this..if any one has faced same prblm
thanksHi
I got the answer. Just posting it so that it helps someone
User id i tried : jcooper
password : Bpel console startup password -
Need help with Order by statement
I have a report which has an order by statement to order a varchar2 field in ascending order.
The report sorts the records correctly but if I rerun the report, the records with the same values in the column that I order by, do not maintain the same order as was in the report's 1st run.
The records will still be sorted in ascending order but those records that have the same values interchange positions each time I run the report.
Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.user8655468 wrote:
but those records that have the same values interchange positions each time I run the report.
Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.Hello,
It's normal those are same values may interchange at each run. you can add another column in order by clause. That
Order by column1,column2 may add another column3 -- this will maintain always same but column 1,2,3 have same value , it will may interchange.
Hope this helps
Hamid
Maybe you are looking for
-
How to Test Mail's Trainable Filter?
In the Apple Support Discussions topic No Junk mailbox in Training mode? a question arose regarding how to test if the trainable filter (the filter that evaluates the "Message is Junk Mail" condition) is evaluated independently of the other condition
-
so i rencently got a new macbook and am new mac user. I have two PCs with one connected to a router and the other using a dlink adapter to connect to network. The computer with the adapter has a usb printer connected to it. I was wondering if there i
-
My display on my faithful T500 has stopped working. Connecting an external monitor yields no results either. Is this a sign the video adapter has passed on? Is the video adapter embedded on the motherboard or is there a daughter board I can replac
-
Parametric role and organization
Hi, I´ve read BPM Studio helps and some threads in this forum and I still can't figure out this dynamic role thing. As I understand a participant can not normally particapate to process instance which have been started by a participant from different
-
OracleServiceRegistry10.3 installation on OracleApplicationServer failing
Hi all, I am trying to install Oracle Service Registry 10.3 on the following configuration Oracle 10g database 10.2.0.4 Oracle SOA Suite 10.1.3.1.0 SOA Patch set 10.1.3.5.0 Oracle Service Registry 10gR3 i am getting the following errors : Building sc