NOTIFICATION QUERY FOR UDF COLUMN
Dear experts,
I want notification query for delivery should not be add without fill up the information in machine number column (UDF Column- U_MCnumber)
Please do needful.
Thanks & Regards,
Akshata
Dear all,
I have got query ...........
If @object_type = '15'and @transaction_type= ('A')
BEGIN
If Exists (Select T0.DocEntry from ODLN T0 Inner Join DLN1 T1
On T0.DocEntry=T1.DocEntry INNER JOIN OITM T3 ON T3.ItemCode = T1.ItemCode
Where (T1.U_MCnumber Is Null and T3.ITMsgrpcod='119')
And T0.DocEntry = @list_of_cols_val_tab_del )
BEGIN
Select @error = -1,
@error_message = 'Please fill up machine number!!!'
End
End
Thanks & Regards,
Akshata
Similar Messages
-
Notification Query for Item Group
Dear Experts,
Please Guide me for a Notification Query for this Scenario :
I want to put a Notification Query for a Group i.e. when any user do transactions in any form or any Particular form using items
of this Group than if the Item Quantity is in Decimal then he can not do that Transaction and Get Error Message.
Thanks in Advance.
Atul ChakrabortyHi Atul,
to achieve this you have to write SPTN at the back end
under databases node select your live database.
Select programability
select stored procedure
select db.sbo.SP_Transactionnotification
and paste your code into
ADD YOUR CODE AREA
If (@object_type = '17') and (@transaction_type in ('A', 'U'))
BEGIN
Declare @ItmGrpCode as int
Declare @Qty as int
set @ItmGrpcode = (select oitm.itmsgrpcod from oitm inner join rdr1 on oitm.itemcode = rdr1.itemcode inner join ordr on
rdr1.docentry = ordr.docentry where ordr.docentry=@list_of_cols_val_tab_del)
set @Qty = (select quantity from rdr1 inner join ordr on ordr.docentry = rdr1.docentry where ordr.docentry =
@list_of_cols_val_tab_del)
BEGIN
if @ItmGrpcode = 10 and @qty = 0
Begin
set @error = -1
set @error_message = 'Invalid Input'
End
End
END
Like wise by capturing object type and dml mode you have to write code for every document that you want to check.
For example I've given code for Sales Order.
hope this will help you
Thanking you
Malhaar' -
Need help with query for converting columns to rows
Hello,
I know this is a very common question asked in the forum. I have searched regading this, i did find some threads, but i was not able to achieve what i require from the answers posted. So anybody please help me.
I have a table which is having multiple columns as follows:
Insert into table_1 (X,Y,Z,A,B,C,D,E,F,G,H,I) values (0,0,2,0,0,1,3,0,0,0,0,0);I want to convert the result into a two column, multiple rows i.e., I want the result as follows:
Col1 Col2
X 0
Y 0
Z 2
A 0
B 0
C 1
D 3
E 0
F 0
G 0
H 0
I 0Please anybody help me in writing the query for this..Is this what you are expecting:
SQL> WITH T AS
2 (
3 SELECT 0 X, 0 Y, 2 Z, 0 A, 0 B, 1 C, 3 D, 0 E, 0 F, 0 G, 0 H, 0 I FROM DUAL
4 )
5 SELECT 'X' col1, X col2 FROM T
6 UNION ALL
7 SELECT 'Y' col1, Y col2 FROM T
8 UNION ALL
9 SELECT 'Z' col1, Z col2 FROM T
10 UNION ALL
11 SELECT 'A' col1, A col2 FROM T
12 UNION ALL
13 SELECT 'B' col1, B col2 FROM T
14 UNION ALL
15 SELECT 'C' col1, C col2 FROM T
16 UNION ALL
17 SELECT 'D' col1, D col2 FROM T
18 UNION ALL
19 SELECT 'E' col1, E col2 FROM T
20 UNION ALL
21 SELECT 'F' col1, F col2 FROM T
22 UNION ALL
23 SELECT 'G' col1, G col2 FROM T
24 UNION ALL
25 SELECT 'H' col1, H col2 FROM T
26 UNION ALL
27 SELECT 'I' col1, I col2 FROM T
28 /
C COL2
X 0
Y 0
Z 2
A 0
B 0
C 1
D 3
E 0
F 0
G 0
H 0
C COL2
I 0
12 rows selected. -
Reg. Query for UDFs.
Hello All,
I've created a multiple UDFs Like, Vendor Name,Vendor Address,Vendor Excise Details like ECC No,Range, Division,VAT No,CST No. in Marketing Documents.
I want to write a query, for example if I select the Vendor Name, the vendor address and excise details should pick up automatically from that vendor master record. Please help.
Thanks,
Pratheeviraj.Dear Avijit,
Thanks for your reply.
I can't understand your solution. Can you please explain me in detail?
I'm giving the scenario in detail,
In the marketing document 'Outgoing Excise Invoice', I've created UDFs like vendor name, vendor address, vendor excise number, etc., my requirement is the moment I select the vendor in Vendor Name UDF, the address and excise number should get populated in the respective UDFs.
Thanks,
Pratheeviraj -
Query for Identifying column changes
Hi Guys,
Need help in getting a query for my scenario.
I have 2 table Table A and Table B. Both have same columns and data type.
Table A:
Id PersonId Name Code Date
1 1000 John M 2014-07-28
2 1001 Mary B 2014-07-28
3 1002 Robin R 2014-07-28
4 1003 Maxie N 2014-07-28
Table B:
Id PersonId Name Code Date
1 1000 John 2014-07-28
2 1001 Hary S 2014-07-28
3 1002 Justin Q 2012-07-28
4 1003 Maxie P 2013-07-28
My situation is:
I need to compare both the tables and need to identify the rows that has a change in all columns, if all other columns are not changed and Code is changed to blank, i need to ignore that row.
The expected outcome is:
Id PersonId Name Code Date
2 1001 Hary S 2014-07-28
3 1002 Justin Q 2012-07-28
4 1003 Maxie P 2013-07-28
Thanks Guys...I found the solution in a easy way i guess...
select * from
SELECT ID, PERSONID,NAME,
case when code is null then
select a.code from tablea A where A.ID = B.ID
else
a.code
end as Code,
DATE FROM TABLE B
MINUS
SELECT ID,PERSONID,NAME,CODE,DATE FROM TABLE A
What do you guys think...would it work for my scenario....
i am testing few scenarios looks like working....... -
Performance of update query for single column vs multiple column
Hi All,
I could not find any answer for this, does it ever matter in terms of performance updating single column versus multiple column in a single update query.
For eg. table consisting of 15 columns, what would be the difference in performance when one column is update in the single query against another update query where 15 columns are updated.
Please do keep in mind my table columns in actually could be around 150+.
Thanks for any information provided.If updated columns aren´t on where clause , then the only impact of 15 columns will be a increase on redo generation, and a possible chainning row.
So since the redo is one of the things that have a large impact, the answer is yes.
The performance will be slower.
Regards
Helio Dias.
http://heliodias.com
OCE SQL, OCP 9i -
Update query for XMLTYPE column
Hello everyone,
I have inserted xml data into XMLTYPE column of my table,xml data is something like this
<Data type="FYI">
<ID xmlns="http://orcl.com">T-1-1</ID>
<Category>FRAME</Category>
<ProductID>1</ProductID>
<Name xmlns="http://orcl.com">Frame </Name>
<Type>BASIC</Type>
<Code>INSTALL</Code>
<NodeID>1</NodeID>
</Data>
Now i need to update the values inside the <Data> element,like
ID == T-2-2
Category == IFRAME
ProductID == 1.1
Name == IFRAME
We are using oracle 10g R2.
Please help me out how to update. It would be very thankfull for your valuble suggestions
Thanks in advance<Services>
<DataService type="FRLY">
<ID xmlns="http://www.openapplications.org/oagis/9">T-1-1-FRLY</ID>
<CategoryCode>FRAME</CategoryCode>
<ProductOfferingID>1</ProductOfferingID>
<Name xmlns="http://www.openapplications.org/oagis/9">Frame Relay</Name>
<SubType>FRLY - BASIC</SubType>
<ActionCode>INSTALL</ActionCode>
<NodeID>1</NodeID>
<Contract>
<ID xmlns="http://www.openapplications.org/oagis/9" schemeName="Networx Universal">00000</ID>
<Category name="Contract Type">U</Category>
</Contract>
<Contract>
<Type xmlns="http://www.openapplications.org/oagis/9">Routine</Type>
</Contract>
<CustomerParty>
<Location/>
</CustomerParty>
<ProvisioningStatus type="BillingSetup">
<Description xmlns="http://www.openapplications.org/oagis/9">C</Description>
</ProvisioningStatus>
<MileStone>
<ID xmlns="http://www.openapplications.org/oagis/9">CWD</ID>
<Date>2007-01-29</Date>
</MileStone>
<ActivityStatus>
<Code xmlns="http://www.openapplications.org/oagis/9" name="DueDate"/>
<EffectiveDateTime xmlns="http://www.openapplications.org/oagis/9">2007-01-29T00:00:00Z</EffectiveDateTime>
</ActivityStatus>
<AssociatedIDs>
<ID xmlns="http://www.openapplications.org/oagis/9">1</ID>
</AssociatedIDs>
<AssociatedIDs>
<TemporaryID schemeName="OPKEY">34908</TemporaryID>
</AssociatedIDs>
<Location>
<ID xmlns="http://www.openapplications.org/oagis/9">T-510092</ID>
</Location>
<OrderID>RequestID</OrderID>
<Accessory>
<ActionCode>ADD</ActionCode>
<Description xmlns="http://www.openapplications.org/oagis/9">IBM ESERVER-XSERIES306</Description>
<CategoryCode>5</CategoryCode>
<InstallVendorParty>
<Name xmlns="http://www.openapplications.org/oagis/9">MCI</Name>
</InstallVendorParty>
</Accessory>
<Circuit>
<ID xmlns="http://www.openapplications.org/oagis/9">T-1-1-FRLY</ID>
<AssociatedIDs/>
</Circuit>
</DataService>
</Services>
This was my xml which i have inserted into DB for the column XMLTYPE.Now i need to update few values in this whole file like values of
ID under<DataService>
Name under <DataService>
ID under <Contract>
Description under <ProvisioningStatus>
i was using the UPDATEXML query to update those it's saying i row updated but when i extract it says null.
Please help me out to solve this problem.
Thanks in advance. -
Strange behaviour of JDBC query for CHAR column
Hi,
I have a simple table with char type and several records in the table.
create table char_test(str char(50));
insert into char_test values ('abc');
insert into char_test values ('abc ');
insert into char_test values ('abc ');
In JDBC, if I have a query like
PreparedStatement st = conn.prepareStatement("select str from char_test where str = 'abc'");
ResultSet rs = st.executeQuery();
All three rows will be returned.
However, If I use parameter for the PreparedStatment, nothing will be returned if the value of the parameter is passed as "abc".
PreparedStatement st = conn.prepareStatement("select str from char_test where str = ?");
st.setString(1, "abc");
ResultSet rs = st.executeQuery();
Personally, I think this is a bug of Oracle JDBC driver. Could anybody please give me any explanation?
Thanks,
Bill
PS. I'm using Oracle 10g Release 2 DB and ojdbc14.jar under jdk 1.5.Hello Bill,
Have you solved your problem ?
I have encountered a similar one and found a strange behavior of JDBC driver for PrepareStatement : in some cases, deep in JDBC driver, the parameter values could'nt be convert and are send as null values to the server.
Here are partial driver logs, the first for a program which works fine and the second for one which turns on error.
============================
<record>
<date>2006-09-06T16:27:43</date>
<millis>1157552863218</millis>
<sequence>335</sequence>
<logger>oracle.jdbc.conversion</logger>
<level>FINE</level>
<class>oracle.jdbc.driver.DBConversion</class>
<method>javaCharsToCHARBytes</method>
<thread>10</thread>
<message>DBConversion.javaCharsToCHARBytes(chars[]= (26 bytes):
00 0c 00 65 00 78 00 70 00 73 00 74 00 6f 00 0a 00 73 00 6c
00 65 00 65 00 70 , charOffset=1, bytes[]= (7 bytes):
00 00 00 00 00 00 00 , byteOffset=0, cs=178, nchars=6)</message>
</record>
<record>
<date>2006-09-06T16:27:43</date>
<millis>1157552863218</millis>
<sequence>336</sequence>
<logger>oracle.jdbc.conversion</logger>
<level>FINE</level>
<class>oracle.jdbc.driver.DBConversion</class>
<method>javaCharsToCHARBytes</method>
<thread>10</thread>
<message>DBConversion.javaCharsToCHARBytes(chars, nchars, bytes[], cs): returned 6</message>
</record>
=============================
javaCharsToCHARBytes gets 6 characters OK
=============================
<record>
<date>2006-09-06T16:12:32</date>
<millis>1157551952843</millis>
<sequence>333</sequence>
<logger>oracle.jdbc.conversion</logger>
<level>FINE</level>
<class>oracle.jdbc.driver.DBConversion</class>
<method>javaCharsToCHARBytes</method>
<thread>10</thread>
<message>DBConversion.javaCharsToCHARBytes(chars[]= (40 bytes):
00 26 00 73 00 74 00 6f 00 72 00 61 00 67 00 65 00 5f 00 53
00 74 00 6f 00 72 00 65 00 2e 00 71 00 75 00 65 00 72 00 79 , charOffset=1, bytes[]= (20 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 , byteOffset=0, cs=178, nchars=19)</message>
</record>
<record>
<date>2006-09-06T16:12:32</date>
<millis>1157551952843</millis>
<sequence>334</sequence>
<logger>oracle.jdbc.conversion</logger>
<level>FINE</level>
<class>oracle.jdbc.driver.DBConversion</class>
<method>javaCharsToCHARBytes</method>
<thread>10</thread>
<message>DBConversion.javaCharsToCHARBytes(chars, nchars, bytes[], cs): returned 0</message>
</record>
=============================
javaCharsToCHARBytes gets 0 characters instead of 19
But I am unable to discover the differences between the 2 programs in the JDBC driver usage.
Does this sounds familiar to someone ?
François -
Hi All
I need some help here , One of our clients doesnot report on vat or can't not claim , but the vendors they deal with some are vat vendors and do claim so it need to be shown on the marketing docs.
So what we've done is on the client side we used a UDF to display the vat amount per line.
So i need a query that will perform task like this.
Scenario.
Supplier is vat vendor then client selects a UDF with YES or No ( Defaults to No) , then based on the selection the Tax Amount UDF must be updated automatically by the query running in the back ground.
something more like this :- if vat udf = 1 ( Yes) then price x 0.14 --- tax amount
then the total must be be combination off the two fields price plus tax amount.
Hope it makes sense.
BonganiHi Bongani,
It is better if you can use tax code to deal with this problem. The line total calculation is hard coded by system. If you try to add your calculation to it, you may voliate the support agreement with SAP.
UDF is used to facilate grouping, categorying or something similar. Or if you want some numbers in parall to system value, you can hold them in UDF.
Thanks,
Gordon -
SP_Transaction Notification Query for Transaction Category field
Dear Experts,
I want to make Transaction Category field mandatory under Tax Tab on Sales Order document and being tried SP_Transaction Notification.
Please send me right query or any other solution.....
Thanks.....Hi!
Try this
IF (@object_type = '17')
BEGIN
if (@transaction_type in ('A','U'))
BEGIN
if exists ( Select R0.Docentry from ORDR R0, RDR12 R12 where R0.Docentry=@list_of_cols_val_tab_del and
R0.Docentry=R12.Docentry and (R12.Transcat is Null or R12.Transcat=''))
BEGIN
set @error = 0
END
ELSE
BEGIN
set @error_message='Enter the Transaction Code in Tax Tab'
set @error=1
END
END END
Regards,
[Thanga Raj K|Q3 Wrap-Up: What happened in the third quarter of 2009 in the SAP Business One Community] -
Query for displaying columns in reverse order ?
Hi All,
I want to select/display all the columns of a table in reverse order. The no. of columns is arbitrary.
Can anyone please help me on this.\
Regards
-AKJapart from the physical data store implementation,
are columns actually guaranteed ordering ? Guaranteed.... probably not, but they are in the data dictionary in the order in which they are created, so are known to be consistent in that respect.
I don't think it's correct to refer to C(1)...C(n) ,
they are just columns, there's no particular reason
why one should come first or lastLikewise, I don't see the point in selecting columns out in a particular order unless you're trying to spool the output to a file. -
Hi, is there a way to set sql query for a column?
the query should take value from column in the table.
in my case, it has come down for a need to have a nested select query inside my query:
select app.application_id,
(SELECT LISTAGG(typ.verification_name, ', ') WITHIN GROUP (ORDER BY typ.verification_id) FROM
typ,chk where
chk.application_id = app.application_id
GROUP BY app.application_id ) AS verification_type,
from tablea,tableb where....
<note that application_id is coming from the bigger query , aka another column from another table.>
i've tried
CAST ( EVALUATE_AGGR('LISTAGG(%1,%2) WITHIN GROUP (ORDER BY %3 DESC)', "typ"."verification_name", ', ', "chk "."application_id ") AS CHARACTER ( 50 ))
but my query need more than few EVALUATE_AGGR resulting in huge query in the log plus it's hard to put more details from other tables when you do this since everything buble down to the group by in the end of the query.
pls help if there's something even close to thisHi jan ,
thanx for your interest but let me clear with my requirement. What I want to do is that after executing the view query I want to navigate through records and sets some property or a group of property ( think it as a java object which holds properties ) for that cell and after that when I Navigate through record I don't want to run my logic for calculating properties again and I should be able to get those properties which I set earlier. There can be any number of records and most of time value will remain same then why should I calculate properties every time I navigate.
Currently I am storing these values in a separate class (with row and column no.)but now I am searching some way so that I can store those values in my view only.
Is it possible in BC4J view ? I heard that something like this is provided in BC4J view but not able to find out..
thanx once again
I welcome some other suggestions on it.. -
VO Auto Refresh error - Unsupported query for Continuous Query Notification
I created a read only view object and set the auto refresh property to true. According to the documentation that was all that need to be done in order to enable auto-refresh for a view instance of a shared application module (which I am using to retrieve reference data). When I run a test, I get the following error:
[371] DCBindingContainer.reportException :oracle.jbo.SQLStmtException
[372] oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT
CCIPO_REF_SENSITIVITY_LEVEL.SENSITIVITY_ID SENSITIVITY_ID,
CCIPO_REF_SENSITIVITY_LEVEL.SENSITIVITY_DESC SENSITIVITY_DESC
FROM
CCIPO_REF_SENSITIVITY_LEVEL
at oracle.jbo.server.BaseSQLBuilderImpl.processException(BaseSQLBuilderImpl.java:3721)
at oracle.jbo.server.OracleSQLBuilderImpl.processException(OracleSQLBuilderImpl.java:4722)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1386)
at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:928)
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:6968)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1183)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1037)
at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2774)
at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2751)
at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1580)
at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3500)
at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:9943)
at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:779)
at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:679)
at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:474)
at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4437)
at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:347)
at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1605)
at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:116)
at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:88)
at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:71)
at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
at oracle.jbo.jbotester.form.JTForm.<init>(JTForm.java:72)
at oracle.jbo.jbotester.form.BindingForm.<init>(BindingForm.java:50)
at oracle.jbo.jbotester.form.FormType$1.createForm(FormType.java:63)
at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
at oracle.jbo.jbotester.tree.Tree.processTreeMouseClicked(Tree.java:728)
at oracle.jbo.jbotester.tree.Tree.access$100(Tree.java:96)
at oracle.jbo.jbotester.tree.Tree$TreeMouseListener.mouseClicked(Tree.java:141)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
at java.awt.Component.processMouseEvent(Component.java:6292)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6054)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4652)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:603)
at java.awt.EventQueue$1.run(EventQueue.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:617)
at java.awt.EventQueue$2.run(EventQueue.java:615)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.sql.SQLException: ORA-29983: Unsupported query for Continuous Query Notification
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1262)
... 65 more
The query is selecting two varchar2 columns and according to the criteria in the documentation is valid to be registered for QRCN in Guaranteed Mode. Any thoughts?
JDev version: JDeveloper 11.1.1.5.0.Well, could be a DB bug. I seem to remember that there was a bug in that area in an older version of 11g.
Or you could use jnettrace to trace the calls made by the driver to the DB. That should show you what's going wrong.
Sascha -
[Oracle 8i] Query for N rows by column value?
I was just wondering if what I want to do is possible within my query (rather than programmatically)...
I want to return the N most recent records for each unique value in a particular column.
Here's a sample table:
CREATE TABLE orders
( order_no numeric(10)
part_no varchar(5)
close_date date
order_qty numeric(10)
scrap_qty numeric(10)
CONSTRAINT order_pk PRIMARY KEY (order_no)
);And some sample data....
INSERT INTO orders VALUES
(0000012345,'ABC-1',TO_DATE('01-01-2010','mm-dd-yyyy'),10,1);
INSERT INTO orders VALUES
(0000013498,'ABC-1',TO_DATE('01-05-2010','mm-dd-yyyy'),12,2);
INSERT INTO orders VALUES
(0000033452,'ABC-1',TO_DATE('01-10-2010','mm-dd-yyyy'),5,0);
INSERT INTO orders VALUES
(0000001468,'ABC-1',TO_DATE('01-15-2010','mm-dd-yyyy'),15,1);
INSERT INTO orders VALUES
(0000022349,'BR723',TO_DATE('01-03-2010','mm-dd-yyyy'),8,1);
INSERT INTO orders VALUES
(0000069581,'BR723',TO_DATE('01-05-2010','mm-dd-yyyy'),5,0);
INSERT INTO orders VALUES
(0000436721,'BR723',TO_DATE('01-10-2010','mm-dd-yyyy'),14,1);
INSERT INTO orders VALUES
(0000213446,'A5001',TO_DATE('01-06-2010','mm-dd-yyyy'),5,1);
INSERT INTO orders VALUES
(0000327987,'A5001',TO_DATE('01-08-2010','mm-dd-yyyy'),5,0);
INSERT INTO orders VALUES
(0000041353,'A5001',TO_DATE('01-14-2010','mm-dd-yyyy'),12,1);
INSERT INTO orders VALUES
(0000011241,'A5001',TO_DATE('01-15-2010','mm-dd-yyyy'),5,1);In this example, what I want to return are the 2 most recent orders (by close_date) for each part number.
Here is a table with the results I want to get, based on the scenario above:
order_no part_no close_date order_qty scrap_qty
0000001468 'ABC-1' '01-15-2010' 15 1
0000033452 'ABC-1' '01-10-2010' 5 0
0000436721 'BR723' '01-10-2010' 14 1
0000069581 'BR723' '01-05-2010' 5 0
0000011241 'A5001' '01-15-2010' 5 1
0000041353 'A5001' '01-14-2010' 12 1Is it possible to write a query to get these results, or am I going to have to query for all available data, and find the 2 most recent rows programmatically?
Thanks in advance!Hi,
user11033437 wrote:
I'm going to test that out right now. I think if it works, I may need to use dense_rank() rather than rank(), because it is possible that two orders for the same part number could have the same close date, and according to what I've looked up on the rank() and dense_rank() functions, rank() can give non-consecutive results if the values are the same.What's wrong with non-consecutive values?
Use RANK, DENSE_RANK or ROW_NUMBER depending on what you want.
For example; say a certain part has been ordered 8 times:
3 times with close_date January 29, 2010 (all at exactly the same time),
4 times with close_date January 28, 2010 (all at exactly the same time), and
1 time with close_date January 27, 2010.
If you ask for the last 2 rows:
RANK will give you the 3 rows from January 29. (All 3 have an equal claim to being in the top 2.)
DENSE_RANK will give you the 7 rows from January 28-29 (the last two values , regardless of how many rows have them).
ROW_NUMBER will give you 2 rows from January 29. (Which 2? It's arbitrary unless you add a tie-breaker to the ORDER BY clause.)
All these functions are available in Oracle 8.1. -
Query not showing result for 1st column
dear all,
i want to show the result row for my query for the 1st column...
e.g. i have column cost center, po number and vendor both po number and vendor will show the result column but not cost center.. any idea why?
here are my bex settings for cost center
supression = never, normalization = no normalization.Hello -
You check for costcenter data in the data targets, for the given PO and vendors,.
If data exists then it should be available in the reports,.
Else it won't .
Regards,
Vishwa
Maybe you are looking for
-
Using a button to open an SWF in the same player...
Hello, I seem to be having some trouble figuring out the proper kind of script that would allow me to use a button to call up and play a new SWF in the exisiting player (in this case, the projector). I am working on an interactive presentation which
-
Print Bold Character in Character Mode Report
I design report in character mode. but i want to print one filed in bold character and one column with underline. i am using epson lq-2180 printer. i tried to use printer file code but it is not working. so can anyone help me. if possible than write
-
'Storage bin field in material master
Can we increase character length of 'Storage Bin' field in material master so that bin details can be accomodated ?
-
XMPFile library for Java - when?
What are the latest plans for developing the XMPFile library for Java? We are really in great need of this and would be most appreciative if it could be developed and made available as soon as possible. Thanks, Kent
-
Since updating tonight 2-17-11 Flash player not working on some sites
Hello, Prior to updating Flash Player tonight I was able to watch videos on the following website. Now, after updating, I cannot and get a white area instead of the video. I have the same effect on 3 other computers, running different versions of