Database control: how to read output of sproc that returns result set
I have a stored procedure that returns a result set. Should I use a RowSet control to wrap this, or a database control, or neither? Am I better off with straight JDBC in a Java control?
Thanks.
Sorry for missing the point totally...
DOKTL also contains long text for FM parameters...
This is a modified version of your code that retrieves the long text and displays it...
DATA: parameter TYPE TABLE OF swotfupar,
ls_parameter LIKE LINE OF parameter,
search_string TYPE doktl-object,
texttab type table of doktl-doktext with header line.
PARAMETERS: fubaname TYPE swcontdef-abapname
DEFAULT 'POPUP_TO_CONFIRM',
pa_lang TYPE sy-langu.
START-OF-SELECTION.
CALL FUNCTION 'SWO_QUERY_FUNCTION_PARAMETERS'
EXPORTING
functionmodule = fubaname
TABLES
function_parameters = parameter
* EXCEPTIONS
* FUNCTION_NOT_FOUND = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT parameter INTO ls_parameter.
CONCATENATE ` ` "30 spaces
ls_parameter-parameter INTO search_string.
OVERLAY search_string WITH fubaname.
SELECT doktext FROM doktl INTO TABLE texttab
WHERE id = 'FU'
AND langu = pa_lang
AND object = search_string.
WRITE:/ 'Long Text for', ls_parameter-parameter.
LOOP AT texttab.
NEW-LINE.
WRITE: AT 10 texttab COLOR COL_HEADING.
ENDLOOP.
ENDLOOP.
Hope this helps you
Regards,
Dushyant Shetty
Similar Messages
-
How to use stored procedure which returns result set in OBIEE
Hi,
I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
Pls help me in solving this.
ThanksHi Radha,
If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
If you want to use caching, you should enable caching in the nqsconfig.ini file.
Cheers,
Daan Bakboord -
How to read output rows in alv
I have made alv grid. i have given checkbox for user to select the row.
so how to read the selected rows.hi
*REPORT YMS_ALVINTER.
*& tables declaration
TABLES: VBRK,VBRP.
*& type-pools declaration
TYPE-POOLS: SLIS.
*& data declaration
DATA: G_REPID TYPE SY-REPID.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_EVENT TYPE SLIS_ALV_EVENT,
T_EVENT TYPE SLIS_T_EVENT.
DATA: V_VBELN LIKE VBRK-VBELN,
V_MATNR LIKE VBRP-MATNR.
DATA: BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN,
WAERK LIKE VBRK-WAERK,
VKORG LIKE VBRK-VKORG,
FKDAT LIKE VBRK-FKDAT,
BUKRS LIKE VBRK-BUKRS,
NETWR LIKE VBRK-NETWR,
END OF IT_VBRK.
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN LIKE VBRP-VBELN,
POSNR LIKE VBRP-POSNR,
FKIMG LIKE VBRP-FKIMG,
VRKME LIKE VBRP-VRKME,
NETWR LIKE VBRP-NETWR,
MATNR LIKE VBRP-MATNR,
ARKTX LIKE VBRP-ARKTX,
END OF IT_VBRP.
*& selection screen
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
S_FKDAT FOR VBRK-FKDAT,
S_MATNR FOR VBRP-MATNR.
SELECTION-SCREEN END OF BLOCK B.
**INITIALIZATION.
INITIALIZATION.
G_REPID = SY-REPID.
S_FKDAT-LOW = SY-DATUM - 200.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
***AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
IF NOT S_VBELN IS INITIAL.
SELECT SINGLE VBELN FROM VBRK
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ2).
ENDIF.
ENDIF.
IF NOT S_MATNR IS INITIAL.
SELECT SINGLE MATNR FROM MARA
INTO V_MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ2).
ENDIF.
ENDIF.
***START-OF-SELECTION.
START-OF-SELECTION.
PERFORM GET_DATA_VBRK.
*& Form GET_DATA_VBRK
text
--> p1 text
<-- p2 text
FORM GET_DATA_VBRK .
SELECT VBELN
WAERK
VKORG
FKDAT
BUKRS
NETWR
INTO TABLE IT_VBRK
FROM VBRK
WHERE VBELN IN S_VBELN
AND FKDAT IN S_FKDAT.
ENDFORM. " GET_DATA_VBRK
*& Form GET_DATA_VBRP
text
--> p1 text
<-- p2 text
FORM GET_DATA_VBRP .
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO TABLE IT_VBRP
WHERE VBELN = IT_VBRK-VBELN.
ENDFORM. " GET_DATA_VBRP
***END-OF-SELECTION.
END-OF-SELECTION.
PERFORM EVENT_LIST.
PERFORM GET_FIELD_CATALOG.
PERFORM LIST_DISP .
*& Form list_disp
text
FORM LIST_DISP .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'POPUP'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRK
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " LIST_DISP
*& Form GET_FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM GET_FIELD_CATALOG .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = G_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " GET_FIELD_CATALOG
*& Form event_list
text
--> p1 text
<-- p2 text
FORM EVENT_LIST .
CLEAR WA_EVENT.
WA_EVENT-NAME = 'USER_COMMAND'.
WA_EVENT-FORM = 'USER_COMMAND'.
APPEND WA_EVENT TO T_EVENT.
CLEAR WA_EVENT.
ENDFORM. " event_list
*& Form user_command
text
-->R_UCOMM text
-->RS_SELFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
PERFORM GET_DATA_VBRP.
PERFORM BUILD_FIELDCATALOG_VBRP .
PERFORM DISPLAY_ALV_VBRP.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATALOG_VBRP
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG_VBRP .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = G_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " BUILD_FIELDCATALOG_VBRP
*& Form DISPLAY_ALV_VBRP
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV_VBRP .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_VBRP
Message was edited by:
Rammohan Nagam
Message was edited by:
Rammohan Nagam -
My I-Touch launches into the Voice Over operation and I lose touch control, how do I get out of this mode and back to normal operation? What is causeing this to happen?
@wetdro
If your device has been jailbroken during the warranty, Apple will not service it.
Maybe you missed that in this article:
Inability to apply future software updates: Some unauthorized modifications have caused damage to iOS that is not repairable. This can result in the hacked iPhone, iPad, or iPod touch becoming permanently inoperable when a future Apple-supplied iOS update is installed.
Apple strongly cautions against installing any software that hacks iOS. It is also important to note that unauthorized modification of iOS is a violation of the iOS end-user software license agreement and because of this, Apple may deny service for an iPhone, iPad, or iPod touch that has installed any unauthorized software.
copied from Unauthorized modification of iOS can cause security vulnerabilities, instability, shortened battery life, and other issu… -
How to read from txt file that has words in between?
Hi all,
I am using Labview 8.2.
I would like to read from a text file. I have data (after each time it is has averaged over 100 waveforms) repeatedly stored on to the file. The idea is to further improve SNR in post processing by again averaging the data (that has been averaged over the 100 waveforms).
I can get LabView to save the data repeatedly into the file, so it keeps getting appended.
The problem is to read the data in labview so I can now again average it. The problem is the labview seperates the sets of data with the following:
" Channels 1
Samples 9925
Date 2008/10/28
Time 17:16:11.638363
X_Dimension Time
X0 -3.0125000000000013E-3
Delta_X 2.500000E-6
***End_of_Header*** "
So When I read it, it only sees the first set of data.
Can someone please tell me how to read all the sets of data in labview?
I have attached the file I want to read "acquiredwaveform.txt" and the basic VI (really basic btw) to read the file.
Thanks
Solved!
Go to Solution.
Attachments:
ReadFileAndAverage.vi 48 KB
acquiredWaveform.txt 605 KBThanks again DFGray for the comments.
After the correlations to find the peak positions, i just take the max value. And you are right the accuracy is limited by the number of samples per cycle. Perhaps it would be clearer if you see the code.
1) Basically I get a signal on the up and downslope of the sine wave. On the down slope however the signal is negative, i.e. its is flipped. So before I shift and average...I 'cut' the waveform into 4 (when cycles per buffer = 2, then I get 4 signals, 2 on the up slope and 2 on down slope) bits. Counting from one, I flip the even number, cut it, and but an array of waveforms which is then sent to be convolved and shifted.
2) Array of waveforms are stored to be phased shifted (Convolve and shift vi) and averaged (entire averaging vi which uses the convolve and shift vi as a sub vi).
* Phase shifting doesn't work when I cut and put it together (So something is wrong in cut waveform vi)
* Also if it isn't too time consuming could you give me an example of interpolating and shifting thing.
* Also if you have any comments regarding the following VIs please let me know.
Thanks
Attached is:
1) Cut waveform vi
2) Convolve and shift
3) Entire averaging
Attachments:
SubVICutWaveforms.vi 37 KB
SubVIConvolveShift.vi 30 KB
SubVIEntireAveraging2.vi 43 KB -
How to read contents of files that do not fall under public security group?
Hi,
I need to read the contents of a WCM based xml file that does not fall under public security.
The process is like this:
First the user makes chnages to the content.
The workflow will be triggred based on the security group metadata that is associated with the content.
Once the content is finally approved our workflow calls a custom idoc script.
First we tried directly reading the xml contents from the idoc script which was still in the context of workflow. But since content item is still in workflow I was not able to read the changes. So I created a separate content publisher thread and read the DOC_INFO and checked for the dStatus value. If the value is RELEASED then I reading contents by calling ssIncludeXml idoc script.
This was working fine for public content. But now the requirement is that all content cannot be public. Content authors should not be able to edit the content that does not belong to their group, So we created security groups (and roles) and are associating that groups to the relavent content.
Beacuse of this change I am not not able to read the non public content. The call to DOC_INFO_BY_NAME service, which gives all the content files' metadata, is expecting the user to be logged in to give the details.
I tried calling the CHECKIN service with sysadmin and captured the cookies returned by that service and use cookies for the DOC_INFO_BY_NAME service call. But the service call was faling. It is throing the 401 forbidden error with the message that user needs to be logged in to get the details.
How to address this problem. Someone please help.
Note: I also tried using ridc for this. I was able to get it working but since it is executing in the context of server ridc api is changing server's environment properties like HTTP_HOST, HTTP_CGIPATHROOT etc. It also seemed like system was becoming non functional after using ridc. When I called check-in the system metadata values like security group are no more loading. Not sure if ridc is the culprit here but worried that it might be causing this issue.
Regards,
PratapSorry, I posted too much details while posting this question. I was saying "not able to read *non* public content".
Anyway, I was able to resolve the issue. I was able to authenticate with sysadmin credentials in the request to service using basic authentication and was able to read doc info with that credential.
But I realized there is more than option for reading secure content.
- I could set user name as sysadmin in the m_environment (if I am in the context of a service) and the call the DOC_INFO_BY_NAME service.
- I can post an HTTP request to DOC_INFO_BY_NAME service with sysadmin credentials and do basic authorization via the connection. (This is what i have done successfully as of now )
- I could add guest role to all security groups with R (read) privileges.
I will look into all options and implement the one which is more apt.
Regards,
Pratap -
How to read outlook email content that is sent to specific Email ID
Hi Friends.
I have the following requirement.
When an outlook Email is sent from some specifc third party system(Say for Example @gmail.com) to some service Email ID account([email protected]), then I should be able to read the Email using SAP and forward it to my approver's Email ID([email protected]).
I have followed the below blog to do the basic configuration
Receiving E-Mail and processing it with ABAP - ... | SCN
But this blog has no information on how to read the mail content.
Please help me in resolving this issue.
Thanks,
PeriForgotten Security Questions/Answers
You need to contact Apple by:
1 - Use the Express lane and start here:
https://expresslane.apple.com
then click More Products and Services>Apple ID>Other Apple ID Topics>Forgotten Apple ID security questions.
or
Apple - Support -form iTunes Store - Contact Us
2 - Call Apple in your country by getting the number from here:
http://support.apple.com/kb/HE57
or
Apple ID: Contacting Apple for help with Apple ID account security
3 - Use your rescue email address if you set one up
Rescue email address and how to reset Apple ID security questions
For general information see:
Apple ID: All about Apple ID security questions -
HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY
I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
FLOW:
1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
2. VB EXECUTE A STORE PROCEDURE
3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
4. VB DISPLAY THE RESULT IN A GRID
FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
IS THIS POSIBLE?, HOW?
THANKSCertainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
In ODBC:
{call foo( 'someData' )}
Justin -
How to add a dummy row in the result set of a SELECT statement.
Hello Everyone -
I have requirment to add a dummy row in the result set of a SELECT statement.
For e.g. lets say there is a table Payment having following colums:
Payment_id number
status varchar2(10)
amount number
payment_date date
so here is the data :-
Payment_id Status Amount payment_date
1 Applied 100 12/07/2008
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
Here is my SQL
Select * form payment where payment_date >= 01/01/2009
Output will be
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
My desired output is below
2 Reversed 200 01/ 06/2009
3 Applied 300 01/ 07/2009
2 Reversed -200 01/ 06/2009 ------(Dummy Row)
Thrid row here is the dummy row which I want to add when status is "Reversed"
I would be very thankful for any kind of help in this regard ...
Thanks,
GauravCartesion joining against a dummy table is a useful method of creating a dummy row:
with my_tab as (select 1 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
select 1 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 1 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/05/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 4 Payment_id, 'Reversed' Status, -400 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
select 2 cust_id, 5 Payment_id, 'Applied' Status, 500 Amount, to_date('01/07/2009', 'mm/dd/yyyy') payment_date from dual),
--- end of mimicking your table
dummy as (select 'Reversed' col1, 1 rn from dual union all
select 'Reversed' col1, 2 rn from dual)
select mt.cust_id,
mt.payment_id,
mt.status,
decode(dummy.rn, 2, -1*mt.amount, mt.amount) amount,
mt.payment_date
from my_tab mt,
dummy
where mt.status = dummy.col1 (+)
order by mt.cust_id, mt.payment_id, dummy.rn nulls first;
CUST_ID PAYMENT_ID STATUS AMOUNT PAYMENT_DATE
1 1 Applied 100 07/12/2008
1 2 Reversed 200 06/01/2009
1 2 Reversed -200 06/01/2009
1 3 Applied 300 06/01/2009
2 1 Applied 100 07/12/2008
2 2 Reversed 200 05/01/2009
2 2 Reversed -200 05/01/2009
2 3 Applied 300 06/01/2009
2 4 Reversed -400 06/01/2009
2 4 Reversed 400 06/01/2009
2 5 Applied 500 07/01/2009Edited by: Boneist on 07-Jan-2009 23:10
NB. You may have to mess around with the ordering if that's not come back in the order you wanted. You didn't mention what the rules were for any expected ordering though, so I've made up my own *{;-)
Also, I added an identifier (cust_id) to differentiate between different sets of payments, since that's usually the case. Remove that if it's not applicable for your case. -
I just bought a new iMAC. I want to set a password. But, the system seems to think I already have one set, and I don't know what it is. How do I reset this feature, so that I can set a password, without knowing the current password?
Have you yet, during setting up the new iMac, transferred old data and settings from an external hard drive or another computer? If so, then your computer obtained its current set Password from that tranfer, so you would have to determine what that Password was in the old system. If you have Not transferred any information that way, then the installation and/or setup seem to have corrupted somehow since it hasn't yet received a new system Password selection from you.
At this point, if you can, you can reboot while holding down the Command - R keys to boot into the Mountain Lion Recovery Partition. There you can select to "Reinstall Mountain Lion from the Internet". This will overwrite your current installation and any problems that have occured and give you a fresh install that hopefullywill allow you to set up without problems. -
How can I create a calculator that save result in memory and recall it back
I need some advice or help on how i can save the result and call it back by typing 'm' for memory, 'r' for recalling the saved result, and 'c' to set the result back to zero.
i have tried many ways but it doesn't seem to save the result.
Here is the code of what i have so far.
so, please if anyone could help me , it would be greatly appriciated.
import java.util.Scanner;
public class ImpCalculator
private double result;
private double memory;
private double precision = 0.0001;
public static void main (String [] args)
Calculator clerk = new Calculator ();
try
System.out.println ("Calculator is on.");
System.out.print ("Format of each line: ");
System.out.println ("operator space number");
System.out.println ("For example: + 3");
System.out.println ("To save result, enter the letter m.");
System.out.println ("To recall result, enter the letter r.");
System.out.println ("To clear result, enter the letter c.");
System.out.println ("To end, enter the letter e.");
clerk.doCalculation ();
catch (UnknownOpException e)
clerk.handleUnknownOpException (e);
catch (DivideByZeroException e)
clerk.handleDivideByZeroException (e);
System.out.println ("The final result is " + clerk.getResult ());
System.out.println ("Calculator program ending.");
public ImpCalculator ()
result = 0;
memory = 0;
public void handleDivideByZeroException (DivideByZeroException e)
System.out.println ("Dividing by zero.");
System.out.println ("Program aborted");
System.exit (0);
public void handleUnknownOpException (UnknownOpException e)
System.out.println (e.getMessage ());
System.out.println ("Try again from the beginning:");
try
System.out.print ("Format of each line: ");
System.out.println ("operator number");
System.out.println ("For example: + 3");
System.out.println ("To end, enter the letter e.");
doCalculation ();
catch (UnknownOpException e2)
System.out.println (e2.getMessage ());
System.out.println ("Try again at some other time.");
System.out.println ("Program ending.");
System.exit (0);
catch (DivideByZeroException e3)
handleDivideByZeroException (e3);
public void reset ()
result = 0;
public void setResult (double newResult)
result = newResult;
public double getResult ()
return result;
public void setMemory (double newMemory)
memory = newMemory;
public double recall ()
return memory;
public double evaluate (char op, double n1, double n2)
throws DivideByZeroException, UnknownOpException
double answer;
switch (op)
case '+':
answer = n1 + n2;
break;
case '-':
answer = n1 - n2;
break;
case '*':
answer = n1 * n2;
break;
case '/':
if ((-precision < n2) && (n2 < precision))
throw new DivideByZeroException ();
answer = n1 / n2;
break;
default:
throw new UnknownOpException (op);
return answer;
public void doCalculation () throws DivideByZeroException, UnknownOpException
Scanner keyboard = new Scanner (System.in);
boolean done = false;
result = 0;
System.out.println ("result = " + result);
while (!done)
char nextOp = (keyboard.next ()).charAt (0);
if ((nextOp == 'e') || (nextOp == 'E'))
done = true;
else if ((nextOp == 'c') || (nextOp == 'C'))
result = 0.0;
else if ((nextOp == 'm') || (nextOp == 'M'))
memory = result;
else if ((nextOp == 'r') || (nextOp == 'R'))
System.out.println ("memory value = " + recall ());
else
double nextNumber = keyboard.nextDouble ();
result = evaluate (nextOp, result, nextNumber);
System.out.println ("result " + nextOp + " " + nextNumber + " = " + result);
System.out.println ("update the result = " + result);
Edited by: shadowjuan450 on Oct 28, 2008 8:20 AMWhat trouble are you having? Is it not compiling? Throwing errors? Not doing what you expected?
Also: Use the "CODE" tags when posting code, it makes it much easier to read.
Lastly: Find a specific area in the code you're having trouble with, and ask directed questions about that specific area. -
How do I get a subset of a result set
I am getting a result set from a remote data source. After the resultset is returned how can I do a select on the result to return a subset of records?
My code:
package com.drawingpdmw1;
import java.sql.*;
import com.ibm.as400.access.*;
* @author sde
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
public class getLastDashNumberConnection {
public String errorString;
public String literalerrorString;
public String maxRecSeq;
public getLastDashNumberConnection(String arg0) {
AS400JDBCDataSource datasource = new AS400JDBCDataSource("gvas400");
datasource.setTranslateBinary(true);
datasource.setUser("drawchg");
datasource.setPassword("webabc1");
try{
Connection connection = datasource.getConnection();
Statement stmt = connection.createStatement();
String sql = "select distinct dmdrawno from webprddt6.drawmext3 Where dmdrawno LIKE '%" + arg0.substring(0,6) + "%'";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString("dmdrawno").trim());
errorString = "";
literalerrorString = "NoError";
catch(SQLException sqle){
System.out.println("Error");
System.out.println(sqle);
errorString = "Warning!!! A New Dash Number could not be created!";
literalerrorString = "Error";
}First, thanks for the info on closing my objects.
Now as far as the data here is my situation. The purpose of this class is to return the next dash number that can be used for a series of partnumbers. In most cases the series is constructed with only one type of dash numbers. Example: -401, -403, -405 dashes that start with a 4 are assemblies. This is easy to figure out the nex dash(-407).
However, some of our partnumber series have dashes like -001, -003, -005 which are detail level part numbers along with the -401 etc.
Now a user needs to create a new dash number. First, is this a detail dash or an assy dash. My idea is to get all the possibilites for a series, check for dash types, then return the next dash for each type. -
How to read output of native program
Hi,
I wrote a Java program that runs a native program. In my case, the native program is written in C++ and runs under Linux.
My purpose is, to start the native program and to capture the output of it and send also some input.
I found the code to do this on this website. I used the Process and Runtime classes to start my native program, The I used the following code the intercept the output of the program:
BufferedReader pInput = new BufferedReader(new InputStreamRead(process.getInputStream));
This code works perfectly fine for a native program that does his job and then exit. I guess the the output is only printed when the native job has ended.
That''s my problem, my program must continue to run, it never exits, so I never get the output of it except when I manualy close the program.
Isn't there an other way to get the output real time of my program, without it to wait for the end of the program?
Thanksmy case, the native program is written in C++ and
This code works perfectly fine for a native program
that does his job and then exit. I guess the the
output is only printed when the native job has
ended.Although I 'don't do C' :), my guess is that your native app should close the output device it's using (and that the Java app is using for it's inputstream) and re-open it again.
It shouldn't be needed to close your native application for this, only close the output device.
I think :)
Anne. -
Full memory control: how to read and write memory on any address?
I am programming in Visual Basic Express a long time, and now i want something more. I need to read and write bytes in memory on any possible address, and also to get a handle or first byte's addres of any declared object(Integer, String, Bitmap, ...) and
to declare an object to some memory addres. Does anybody know some API function (function that copies blocks of memory from one to another place and gives an address of an object) or any other way to do this, and if knows please write an example code that
CAN be used and it's VALID in Visual Basic 2010 Express or Visual Studio 2013 Express or similar .net basic tools.
ThanksHello Donaastor,
the OS might prevent you from writing/reading to "any possible address" because you could read others memory which is not allowed. You will get a security Exception :)
But of course you can read/write every part of "your" memory. Than you should use Joel's answer.
© 2015 Thomas Roskop
Germany // Deutschland -
How to read a tiff file that has more than one page?
Hi,
I use JAI to read TIFF image and get the pixels from a raster object. A TIFF file can have more than one image in itself. The JAI doc from SUN only mentioned that we can get the number of IFD (image file directory) by using
getNumDirectories() function but no description about how to get different images separately out of one TIFF file. Does any one know how to do it or some example programs implementing such function? Thanks a lot.
MarvinI'm not sure if this helps, but here's a web page which talks about Image I/O:
http://java.sun.com/products/java-media/jai/iio.html
For your problem, they have a sample solution which can read a specific page of a multi-page tiff file, so perhaps you could make a loop to read all of the pages:
http://java.sun.com/products/java-media/jai/forDevelopers/samples/MultiPageRead.java
Good luck!
Maybe you are looking for
-
How do I monitor audio while importing?
While importing from my cable TV, I Can see the incoming video but caan't hear the audio. I would be helpful if I could here the audio so I could go about my work and keep an ear on the feed. Then I would know when the feed is over without having to
-
Quantity contract not relevant for release
Hi all, I am working on quantity contracts. After creating a contract, I'm trying to create a release order with reference to the contract. When I fill in the contract nr and the release partner Sap gives me the following message: contract 400******
-
How do I scroll down in itunes
I just downloaded the new version of itunes and on any page I can't see everything. There is no scroll down the sides like there used to be. How do am I supposed to scroll down to access all the information?
-
Hi, Is it possible to fit a second network card on this motherboard, without any conflicts? I need 2 networks in the PC I'm using.
-
Can the release is reset in PO when the change is not about value?
Dear gurus, I have one requirement that when PO is released, the buyer would still be able to change it. Any changes that he made (for example the material PO text) then it should reset the release strategy. In the config i already put the changeabil