Urgent Help - SQL Statement..
hai everybody,
i need ur help in writing a SQL statement..
i have 2 tables say
CATEGORY
cat_id cat_name
B001 IT
B002 Accounts
B003 Clerk
SUB CATEGORY
sub_cat_id sub_cat_name cat_id
S001 programming B001
S002 Admin B001,B002
S003 HR B001,B002,B003
i want to display one as liek ths
sub_cat_name cat_name
Programming IT
admin IT,Accounts
HR IT,Accounts,Clerk
how to write a qry for this..pl help..
thanx in advance
regards
koel
This is just a natural join between two tables.
The query can be like this:
select b.sub_cat_name, a.cat_name
from category a, sub_category b
where a.cat_id = b.cat_id
Pl. let me know whether this solves your problem.
Similar Messages
-
URGENT HELP: SQL ordering
Hi there
I have a set of records that I want to order using SQL. I want to sort them ascendingly by a numeric field. The trouble is that I want them ascending excluding the fields equalling zero. The fields with a value of zero should be listed last.
Is there any way to achieve this?
Hope someone can help me soon. It is incredibly urgent!!
ComlinkHi there
I have a set of records that I want to order using
SQL. I want to sort them ascendingly by a numeric
field. The trouble is that I want them ascending
excluding the fields equalling zero. The fields with
a value of zero should be listed last.
Is there any way to achieve this?This is probably a hack, but I can't figure out the subselect.
SELECT field1, field2 FROM table ORDER BY field1 WHERE field1 != 0;
SELECT field1, field2 FROM table WHERE field1 = 0; -
URGENT HELP -- Session State Provider
We need to install Session State Providers for Oracle 8i. Cannt find a kit for that. Please help with suggestion where we can get a kit.
Thanks a BILLION in advance.You'll need to install the ODP 11 beta...
-
i have a table named
stock
dt date
partycode number(10)
itemcode number(10)
inqty number(10)
outqty number(10)
i want to find out the stock ledger that cb is calculated as ob+inqty-outqty. and ob is calculated group by dt,partycode,itemcode
please give me a single sql query that out put is like below
dt partycode itemcode ob inqty ouqty cb
01-04-06 1 1 10 5 2 13
04-05-06 1 1 13 2 4 11
01-04-06 2 1 5 1 1 5If you want to someone else to do your work, you could provide at least some sample data and an explanation of the given abbreviations like ob, cb. But I suppose, your question was so urgent that you had no time for details, right?
C. -
Urgent help needed... PL/SQL Insert statement
Hi...
I need some urgent help on this project. I have a 2 column table with values that need to be inserted into another existing table which has a sequence.
This is the 2 column table:
FUND YEAR
29587 05
29587 07
Existing table:
Name Null? Type
LIST_ID NOT NULL NUMBER(6) -- This is a sequence
WEB_USER_ID NOT NULL VARCHAR2(10)
RESOURCE_TYPE NOT NULL VARCHAR2(8)
LIST_TYPE NOT NULL VARCHAR2(10)
LIST_NAME NOT NULL VARCHAR2(50)
LIST_CODE_1 NOT NULL VARCHAR2(6) -- FUND from table above
LIST_CODE_2 NOT NULL VARCHAR2(6) -- YEAR from table above
LIST_CODE_3 NOT NULL VARCHAR2(6)
LAST_UPDATED_DT NOT NULL DATE
LAST_UPDATED_BY NOT NULL VARCHAR2(10)
LIST_CODE_4 NOT NULL VARCHAR2(20)
The columns from table 1 (FUND, YEAR) correspond to columns (LIST_CODE_1, LIST_CODE_2) in table 2. The column LIST_ID is a sequence. I can put in sysdate for LAST_UPDATED_DT and my initials SN for LAST_UPDATED_BY. This is going to be for 2 unique WEB_USER_IDs which would be in the WHERE clause. I will be inserting 2200 rows for each id. A single insert statement would look like this -
INSERT INTO EXISTING_TBL (list_id,web_user_id,resource_type,list_type,list_name,list_code_1,list_code_2,list_code_3,list_code_4,last_updated_dt,last_updated_by) VALUES ('470027','WEBUSER','GL','FUNDFYF',' FUND BALANCE SUM','12010','01',' ',' ',{ts '2010-5-19 10:16:9'},'SN')
How would I do this to insert the 2200 values from my 2 column table to the existing table?
All help is greatly appreciated!!
SNHello ,
I think this will work
INSERT INTO TABLE2
LIST_ID,
WEB_USER_ID,
RESOURCE_TYPE,
LIST_TYPE,
LIST_NAME,
LIST_CODE_1,
LIST_CODE_2,
LIST_CODE_3,
LIST_CODE_4,
LAST_UPDATED_DT,
LAST_UPDATED_BY
SELECT
SEQ.NEXTVAL,
FUND,
YEAR,
<VALUE FOR RESOURCE_TYPE>,
<VALUE FOR LIST_TYPE>,
<VALUE FOR LIST_NAME>,
<VALUE FOR LIST_CODE_1>,
<VALUE FOR LIST_CODE_2>,
<VALUE FOR LIST_CODE_3>,
<VALUE FOR LIST_CODE_4>,
SYSDATE,
'SN'
FROM
TABLE1
REGARDS
Rahul Sharma -
Problems with SQL statement ..Urgent Help required
Hi
I have a table with something like this
::: inidicates column seperation
col1 ::: col2 ::: col3 ::: col4
ab,abc,abvfg,fghy ::: x1 ::: y1 ::: z1
ba,mkl,huji,kill ::: x2 ::: y2 ::: z2
I want to get something like this :
col1 ::: col2 ::: col3 ::: col4
ab ::: x1 ::: y1 ::: z1
abc ::: x1 ::: y1 ::: z1
abvfg ::: x1 ::: y1 ::: z1
fghy ::: x1 ::: y1 ::: z1
and so on......
Either a procedure or a single sql statement is fine..
PS: the first column can have any number of words separated with comma (,)
Please advise
Thanks in advancecreate table kris (
a varchar2(200),
b varchar2(20),
c varchar2(20),
d varchar2(20));
insert into kris values('ab,abc,abvfg,fghy', 'x1','y1','z1');
insert into kris values('ba,mkl,huji,kill', 'x2','y2','z2');
select substr(','||a||',', instr(','||a||',', ',', 1, rn) +1,
instr(','||a||',', ',', 1, rn+1) - instr(','||a||',', ',', 1, rn) -1)
v,b,c,d
from (select length(a) - length(translate(a, '1,', '1')) +1 L,
a, b, c, d from kris) t, (select rownum rn from cat) c
where c.rn <= t.L
order by a, rn;
V B C D
ab x1 y1 z1
abc x1 y1 z1
abvfg x1 y1 z1
fghy x1 y1 z1
ba x2 y2 z2
mkl x2 y2 z2
huji x2 y2 z2
kill x2 y2 z2 -
Urgent ==can somebody help in constructing SQL statement
Hi,
I have a table called cgryrel with data and fieldnames like below:
CGRYREL
======
crpcgnbr crccgnbr
502 510
502 511
502 512
510 515
511 516
512 517
515 518
516 519
517 520
503 540
503 541
I am trying to get a count of rows that are related to crpcgnbr=502.
To get this information I tried with below SQL statement and ,I get only top level.
select count(*) from cgryrel where crpcgnbr=502
result : 3
I want all rows that are connected to 502?
can somebody in the forum tell me,what I am doing wrong???
Thanks
JackHi limeybrit9,
Lluis ...Doesn't that method sort of require that you already know how
many indentation levels there are if you want all numbers related to
502?Yes, it does. I already said that in my post. I understand that making a select with, lets say, 100 tables supporting 100 indentation levels might be, at least, ugly to see. But it works and it's fast enough. -
Urgent HELP required on forming the Matrix of data using PL/SQL
Hi All,
I'm new to this thread and require your urgent help in this regard.
I've got a requirement for building a 5000 X 5000 matrix using PL/SQL. My original data tables have 5000 rows each and I need to do a correlation analysis using this data and need to store in a physical table and not in-memory. Is this feat achievable using mere PL/SQL? I understand that Oracle DB has a limitation of 1000 columns(but not sure) and hence I'd like to know whether there is any work-around for such scenarios. If not, what are the other alternative method(s) to achieve this feat? Do I need to use any 3rd party tools to get this done? An early reply from the experts is highly appreciated.
Thanking you all Gurus in advance.
Rgds
SaiWelcome to OTN!
I'll get to your quesiton in a moment, but first some welcome information. Many OTN posters consider it impolite to mark threads as "urgent". We are volunteers and have jobs of our own to do without people we don't know making demands. You are brand new and deserve some patience but please understand this. It is very likely before I finish this post someone will complain about the word "urgent" in your subject.
On to more interesting things :)
You can do the matrix, but are out of luck with a 5000 x 5000 table because Oracle only allows 1000 columns per table. There are ways to work around this.
How do do the matrix depends on what you want to do. You can do this different ways. You can create a table beforehand and use PL/SQL or simple SQL to populate it, or use the CREATE TABLE AS syntax to create and populate it in one step if you can get the underlying SQL to work the way you want, something like
create table my_table as
select a.*, b.*
from table1 a, table2 bcan populate a matrix from 2 tables with an intentional cartesian join (the WHERE clause was left out intentionally, provided your data is already in the data base.
If not you can use a PL/SQL routine to populate the data.
There are a couple of ways to solve the 1000 column limit. The easiest way might be to have 5 collections of 1000 columns each. A more complicated but more elegant soltion would be to have nested collections, allowing 2 colliections that you can loop through - a collection of collections. Nested collections can be hard to work with. A third way would be to use nested tables in the database but I personally do not like them and the insert, update, and delete statements for nested tables are hard to use.
I'm not going to give a code example because I am not sure which solution is best for you. If you have further questions post them. -
HELP: Bind Variable does't work in SQL statement
I am trying to connect a text item bind variable into the where
clause of an SQL statement. Specifically into an INSERT
statement and SELECT statement. It gives me an message box
error, saying it is unable to insert. There is no Oracle error
number associated with it. Is this a bug? Has this happened to
anyone else. PLEASE HELP! URGENT!
nullI assume this is a forms problem. You need to check out the
dbms_error_code and dbms_error_text to get your oracle error.
You can trap and report these types of errors using an on-error
trigger. Also, if you are using the default menu then check
out help -> display error immediately after the form reports
unable to insert ...... This should give you enough information
to solve your problem, or at least point you in the right
direction.
Daniel Jensen (guest) wrote:
: I am trying to connect a text item bind variable into the where
: clause of an SQL statement. Specifically into an INSERT
: statement and SELECT statement. It gives me an message box
: error, saying it is unable to insert. There is no Oracle error
: number associated with it. Is this a bug? Has this happened to
: anyone else. PLEASE HELP! URGENT!
null -
Need help on SQL Statement for UDF
Hi,
as I am not so familiar with SQL statements on currently selected values, I urgently need help.
The scenario looks as follows:
I have defined two UDFs named Subgroup1 and Subgroup2 which represent the subgroups dependent on my article groups. So for example: When the user selects article group "pianos", he only sees the specific subgroups like "new pianos" and "used pianos" in field "Subgroup1". After he has selected one of these specific values, he sees only the specific sub-subgroups in field "Subgroup2", like "used grand pianos".
I have defined UDTs for both UDFs. The UDT for field "Subgroup1" has a UDF called "ArticleGroup" which represents the relation to the article group codes. The UDT for field "Subgroup2" has a UDF called "Subgroup1" which represents the relation to the subgroups one level higher.
The SQL statement for the formatted search in field "Subgroup1" looks as follows:
SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP1] T0 WHERE T0.[U_ArticleGroup] = (SELECT $[OITM.ItmsGrpCod])
It works fine.
However, I cannot find the right statement for the formatted search in field "Subgroup2".
Unfortunately this does NOT WORK:
SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP2] T0 WHERE T0.[U_Subgroup1] = (SELECT $[OITM.U_Subgroup1])
I tried a lot of others that didn't work either.
Then I tried the following one:
SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP2] T0 WHERE T0.[U_Subgroup1] = (SELECT T1.[Code] FROM [dbo].[@B_SUBGROUP1] T1 WHERE T1.[U_ArticleGroup] = (SELECT $[OITM.ItmsGrpCod]))
Unfortunately that only works as long as there is only one specific subgroup1 for the selected article group.
I would be sooooo happy if there is anyone who can tell me the correct statement for my second UDF!
Thanks so much in advance!!!!
Edited by: Corinna Hochheim on Jan 18, 2010 10:16 PM
Please ignore the "http://" in the above statements - it is certainly not part of my SQL.
Please also ignore the strikes.Hello Dear,
Use the below queries to get the values:
Item Sub Group on the basis of Item Group
SELECT T0.[Name] FROM [dbo].[@SUBGROUP] T0 WHERE T0.[U_GroupCod] =$[OITM.ItmsGrpCod]
Item Sub Group 1 on the basis of item sub group
SELECT T0.[Name] FROM [dbo].[@SUBGROUP1] T0 WHERE T0.[U_SubGrpCod]=(SELECT T0.[Code] FROM [dbo].[@SUBGROUP] T0 WHERE T0.[Name] =$[OITM.U_ItmsSubgrp])
Sub group 2 on the basis of sub group 1
SELECT T0.[Name] FROM [dbo].[@SUBGROUP2] T0 WHERE T0.[U_SubGrpCod1]=(SELECT T0.[Code] FROM [dbo].[@SUBGROUP1] T0 WHERE T0.[Name] =$[OITM.U_ItmsSubgrp1])
this will help you.
regards,
Neetu -
Can someone help me correct this sql statement in a jsp page?
ive been getting the java.sql.SQLException: Incorrect syntax error for one of my sql nested statements. i cant seem to find similar egs online, so reckon if anyone here could help, really appreciate it.
as im putting the nested sql in jsp page, it has to be with lots of " " n crap. very confusing if there are nested.
heres the sql statement without those "" that i want to use:
select top 5 * from(
select top+"'"+offset+"'"+" * from prod where cat=" +"'" cat "'"+"
)order by prodID desc
when i put this in my jsp pg, i had to add "" to become:
String sql = "select top 5 * from("+"select top"+"'"+offset+"'"+" * from prod where cat=" +"'" +cat+ "'"+")order by prodID desc";cat=" +"'" cat "'"+")order by prodID desc";
all those "" are confusing me to no end, so i cant figure out what should be the correct syntax. the error says the syntax error is near the offset.If offset is, say, 10, and cat is, say, "new", then it looks like you're going to produce the SQL:
select top 5 * from(
select top '10' * from prod where cat='new'
)order by prodID descThat looks exactly like incorrect syntax to me... top almost certainly can't handle a string literal as its operand... you almost certainly would want "top 10" instead of "top '10'"...
If you use PreparedStatement, you don't have to remember what you quote and what you don't and you can have your SQL in a single static final string to boot... -
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 -
Hi,
From the SQL statement below, i need help in explaining what does the line "WHERE ( lims_sys.result.result_template_id = lims_sys.result_template_limit.result_template_id (+))" do?
This statement was written by a vendor and now i have problem displaying some new data. Only a portion of what i need is displayed.
SELECT "LIMS_SYS"."RESULT"."DESCRIPTION",
"LIMS_SYS"."RESULT_TEMPLATE_LIMIT"."NUMERIC_LIMIT",
"LIMS_SYS"."RESULT"."FORMATTED_RESULT",
"LIMS_SYS"."RESULT"."CONCLUSION",
"LIMS_SYS"."RESULT_USER"."U_RESULT_SEQUENCE" ,
"LIMS_SYS"."RESULT"."RESULT_ID"
FROM "LIMS_SYS"."RESULT",
"LIMS_SYS"."RESULT_TEMPLATE_LIMIT",
"LIMS_SYS"."RESULT_USER",
"LIMS_SYS"."ALIQUOT",
"LIMS_SYS"."SAMPLE",
"LIMS_SYS"."SDG",
"LIMS_SYS"."TEST"
WHERE ( lims_sys.result.result_template_id = lims_sys.result_template_limit.result_template_id (+)) and
( "LIMS_SYS"."RESULT"."RESULT_ID" = "LIMS_SYS"."RESULT_USER"."RESULT_ID" ) and
( "LIMS_SYS"."SDG"."SDG_ID" = "LIMS_SYS"."SAMPLE"."SDG_ID" ) and
( "LIMS_SYS"."SAMPLE"."SAMPLE_ID" = "LIMS_SYS"."ALIQUOT"."SAMPLE_ID" ) and
( "LIMS_SYS"."ALIQUOT"."ALIQUOT_ID" = "LIMS_SYS"."TEST"."ALIQUOT_ID" ) and
( "LIMS_SYS"."TEST"."TEST_ID" = "LIMS_SYS"."RESULT"."TEST_ID" ) and
( ( LIMS_SYS."SDG"."SDG_ID" = :sdg_id ) AND
( LIMS_SYS."RESULT"."STATUS" <> 'X' ) AND
( LIMS_SYS."RESULT"."REPORTED" = 'T' ) AND
( LIMS_SYS."RESULT_USER"."U_RESULT_CATEGORY" in ( 'Metal' , 'Mean Metal', 'Range Metal')) )
Thanks for all your help.Hi,
After WHERE .......... is indicates an OUTER Join condition.
In this type of join, system retrieves the data for matched and
as well as unmatched.
Example:
EMP table have a column DEPTNO with the data 10, 20, 30 (total rows=14)
DEPT table have a column DEPTNO with the data 10, 20, 30, 40, 50 (total rows=5)
If the WHERE clause contained EMP.DEPTNO(+) = DEPT.DEPTNO
then the output contain the data relative to 10, 20, 30, 40, 50 (total rows = 16)
i.e. 14 rows (with matching data) and 2 rows (with unmatching data)
Regards,
Sailaja -
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. -
SQL STATEMENT , PLEASE HELP
Hi,
I want some help in writing a SQL Query .Its besically a hierarchical query. Let me lay down the table structure first to explain my requirements better.
PORP_TABLE(NODE_LEVEL int, WBS_ID int, WBS_NUMBER varchar(60), LFT int,RGT int)
SELECT NODE_LEVEL, WBS_ID, LFT,RGT FROM PROPOSAL_WBS PW WHERE PROPOSAL_REV_ID = 7000
(SAMPLE DATA)
NODE WBS
LEVEL WBS_ID NUMBER LFT RGT
0 7055 ROOT 1 24
1 7056 1 2 5
1 7088 2 6 9
2 7057 1.1 3 4
2 7089 2.1 7 8
2 7091 3.1 11 14
2 7103 3.2 15 16
2 7105 4.1 19 20
1 7090 3 10 17
3 7092 3.1.1 12 13
1 7104 4 18 23
2 7106 4.2 21 22
ALLOCATION_DETAIL( WBS_ID int, COST_ID int, PERIOD Date, AMOUNT Float)
sample data
WBS_ID , COST_ID , PERIOD , AMOUNT
7057 100 01-jan-2005 5000
7057 100 01-feb-2005 2000
7057 100 01-mar-2005 1000
7057 100 01-apr-2005 6000
7057 100 01-may-2005 3000
7057 100 01-jun-2005 45000
7106 100 01-mar-2005 8000
7106 100 01-apr-2005 7000
7106 100 01-may-2005 9000
Now the PORP_TABLE has got the parents and childs. Only the leaf nodes in the hierarchy has the values stored in the ALLOCATION_DETAIL table. Now here is the scenario
In the example 7055 is the root WBS . The Leaf WBS are the one with max extension in the wbs number ( in this case it is 1.1, 2.1, 3.1.1, 3.2, 4.1 and 4.2)
Now the Starting period for each leaf node in the ALLOCATION_TABLE could be differrent . What that means is WBS 1.1 could start in Jan -2003 and WBS 3.1 Could be Jul-2005 . So the ending perios are also differrent for differrent WBS . Some can span 2 years some can 5 years.
So how to write a query so it retrieves the value for all the Wbs starting from the MIN ( PERIOD ) upto the MAX(PERIOD), and it should roll up also. Now there is No connect by Prior or any analytic functions available for this . THIS NEEDS TO BE DONE ONLY THROUGH TRADITIONAL SQL STATEMENT . And NO DB FUNCTIONS CAN BE USED .
Now if the WBS is a parent node then it should have the sum of all its child nodes for the COST category.
SO THE RESULT SET SHOULD BRING LIKE THIS
WBS_NUMBER, PERIOD_NUMER, COST_CATEGORY , AMOUNT
ROOT
1
1.1
2
2.1
3
3.1
3.1.1
3.2
4
4.1
4.2
......Thanks for all your thoughtfull replies and feedbacks. Yes it is in Sybase platform . Though I have been woking all along in Oracle , Unfortunately this one is in Sybase, and no the customer cant and wont move to Oracle. So I have to work with it . And if you want to see the table structure . Here are they :
CREATE TABLE PROPOSAL_WBS (
BURDEN_CENTER_ID numeric(18,0) NULL,
START_DATE datetime NULL,
END_DATE datetime NULL,
WBS_ID int NOT NULL,
MODIFIED_DATE datetime NULL,
CREATED_DATE datetime NULL,
MODIFIED_BY varchar(127) NULL,
CREATED_BY varchar(127) NULL,
FEE_PERCENT float NULL,
PROPOSAL_REV_ID int NOT NULL,
PARENT_WBS_ID int NULL,
NAME varchar(127) NULL,
COMMENT varchar(255) NULL,
TARGET_COST float NULL,
MONTHS_REMAINING int NULL,
DEFAULT_STAFF_FTE float NULL,
ANNUAL_GRA_SALARY float NULL,
NUMBER_OF_GRA int NULL,
MANAGEMENT_ADJUSTMENT_TOTAL float NULL,
MA_UNALLOCATED_FUNDS float NULL,
FEE_TOTAL float NULL,
FEE_UNALLOCATED_FUNDS float NULL,
TRAVEL_COMMENTS varchar(255) NULL,
ODC_COMMENTS varchar(255) NULL,
SORT_ORDER int NULL,
LFT int NULL,
RGT int NULL,
NODE_LEVEL int NULL,
WBS_NUMBER varchar(50) NOT NULL,
TOTAL_COST float NULL,
TOTAL_COST_PLUS_FEE float NULL,
PER_MILE_COST float NULL,
PER_DIEM float NULL,
TAX_RATE float NULL,
RENTAL_CAR_PER_DAY_COST float NULL,
TAXI_PER_TRIP_COST float NULL,
CONSTRAINT PK_PROPOSAL_WBS PRIMARY KEY(WBS_ID)
CREATE TABLE PROPOSAL_WBS_ALLOC_DETAIL (
WBS_ID int NOT NULL,
OBJECT_CODE_ID numeric(18,0) NOT NULL,
PERIOD_NUMBER int NOT NULL,
ALLOCATION_AMOUNT float NULL,
PERIOD_YEAR datetime NULL,
CONSTRAINT PK_PROPOSAL_WBS_AD PRIMARY KEY(WBS_ID,OBJECT_CODE_ID,PERIOD_NUMBER)
CREATE TABLE WBS_PERIOD (
PERIOD_NUMBER int NOT NULL
CREATE VIEW WBS_COST_CAT AS
SELECT PROPOSAL_WBS.PROPOSAL_REV_ID,
PROPOSAL_WBS.WBS_ID,
PROPOSAL_WBS.NAME, PROPOSAL_WBS.SORT_ORDER,
PROPOSAL_WBS.NODE_LEVEL, PROPOSAL_WBS.WBS_NUMBER,
CODES.CODE_ID COST_CATEGORY, CODES.CODE_NAME COST_CAT_NAME
FROM PROPOSAL_WBS, CODES
CREATE TABLE CODES (
CODE_ID numeric(18,0) NOT NULL,
CODE_VALUE varchar(254) NULL,
CODE_NAME varchar(254) NULL,
CODE_TYPE numeric(18,0) NULL,
CODE_PARENT_ID numeric(18,0) NULL,
CONSTRAINT PK_CODE_ID PRIMARY KEY(CODE_ID)
So let me explain little bit more . The WBSs are categorized into two differrent types. One as INPUT and the second one as NON INPUT. Now assme the the WBS in a tree structure . So only the LEAF WBSs will have the AMOUNT and they are the INPUT WBSs and all non leaf WBSs are NON INPUT. Now lets say there are 5 LEAF WBSs. Each LEAF WBS will have differrent start period ex: WBS 1.1 starts in January 2003 and goes for 48 periods . WBS 2.1 starts in November 2003 and goes for 35 periods . WBS 3.1 starts in March 2004 and goes for 52 periods. and so on .
Now as there is no Allocation Amount entry for all other WBSs except the LEAF WBSs. So how do I get the roll up . For example if you imagine the parent of WBS 1.1 is WBS 1 , and the parent of WBS 2.1 is WBS 2 and the Parent of WBS 3.1 is WBS 3 , and the parent for WBS 1, WBS 2, WBS 3 is "ROOT WBS". As I said there is no entry for WBS 1, WBS 2 , WBS 3 and the "ROOT WBS". So how do I have a roll up of the Leaf WBS data for their parent WBSs.
Now if u think of the data in a matrix report, the WBSs and the COST CATEGORY will be the row values, the Period Numbers will the column values and the Allocation Amount will be the cross values. so lets say the WBS 1 has got two leaf nodes, WBS 1.1 and WBS 1.2 then WBS 1 will have the summed amount for each period starting the minumum period of the two of its leaf nodes and for all the cost categories of both the leaf nodes. and the "ROOT WBS" will have all the cost categories of al the Leaf nodes . for all the periods , period wise.
Maybe you are looking for
-
Multiple embeds, play only one at a time?
I'm working on page with CD track info and I want to have a small quicktime play button by each song that will play a 30 second sample. I've already done this by just embedding each mp3 sample into the xhtml page. The problem is, a person can click o
-
Hi, In the past, we cannot process park invoice document unless a PO has a GR. Otherwise, system will prompt "PO has no selectable items". However now, the user can just enter the amount in the appropriate field and we can proceed with parking of inv
-
Hi, below is my select, it returns an error: ORA-00904: "UNION"."QTD_ITEM": invalid identifier SELECT union.cod_company, union.num_order, union.cod_prod, Sum(union.qtd_item) -- here is the error FROM SELECT cod_company, num_order, cod_prod, qtd_item_
-
Hi, We are trying to implement an extended classic scenario of EBP and we are using XI to send POs and receive conformation back in XML format. We have implemented as per the ServiceProcurementNEW.pdf document for configuring the XI and SRM settings.
-
Can't remember under wich ID i registered my PS elements 2
and now needs the registration to understand why updating does not work. Any idea how to do this ? Magali