Anyone used setJMSReplyTo functionality to get response from MDB?
Ok, so now that I know how to send a message to a MDB via JMS/AQ, how can I get a reply to that message from the MDB?
I understand there is a setJMSReplyTo method that can reply to a "temporary queue" but I haven't seen any reference to this in OC4J.
Can anyone tell me if setJMSReplyTo can be used with OC4J?
Thanks
Hi Doug,
I haven't got an answer for you -- just some pointers to other resources
that may be of help (if you aren't already aware of them):
http://tahiti.oracle.com
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
Good Luck,
Avi.
Similar Messages
-
How to get response from such a function
How to get response from such a function (in MODULE USER_COMMAND_0010 INPUT I get "ODGOVOR" 'X'
FUNCTION Z_SEENKRAT.
""Local Interface:
*" EXPORTING
*" REFERENCE(ODGOVOR) TYPE MSEG-KZEAR
DATA ok_code LIKE sy-ucomm.
DATA: test like mseg-kzear.
BREAK-POINT.
call screen 10.
test = ODGOVOR.
ENDFUNCTION.
*& Module CLEAR_OK_CODE OUTPUT
text
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE. " CLEAR_OK_CODE OUTPUT
*& Module USER_COMMAND_0010 INPUT
text
MODULE USER_COMMAND_0010 INPUT.
DATA odgovor LIKE mseg-KZEAR.
CASE ok_code.
WHEN 'DA'.
ODGOVOR = 'X'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0010 INPUTHi,
You need to declare the ODGOVOR variable in the TOP include, then you will get the value
Regards
Sudheer -
How to get response from an asynchronous BPEL process in Java
I'm experimenting with BPEL and doesn't seem to be able to get response from an asynchronous BPEL process. Here's the deal:
I have a BPEL process that takes a string as input, and gives another string as output. This is a asyncronous process.
I want to initiate this BPEL process as a web service so I generate a Webservice Proxy in JDeveloper 10g (10.1.3.0.4). The function to call the process is now called "initiate" and takes three arguments: the input string, a "org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo" and a
"org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID".
HTTP-Analyzer shows that invoking the BPEL process with initiate("somestring", null, null) results in sending a SOAP message to the BPEL process, which returns a "202 Accepted". How do I get the response from the process? My intuition tells me that I have to use that second argument, that EnpointReferenceType thing. How do I use that?
Another question: If a asynchronous BPEL process does not exists (so the endpoint does not exist) the Java proxy does not throw an error when runned. It does not even sends a message. It exits with status 0! (This happens for example when deploying a new version of a process and when the "old" version is undeployed). Calling a non-existing synchronous BPEL process, the Java proxy DOES throw an error.Clemens,
That all sounds logical. But somehow it is still a mystery for me ... Somehow I don't see what should be done.
To call the async BPEL process I have the following procedure:
initiate(String input, org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo, org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID)
The first argument is the input for my BPEL process. The second is the address to a webservice that should handle the callback, right? The third is a messageID (makes sense, but why of the type AttributedURI?).
Here lies my problem. It is not clear to me how these EndpointReferenceType & AttributedURI work. I can't find anything on the net about it. The AXIS examples as where mentioned earlier use other types (namely the "org.xmlsoap.schemas.ws.addressing.MessageID" and "org.xmlsoap.schemas.ws.addressing.ReplyTo") which are completely different.
What I did so far:
- I created an webservice proxy that listens on the onResult endpoint of the BPEL process.
- I created an webservice proxy that calls the BPEL process through the initiate procedure, but it is not completely clear to me how to construct the EndPointreferenceType replyTo, and the MessageID. I did something like this:
EndpointReferenceType replyTo = new EndpointReferenceType();
// callback service running on local machine
// This URI class is the java.net's version
URI replyToURI = new URI("http://vaccinatie:8988/syncro-callback-context-root/stringconcatCallbackBindingPort");
// This AttributedURI is the org.xmlsoap.schemas.ws._2003._03.addressing's version
AttributedURI address = new AttributedURI();
// the only public methos that made sense to me:
address.set_value(replyToURI);
replyTo.setAddress(address);
// call the BPEL process
myPort.initiate("test123", replyTo, address);
But the above doesn't work (largely because I don't know what I'm doing here prob.:-) ) It does send the "test123" message, and the BPEL process does process it, but I don't seem to get the callback right.
I hope this makes my problems somewhat clearer. I hope someone can help me, because I'm just a beginner in this whole "web service area" and seems to do something terribly wrong here, because it should be very simple. Thx. -
Can i play music and use mirroring function at same time from ipad2 to apple tv
can i play music and use mirroring function at same time from ipad2 to apple tv
Yes, any audio during the "mirroring" funtion will forward to the appletv. This includes all system audio, games, apps, ect. If you slide the mute botton the side of your ipad to mute then you can block app audio and just get Music audio or Pandora if you are using pandora.
-
Use SQL function to get the original order number using the invoice number
Hi All,
wondering is someone can help me with this challenge I am having? Often I need to return the original order numbers that created the resulting invoce. This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement. the code i currently have is:
Use SQL function to get the original order number using the invoice number
CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
RETURNS nvarchar(200)
AS
BEGIN
DECLARE @OrderList nvarchar(200)
SET @OrderList = ''
SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
FROM OINV AS T1 INNER JOIN
INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
ORDR AS T6 ON T5.DocEntry = T6.DocEntry
WHERE T1.DocNum = @InvNum
RETURN @OrderList
END
it is run by the following query:
Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
From OINV T1
Where T1.DocNum = 'your invoice number here'
The issue is that this returns the order number for all of the lines in the invoice. Only want to see the summary of the order numbers. ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
If this was a simple reporting SELECT query I would use SELECT DISTINCT. But I can't do that.
Any ideas?
Thanks,
MikeThanks Gordon,
I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice. However, I have managed to solve my own problem with a GROUP BY statement!
Others may be interested so, the code is this:
CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
RETURNS nvarchar(200)
AS
BEGIN
DECLARE @OrderList nvarchar(200)
SET @OrderList = ''
SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
FROM OINV AS T1 INNER JOIN
INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
ORDR AS T6 ON T5.DocEntry = T6.DocEntry
WHERE T1.DocNum = @InvNum
GROUP BY T6.DocNum
RETURN @OrderList
END
and to call it use this:
Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
From OINV T1
Where T1.DocNum = 'your invoice number' -
Hi,
I am doing RFC to File. I could generate the FILE successfully. But I am not getting Response from RFC. I am getting empty payload. I am doing with out BPM. I did succesfully File-RFC-File. but here RFC is the sender. I have some doubts in defining Interface mapping and Message Mapping. Is this a Syscronous scenario by default ?
If I want to get the resonse of RFC to a file. How many Receivers and Senders do i need to create?
Regards,
Varun
Edited by: Varun on Sep 9, 2008 1:00 PMhi,
Map Rfc.response to the File; hence rfc sender adapter and file receiver adapter..one sender n 1 receiver.Remember:
1. In the report that makes the call to XI , make sure that you use call RFC in a background task.
2. Make sure you use Commit Work at the end of the report.
Follow:
Send RFC to SAP XI Asynchronous
Also pls visit
Re: RFC to FILE
for the same scenario.
Thanks,
Durga
Edited by: NagaDurga Nannapaneni on Sep 9, 2008 10:55 AM -
So, I've purchased a Mac mini to replace my aging Mid 2009 mini on which I've been running Mavericks Server. In trying to answer the question of how best to move services from the old machine to the new, I've stumbled into the fact that Migration Assistant can apparently migrate not just user data for workstations and laptops, but also service data for servers. The problem is there isn't much detail in the docs about how good a job it does when going from one machine to another without changing OS releases. There's a very detailed document in the KB about going from older versions of Server to new (OS X Server: Upgrade and migration from Lion Server or Snow Leopard Server) and a general doc on migrating from another Mac under Mavericks (OS X: How to migrate data from another Mac using Mavericks) but that has no details about Server.
Has anyone used Migration Assistant to move services from one system running Server to a new system? Are there any details that are particularly important to get right? Are there things that require manual steps after Migration Assistant is done?
There are other ways I could tackle the problem, of course. I could simply swap drives between the systems, but the new system has two drives that are bigger, faster, and I intend to mirror them. That would complicate such an approach. I'd really like to keep the conversation constrained to a discussion of Migration Assistant as the primary method.yes. I migrated a server frm lion to mavericks following these notes a while back:
OS X Server: Upgrade and migration from Mountain Lion
i do not recall having any problems with it. -
i am trying to update my ibook 10.4.11so i tryed leopard but it said i needed 10.5 anyone know where i can get this from or anyother ideas please help
What is your need to upgrade to Leopard? So you can sync to iPhone, iPad, etc?
Mac OS X 10.5 Leopard installation system requirements
http://support.apple.com/kb/TA24950
Leopard is no longer available at the Apple Store but may be available by calling Apple Phone Sales @ 1-800-MY-APPLE (1-800-692-7753).
If you can't obtain a retail install DVD from Apple, look on eBay or Google the installer part numbers to possibly find at an on-line store. Here's what to look for:
MB427Z/A Leopard 10.5.1 install DVD
MB576Z/A Leopard 10.5.4 install DVD
MB021Z/A Leopard 10.5.6 install DVD (single user)
MB022Z/A Leopard 10.5.6 install DVD (5-user family pack)
Installing Mac OS X 10.5 Leopard
http://support.apple.com/kb/HT1544
Mac OS X 10.5 Leopard Installation and Setup Guide
http://manuals.info.apple.com/en/leopard_install-setup.pdf
After you install the base 10.5, download & install the 10.5.8 combo update at http://support.apple.com/downloads/Mac_OS_X_10_5_8_Combo_Update
The DVD should look like this
Caution - Leopard does not support classic mode. So, if you currently open OS 9 apps in classic mode, you won't be able to do this if you upgrade to Leopard.
Cheers, Tom -
Getting response from a server
im working on a simple smtp mail sender and i want to get responses to the commands that i post to the DataOutputStream. in all examples on java.sun.com and the net, there is a while block used for reading response from the server.
while((c=is.read()) != -1)
sb.append((char)c);
this code did not work on my application, i changed a bit like below:
/**Get a response from server */
private String getResponse() throws IOException {
int CR = 0, LF = 0;
int c;
char ch;
int count = 0;
StringBuffer sb = new StringBuffer();
while (true) {
c = is.read();
count++;
ch = (char) c;
if (c == -1) {
break;
else if (ch == '\r') {
CR = count;
else if (ch == '\n') {
LF = count;
if (LF - 1 == CR) { //CRLF seen
sb.append(ch);
break;
sb.append(ch);
return sb.toString();
and i use this function in my code as
os.write( ("QUIT\r\n").getBytes());
System.out.println("QUIT : " + getResponse());
this works, because it returns a single line that has a CRLF at the and of line, but if i want to read multi-line responses like greeting messages, i tried to change the code as on the examples like:
/**Get a response from server */
private String getResponse() throws IOException {
int c;
StringBuffer sb = new StringBuffer();
while((c=is.read()) != -1)
sb.append((char)c);
return sb.toString();
this code does not work, because i cannot reach the end of stream. i want to post one command and get one response for that command.
how an algorithm i can develop to solve this problem?
thanks for all help.i changed the code and it's working well now:
/**Get a response from server */
private String getResponse() throws IOException {
int c;
if((c=is.read()) != -1) {
byte[] b = new byte[is.available()];
StringBuffer sb = new StringBuffer();
is.read(b);
sb.append((char)c);
for(int i=0; i<b.length; i++) {
sb.append((char)b);
return sb.toString();
return "";
if you directly use is.available() when there is no response currently available, it returns 0. we wait for the first character of server response, and then use is.available(). thanks to Kay_Kadner for the idea.
(im a newbie, and dont know how to convert byte[] to String, tried b.toString() but only got meaningless values) -
One socket and two ports, not getting response from the server
Hi everyone,
I am working on device which communicate through Tcp sockets, It has an IP address and one port for listening and another for sending the response.
Problem is that I am able to create a connection to Device ip+port, and i am trying to listen on the same port while the device is sending the response on other port. My problem is that i can't create another socket using this port and therefore not getting the response from the device.
Can you people tell me how to handle such socket communication in java ?
Thanks in advance.I am working on device which communicate through Tcp sockets, It has an IP address and one port for listening and another for sending the response.Are you sure? That's not usual. It would be usual for it to use the same port for listening, reading, and writing.
Problem is that I am able to create a connection to Device ip+port, and i am trying to listen on the same port while the device is sending the response on other port.I would try just reading from the same socket you are sending on. I suggest you have misunderstood how the device works. -
Why im getting too long time in getting response from server in RMI???
I'm using RMI architecture. On my server side I put this method getRubricHierarchy() which returns the ArrayList of Test class objects. everything is working properly fine.
Im getting response properly, problem is its taking very long time in getting the response. method populate and create ArrayList in 0 second at server side but its taking more than 20 seconds to get response at client side.
My arraylist size is 30,000.
Any suggestions to reduce the time.
below you can see the code.
public List<Test> getRubricHierarchy(String strTree,String gblCombinedRepSectionID,String gblCompleteRepSectionID,String gblCompleteRepertoryID,Map authMap) {
Connection con=null;
ResultSet rs = null;
List<Test> l = new ArrayList<Test>();
List allList = new ArrayList();
con = createDBCon();
rs = con.createStatement().executeQuery("select * from rubric where sectionid='"+gblCombinedRepSectionID+"' order by orders");
Map parentMap = new HashMap();
while (rs.next()) {
Test rNode = new Test();
String rubrid = rs.getString("id");
final String desc = rs.getString("name");
rNode.setRubricName(desc);
rNode.setRubricID(rubrid);
rNode.setAuthor(rs.getString("repid"));
final int levlId = rs.getInt("levelid");
rNode.setRubLevel(levlId);
rNode.setCrossRef(rs.getString("CROSSREFERENCE"));
final String parentID = rs.getString("PARENTID");
rNode.setParentID(parentID);
rNode.setSectionID(rs.getString("sectionid"));
if (parentID.equals("0")) {
l.add(rNode);
allList.add(rNode);
List rmdyLst = (List) parentMap.get(parentID);
if (rmdyLst == null) {
rmdyLst = new ArrayList();
parentMap.put(parentID, rmdyLst);
rmdyLst.add(rNode);
rs.close();
for (Iterator iterator = allList.iterator(); iterator.hasNext();) {
Test rNodes = (Test) iterator.next();
List remdyLst = (List) parentMap.get(rNodes.getRubricID());
if (remdyLst != null) {
rNodes.setChildren(remdyLst);
for (Iterator iterator2 = remdyLst.iterator(); iterator2.hasNext();) {
Test rn = (Test) iterator2.next();
rn.setParent(rNodes);
}catch(Exception e){
e.printStackTrace();
return l;
}here is my Test Class
public class Test implements Serializable,Cloneable , MutableTreeNode{
private String strRubricID,strOldRubricID,strRubricName,strCrossRef,Author,strParentID,strSectionID;
private int rubLevel;
private List remedyList;
private List children = new ArrayList();
private Test parent;
private int order;
private String AuthorName="";
private String abbr;
private String treeType="";
private int noRem=-1;
private boolean isAddAsChild=false;
private String strRubricHie="";
private String user="";
public static final Enumeration<TreeNode> EMPTY_ENUMERATION = new Enumeration() {
public boolean hasMoreElements() {
return false;
public TreeNode nextElement() {
throw new NoSuchElementException("No more elements");
public Test(){
public void setUser(String user){
this.user = user;
public String getUser(){
return user;
public void setRubricHierarchy(String s){
this.strRubricHie=s;
public String getRubricHierarchy(){
return strRubricHie;
public Test(String treeType){
this.treeType = treeType;
public void setAddAsChild(boolean b){
this.isAddAsChild=b;
public boolean isAddAsChild(){
return isAddAsChild;
public Test getUserObject(){
return this;
public void setRubricID(String id){
this.strRubricID = id;
public String getRubricID(){
return strRubricID ;
public void setOldRubricID(String id){
this.strOldRubricID = id;
public String getOldRubricID(){
return strOldRubricID ;
public void setParent(Test r){
this.parent = r;
public Test getParent(){
return parent;
public void setParentID(String id){
this.strParentID = id;
public String getParentID(){
return strParentID;
public void setSectionID(String id){
this.strSectionID= id;
public String getSectionID(){
return strSectionID;
public void setRubricName(String name){
this.strRubricName = name;
public String getRubricName(){
return strRubricName;
public void setAuthorName(String name){
this.AuthorName = name;
public String getAuthorName(){
return AuthorName;
public void setAuthorAbbrivation(String a){
this.abbr = a;
public String getAuthorAbbrivation(){
return abbr;
public void setRubLevel(int rubLevel) {
this.rubLevel = rubLevel;
public int getRubLevel() {
return rubLevel;
public void setCrossRef(String strCrossRef) {
this.strCrossRef = strCrossRef;
public String getCrossRef() {
return strCrossRef ;
public void setRemedyList(List remedyList) {
this.remedyList = remedyList;
public List getRemedyList() {
return remedyList;
public void setAuthor(String Author) {
this.Author = Author;
public String getAuthor() {
return Author;
public void setChildren(List list) {
this.children = list;
public List getChildren() {
return children;
public void setOrder(int o){
this.order = o;
public int getOrder(){
return order;
public void setNumberOfRemedies(int no)
this.noRem = no;
public int getNumberOfRemedies()
return noRem;
public String toString() {
String value="";
value=strRubricName+ " ("+abbr+")";
return value;
public Object clone(){
Test rubric = new Test();
rubric.Author = Author;
rubric.children = children;
rubric.order = order;
rubric.parent = parent;
rubric.remedyList = remedyList;
rubric.rubLevel = rubLevel;
rubric.strCrossRef = strCrossRef;
rubric.strParentID = strParentID;
rubric.strRubricID = strRubricID;
rubric.strRubricName = strRubricName;
rubric.strSectionID = strSectionID;
return rubric;
@Override
public TreeNode getChildAt(int paramInt) {
if (this.children == null) {
throw new ArrayIndexOutOfBoundsException("node has no children");
final TreeNode node = (TreeNode) children.get(paramInt);
return node;
@Override
public int getChildCount() {
if (this.children == null) {
return 0;
return children.size();
@Override
public int getIndex(TreeNode paramTreeNode) {
// TODO Auto-generated method stub
return 0;
@Override
public boolean getAllowsChildren() {
return true;
@Override
public boolean isLeaf() {
return children.isEmpty();
@Override
public Enumeration children() {
if (this.children == null) {
return EMPTY_ENUMERATION;
Vector v = new Vector(this.children);
return v.elements();
@Override
public void insert(MutableTreeNode newChild, int paramInt) {
if (newChild == null) {
throw new IllegalArgumentException("new child is null");
MutableTreeNode oldParent = (MutableTreeNode) newChild.getParent();
if (oldParent != null) {
oldParent.remove(newChild);
newChild.setParent(this);
if (children == null) {
children = new ArrayList();
children.add(paramInt, newChild);
@Override
public void remove(int childIndex) {
MutableTreeNode child = (MutableTreeNode) getChildAt(childIndex);
children.remove(childIndex);
child.setParent(null);
@Override
public void remove(MutableTreeNode aChild) {
if (aChild == null) {
throw new IllegalArgumentException("argument is null");
if (!isNodeChild(aChild)) {
throw new IllegalArgumentException("argument is not a child");
remove(getIndex(aChild)); // linear search
public boolean isNodeChild(TreeNode aNode) {
boolean retval;
if (aNode == null) {
retval = false;
} else {
if (getChildCount() == 0) {
retval = false;
} else {
retval = (aNode.getParent() == this);
return retval;
@Override
public void setUserObject(Object paramObject) {
// TODO Auto-generated method stub
@Override
public void removeFromParent() {
MutableTreeNode parent = (MutableTreeNode) getParent();
if (parent != null) {
parent.remove(this);
@Override
public void setParent(MutableTreeNode paramMutableTreeNode) {
parent = (Test) paramMutableTreeNode;
* Returns the path from the root, to get to this node. The last element in
* the path is this node.
* @return an array of TreeNode objects giving the path, where the first
* element in the path is the root and the last element is this
* node.
public TreeNode[] getPath() {
return getPathToRoot(this, 0);
* Builds the parents of node up to and including the root node, where the
* original node is the last element in the returned array. The length of
* the returned array gives the node's depth in the tree.
* @param aNode
* the TreeNode to get the path for
* @param depth
* an int giving the number of steps already taken towards the
* root (on recursive calls), used to size the returned array
* @return an array of TreeNodes giving the path from the root to the
* specified node
protected TreeNode[] getPathToRoot(TreeNode aNode, int depth) {
TreeNode[] retNodes;
* Check for null, in case someone passed in a null node, or they passed
* in an element that isn't rooted at root.
if (aNode == null) {
if (depth == 0)
return null;
else
retNodes = new TreeNode[depth];
} else {
depth++;
retNodes = getPathToRoot(aNode.getParent(), depth);
retNodes[retNodes.length - depth] = aNode;
return retNodes;
}You have an O(N**2) algorithm at the end that is rather ill-considered. It seems to me at first glance that it could be combined int the previous loop.
-
How to use Min function to get FileName into a Variable
I was wondering how to use MIN function in Evaluate variable in package to get the first file name from the list(Datastore)
With reference to Merging Flat Files into a single file Post number-4
ThanxHi Diwakar,
That List data store should be table, than only it will gives the min of the filename string,
If it is a file datastore, Min function does not works properly it will returns a first name in the file data store.
so please, use an interface to upload the List filedatastore into some other temp table. From that table you can use variable to get Min value of file name.
Thanks
Madha -
Not getting response from Client Proxy
Hi,
We are developing a scenario - File->PI->Proxy using ABAP Proxies.We are posting a file thru PI 7.0 to R/3 .In R/3 the server proxy(Inbound Asynchronous) will receive the message and BAPI will be called. The response from the BAPI will be reaching the server proxy and passed to the client proxy(Outbound Asynchronous).
Server Proxy(request) --> BAPI --> Server Proxy(response) --> Client Proxy(response)
The response from the client proxy has to be send to PI and a file will be generated as the output.
Can anyone provide me suggestions to call client proxy from a server proxy by passing the response message to client proxy???
Thanks in advance.
Regards,
DibyajyotiHi,
I hope, you are done till the Implementation of Server Proxy, where you are calling a Bapi and passing the Input variables the Interface received and BAPI is giving a response back.
Now your question, how to send the response back Asynchronously.
I think, you have to do the same, what you do for a client proxy and at last call the method EXECUTE_ASYNCHRONOUS before the Final Commit Staement. I think this should work.
But using Synchronous Interface in such cases is always a handy and easier option.
Regards,
Subhendu -
Using analytic function to get the right output.
Dear all;
I have the following sample date below
create table temp_one
id number(30),
placeid varchar2(400),
issuedate date,
person varchar2(400),
failures number(30),
primary key(id)
insert into temp_one values (1, 'NY', to_date('03/04/2011', 'MM/DD/YYYY'), 'John', 3);
insert into temp_one values (2, 'NY', to_date('03/03/2011', 'MM/DD/YYYY'), 'Adam', 7);
insert into temp_one values (3, 'Mexico', to_date('03/04/2011', 'MM/DD/YYYY'), 'Wendy', 3);
insert into temp_one values (4, 'Mexico', to_date('03/14/2011', 'MM/DD/YYYY'), 'Gerry', 3);
insert into temp_one values (5, 'Mexico', to_date('03/15/2011', 'MM/DD/YYYY'), 'Zick', 9);
insert into temp_one values (6, 'London', to_date('03/16/2011', 'MM/DD/YYYY'), 'Mike', 8);this is output I desire
placeid issueperiod failures
NY 02/28/2011 - 03/06/2011 10
Mexico 02/28/2011 - 03/06/2011 3
Mexico 03/14/2011 - 03/20/2011 12
London 03/14/2011 - 03/20/2011 8All help is appreciated. I will post my query as soon as I am able to think of a good logic for this...hI,
user13328581 wrote:
... Kindly note, I am still learning how to use analytic functions.That doesn't matter; analytic functions won't help in this problem. The aggregate SUM function is all you need.
But what do you need to GROUP BY? What is each row of the result set going to represent? A placeid? Yes, each row will represent only one placedid, but it's going to be divided further. You want a separate row of output for every placeid and week, so you'll want to GROUP BY placeid and week. You don't want to GROUP BY the raw issuedate; that would put March 3 and March 4 into separate groups. And you don't want to GROUP BY failures; that would mean a row with 3 failures could never be in the same group as a row with 9 failures.
This gets the output you posted from the sample data you posted:
SELECT placeid
, TO_CHAR ( TRUNC (issuedate, 'IW')
, 'MM/DD/YYYY'
) || ' - '|| TO_CHAR ( TRUNC (issuedate, 'IW') + 6
, 'MM/DD/YYY'
) AS issueperiod
, SUM (failures) AS sumfailures
FROM temp_one
GROUP BY placeid
, TRUNC (issuedate, 'IW')
;You could use a sub-query to compute TRUNC (issuedate, 'IW') once. The code would be about as complicated, efficiency probably won't improve noticeably, and the the results would be the same. -
Socket Programming-Not getting response from server.
Hi,
I am trying to communicate with server using java socket programming, I am getting the response for first two times third time when I am trying to write some thing I am not getting any response from the server,
I am writing to migrate the vb code to Java the vb is using a c++ dll to communicate with the server and we tried accessing the dll from java using JNI then it is working fine, this dll is dependent on windows so we want to avoid the dependency with windows that is why we are going for socket programming, Please help on this.Hi,
I am writing the data in forms of string
like
Socket sockt = new Socket(ipAddress, portNo);
out= new DataOutputStream(sockt.getOutputStream());
in = new DataInputStream(sockt.getInputStream());
out.writeBytes("Serv");
out.writeBytes("Serv,32");
out.writeBytes("home,serv32,run.prg,sucess");
these are the strings to communicate with server.
I am trying to read the same
StringBuffer buf = new StringBuffer();
byte b = '\0';
try {
while ((b = in.readByte()) != '\0')
char ch = (char) b;
buf.append(ch);
} catch (Exception e) {
System.out.println(e.getStackTrace());
we are getting the response for the first two strings, but for the third string it is getting stucked for some time and returing some junk values like '???' we are sending the same string using JNI and it is working.
Maybe you are looking for
-
i run windows 7 on a sony y series. before upgrading to 6.0 firefox worked seamlessly. now it will not open any websites at all. i have uninstalled and reinstalled it to no avail. thoughts? help? ...
-
Automatic G/L Account Determination
Dear all, Pls tell me which transaction key used for transportation? Thanks, Quanglv
-
How does one transfer all of the relevant files of PSE to a new computer? Example, I have PSE 7 on Computer A and want to transfer/setup on Computer B all of the relevant files needed by PSE 7. I do know the location of the files of the pictures but
-
Need some examples how to handle execptions in bpm
hi guys, can any one provide an link where i can get some examples how to handle exceptions and fork etc., in bpm regrds viswa
-
I restarted my computer and now it's stuck on the white screen with Apple logo and keeps doing the thinking/loading Process.