Data display

Hello

I have a table of Bank Transaction table. I want to display the data account no. rates wise sages Date and withdrawals and the closing balance.

CREATE TABLE bank_transaction

(acc_no VARCHAR2 (20 BYTE),

trn_dt DATE,

trn_type CHAR (1 BYTE),

sale NUMBER (10.2)

);

I want to display data like that.

Account no.: 100

Trn_dt flow Withdrawl closed ball

01-apr-2014 5000 5000

02-Apr-2014 1000-4000

03 Apr-2014 2000-7000

Account no.: 101

Trn_dt flow Withdrawl closed ball

01-apr-2014 10000 10000

02-Apr-2014 1000-9000

03 Apr-2014 2000-11000.

I tried like this.

DECLARE

CURSOR c1 IS

SELECT DISTINCT trn_dt FROM b_trn_t ORDER BY acc_no, acc_no, trn_dt;

CURSOR c2 (VARCHAR, p_trn_dt DATE p_acc_no) IS SELECT acc_no, TRUNC (trn_dt) trn_dt, trn_type, balance OF the b_trn_t

WHERE acc_no = p_acc_no AND trn_dt = p_trn_dt ORDER BY acc_no, trn_dt;

v_cr_amt NUMBER: = 0;

v_db_amt NUMBER: = 0;

v_clos_bal NUMBER: = 0;

v_acc_no varchar (12);

v_trn_dt DATE;

BEGIN

I'm IN c1 LOOP

IF v_acc_no IS NULL THEN

Dbms_output.put_line (i.acc_no);

v_acc_no: = i.acc_no;

ELSIF v_acc_no <>i.acc_no THEN

v_acc_no: = i.acc_no;

v_cr_amt: = 0;

v_db_amt: = 0;

v_clos_bal: = 0;

Dbms_output.put_line (i.acc_no);

END IF;

FOR j IN c2 (i.acc_no, i.trn_dt) LOOP

IF j.trn_type = 'C' THEN

v_cr_amt: = v_cr_amt + j.balance;

ON THE OTHER

v_db_amt: = j.balance - v_db_amt;

END IF;

END LOOP;

v_clos_bal: = v_cr_amt-v_db_amt;

Dbms_output.put_line(i.trn_dt ||) ' D ' || v_cr_amt | ' C ' || v_db_amt | "CLOS BALL | v_clos_bal);

END LOOP;

END;

Hello

This request obtains all of the information you want:

SELECT acc_no

TRUNC (trn_dt) AS trn_dt

, SUM (CASE WHEN trn_type = ' THEN trn_amt END) filing form

SUM (CASE WHEN trn_type = 'W' THEN trn_amt END) AS witthdrawal

SUM (SUM (CASE

WHEN trn_type = ' THEN trn_amt

WHEN trn_type = 'W' THEN - trn_amt

END

)

) OVER (PARTITION BY acc_no

ORDER BY TRUNC (trn_dt)

) AS closing_bal

OF bank_transaction

GROUP BY acc_no, TRUNC (trn_dt)

ORDER BY acc_no, TRUNC (trn_dt)

;

The format is not quite what you asked:

ACC_NO TRN_DT DEPOSIT WITTHDRAWAL CLOSING_BAL

-------------------- ----------- ------- ----------- -----------

100 17 March 2015 6000 6000

100 24 March 2015 5000 1000

100 March 25, 2015 10000 5000-6000

101 17 March 2015 10000 10000

101 24 March 2015 5000 5000

101 25 March 2015 5000 1500 8500

If you are using PL/SQL, to get the results in the exact format you need should be easy.

Using only SQL, you can get the acc_no on a separate line using GROUP BY GROUPING SETS.  You can use CASES and the GROUPING function to show only the acc_no on some lines and all, but acc_no on others.  May also get the acc_no and the trn_dt in the same column.  (You will need to explicitly call TO_CHAR for this).

GROUP BY GROUPING SETS can also get a header line after the first acc_no.  If the VARCHAR2 headers are part of the result set, you will need to convert to strings, the total NUMBER of columns using TO_CHAR.

Maybe some of you have done proof of formatting is not important to you.

Tags: Database

Similar Questions

  • Create a button to erase/reset the data displayed in the graph

    Hello

    I'm new here and to work with labview. I searched the Forum but have not found an answer that would help me (or at least I think I thank)

    I'm working on a project to acquire process an ECG signal with an acquisition of data. In the front panel, I am trying to display 2 graphics, part of the real-time data display and the other showing all the data acquired up to now. I wanted to add a button to this second graph that, when the user wanted, deleted the data shown in the graph, but immediately continued to display the data.

    (trying to make me more clear)

    ' display all the data acquired--> X--> cleans graphic display--> press the button display all acquired data.

    If someone could help, I would be very grateful!

    Thank you very much

    FM

    Hi fred,.

    Open the finder example in LabVIEW and locate the example of 'how clear diagrams & graphics '.

    Pretty easy, don't you think?

  • My cc of dreamweaver does not link, server behaviors and data display

    My cc of dreamweaver does not link, server behaviors and data display

    Hello

    Please read this thread-

    https://forums.Adobe.com/thread/2139846

  • The MTS file date display information on screen time in CC PP

    I need to display the timestamp from date of the MTS files so I can see them in PP CC15. Is it possible to get rid of it within the program? Now, I have to do it in another program and then import the file. Takes too much time this way.

    Premiere Pro does not have this feature.  The closest you can get is display the timecode for clips that have it.  If these clips were recorded using Free Run, that would give you a time, but there is no way to see the date displayed in an overlay.

  • How to find / search the text in a table of data displayed in adobe flash player?

    I have a table of data displayed on the browser, but with Adobe Flash Player UI technology. CTRL + f does not work on the table to find a specific word in the table.


    What are alternates, you ask? or all the other shortcuts are available to search or search the text in such a case?

    Thank you.

    There is no good workaround solution.  The developer would have needed to implement a similar feature in their Flash application, or they would have needed to use StageText (which essentially exposes the native textfields), but it seems that they have neither.  The HTML TextField is certainly more robust and functional of the Flash, and honestly, HTML is probably a better choice of technology for what you describe.

  • Date display

    Hi, I have a small display problem my date in the format that I have chosen. In access, I chose for my type of date is "Long Date" that could be, for example:

    May 29, 2006 (something more or less like that)

    but when I view it, its be shown like this:

    2006-05-29 23:01:03.0

    as a test I tried to change the date format "Short Date" access which should look something like this:

    29/05/2006

    but when I went to see on the Web page again, it looked like:

    2006-05-29 23:01:03.0

    I don't know why this is happening, is does anyone know how I can fix this problem that the date could be demonstrated how I view in access? I appreciate any help anyone could give, thank you!

    WOLFcfm wrote:
    > I don't know why this is happening, is does anyone know how I can fix this problem if the
    > date could be shown how I displayed it in access? I appreciate any help that
    > could someone give, thank you!

    for the purposes of the display date


    #dateFormat (dateValue, dateMask) #.

    where dateMask controls the shape, LONG, FULL, MEDIUM, SHORT or something
    custom (for example "dd-mmm-yyyy").

    If you need localized date display, use lsDateFormat & recommend your stay with
    the standard LONG, FULL, MEDIUM, SHORT date masks.

  • Change the data displayed through the context menu

    I have a long list of data which must be reduced. Is there a formula/function that will change the data as determined by a context menu? For example:

    If I had to choose 'Brown' in the menu dropdown only entries whose hair is brown above, would be displayed (IE. Bilbo and Gimli); all others are hidden/not shown. To complicate matters, I have data in two different columns that I need to refine the list by: in this case, the color of their hair, or the number of letters of their first name.

    Using numbers 3.6.1 in El Capitan. Thanks in advance for your help.

    If you restrict the list of several columns have considered using filters (in the Panel on the right after clicking on "Sort and filter" in the toolbar)?  You can add rules on more than one column at a time.

    SG

  • QUESTION: SE 2012 data display returns to the time graph each time

    Hello

    I have SigExp 2012.

    If I try to add a data view and make a pledge of graphic style, thermometer, etc., as soon as I have the right up until it clicks, add my TC chain, the data view returns immediately to a graph time.

    In addition, even if I use the graph of time, once I added the signal, it only let me see the string in a table, a chart of time or a waveform graph.  Those are the only choices.

    If I use a graph of time or a band of waveform graph, it does not read the signal correctly, but I can not configure the data view, the way I want it.

    Is this a bug or I do something wrong?

    Thank you!

    This occurs when you try to change the display of a signal in its raw format "waveform".
    You must convert your signals in scalar format. To do this simply add an amplitude and levels step (under: analysis > measures Time-Domain). Drag this DC signal newly converted to a new chart and right click on the graph to change the display.

    Honestly, I'm not sure why raw waveform signals are inherently limiting viewing functionality, but in such cases, it is.

    You can also; According to the devices on which you use and the order in which you add to your DAQmx Acquire, some default signals step to scalar signals without having to convert.

    See the attached screenshot and you'll see how the icons are different between the waveforms and scalar signals.

    Hope that helps

  • Formatting of RS-422 data display / handling

    I hope someone here can point me in the right direction.

    I am developing an alternative to COTS Accessport program (http://www.sudt.com/en/ap/) in Labview.    I found a basic example of serial communication I could manipulate and display my data stream (32octets HEX, 69 being the starting byte):

    Where my problem is in the data stream.    This example displays the data as a string type in this text box 'read the string '.    I need to handle data type string and break-out/display individual bytes, and I don't really know where to start.   I tried to add a table... but I'm a data type mismatch in the block diagram.

    Block diagram error

    Finally, I would like to be able to select / monitor only specific bits and leave the LabView to manage the processing of the data... but I'm me.   Thoughts?

    1 remodel table is wrong.  And through the shift register stages do nothing for you other than to delay all these manipulations.

    You want to add all the 36 bytes, integrate in a table.  Delete the oldest lines using delete in the table.

    2 and 3.  You use bytes to the Port which I have told you is the wrong thing to use.  I described a method for how to find the starting byte.  See my attached VI where I implementd that.

    4. you can create an object of front panel, perhaps an indicator of the photo or the color block you the size to cover a column.  You can use the events to slide the mouse on this control to detect where to go to.  It's really a question own right beyond the analysis of the series.

    In addition, you have your string to write together as * IDN?  (It has been converted into hexadecimal display so it was not so obvious).  Are you sure that's what you want to write?  That works for instruments such as spectrum analyzers, power supplies, DMM.  It is built in examples of series, but often that order means nothing to most of the devices series that speak to you.

    You also had the active stop character.  This means that any time you get the stop character (newline hex10), the reading series will shorten.  That's why you think you're getting asymmetrical data.  When you work with binary data, you must disable the stop character and other methods (such as a defined 36 byte packet size) to determine how to read.

  • Express of signal data display background color

    Is it possible to change the background color of the display of data in Signal Express?

    Yes, but you need a signal to 'unlock'  With a signal in the Viewer, right click and select Properties.  Select the scale tab.  At the bottom right, there is a section called grid Style and colors.  BG Color will do what you want.

  • Manipulation of Image data display

    Hello

    So I'm a first time LabVIEW user and I am struggling with programming graphically the project I have to do...

    The type of data, I work with are bitmap images.  Basically, a single image is there (along the y-axis) data and length of wave (along the x axis).  Each successive image shows these data for a certain value of x.  Thus, all images in the folder hold a data cube (x, y, wavelength).

    I want to do is create a VI to display these data nicely.  I want to average all wavelength data (which are in rows) to a point given y in a given image (point x) and then make sure the average value of table in a table to index x 2D, y.

    I would like for this 2D table correspond to a bitmap "average."  And if you click on a pixel/cell in this table/image (which is formed by an average of all wavelength for each pixel data), then a spectral wavelength data diagram is plotted in a separate chart.  In this way, you see the overall picture, but if you are interested in a certain point you can graphically see the raw data of wavelength after clicking on this point.

    For now, I created test data.  I run an Excel Macro to combine all data into a great file.  Each 'image' is three lines and three wavelengths by rank.  In the attached excel file, you see the 9 lines because I put 3 images together one after the other.  The problem is, LabVIEW, I try to create the new 2D array which is the average of image, but I'm not sure how to extract the data in column "means" in this new matrix.  Because each "image is 3 lines long, I need to take the first 3 values in the 4th row in the data table (average values) and do as my 1st column, then take then 3 values in column 4, making the 2nd column, etc..".  The new 2D array should therefore all 7s.

    I'd appreciate any help to go on this task, but also a response to the problem, I am currently facing.  If I didn't explain that well, let me know and I will clear up everything that was confusing!

    It's generally a bad idea to have data sample degenerate as in this case, where each item is 7. It does not easily check if the correct order and the conversion is achieved. (Also, your second loop is yabba of LabVIEW. )

    Try something like the picture shows... (of course the constant diagram must be replaced my calculations based on the size of the input array).

  • Mode synchronous data display in 2 charts in different screws

    Hi all

    I am a relative beginner to LabVIEW, in what I read some resources, done a few tutorials, and tried to make simple programs to get a feel for the program. My main project is to add extra functionality to a LabVIEW project that is used to stimulate human tissues and save the tensions that result (not for torture ). This point has no other relevance that is not convenient or easy for me to test the changes that I do. This means that I do currently with "proof-of-concept" - type programs and hope that the proven concept will work in the real application.

    Basically, I have to do some graphics to display to a second monitor. I did find something that suggests that the individual graphs can be displayed on another monitor, so I need to create a separate VI with the graphics to display. I already looked at how to display the Panel before a VI on a second monitor, tested and had no problems.

    My problem comes with the passage of the original graphical data on the main VI, on the main monitor to the graphics in the second VI, on the second monitor. It seems I can do this by moving a control to the original graphic reference to the second VI, or passing the table with the data from the original graph as an argument in the second VI. You can see my attempts of these two approaches in the attached files: the passage of the control (RefInput_graph_main.vi, graph_sub.vi) reference and passing the array (ArrayInput_graph_main.vi, ArrayInput_graph_sub.vi). The reason why I use the VI of Signal to simulate, it is that I can not simply do another stimulation experience, so I need to simulate data to see if my approach works.

    The problem I have is that the waveform in the two charts is not the same, and this problem occurs with both approaches. It seems that the waveform in the second graph is slightly offset to the right of the original wave. In other words, there seems to be a delay in time between the two charts. I don't know if it caused delays in the transmission of data (unlikely), or a few kaveat with the Signal VI to simulate.

    My questions are:

    1. What is the cause of the delay? How do I eliminate?

    (Program receives only snapshots of data after each stimulation, so it is not a continuous flow of data. I don't know if the delay will always be present in this case.)

    2. are there other ways to pass data between the graphics? Any other suggestions or guidelines?

    (The program is quite complex, so that it will probably be not possible to encapsulate the original sequence structure graph as in RefInput_graph_main.vi, which makes using a reference control was not feasible.) Yet, I am open to ideas.)

    3. all comments more?

    Thanks for your help! I'd be happy to clarify things, or change this message to make it more clear.

    Nemanja

    If you use a chart (updated for the point-to-point): create a queue and when you write in the main graphic, also write to the queue. Put the items on the second chart and the sons of the reference to the queue in the Subvi.

    If you are using a graph (and showing the entire waveform): as above, but use a notifier. In fact, you could just waiting in line the entire waveform.

    The option using a queue is essentially an architecture of producer/consumer, the second using a notification utility is a "program".

    (Just a couple of ideas... you could also share data using a FGV / Global)

  • How the data displayed parced

    OK, Im having a bit of trouble getting the data to display in labview. I like to read from a string of succession of data which is delimeted with «,» It works fine and I can get out to the token stringn. After 7 "blocks" of data, it will start to repeat themselves. How can I get that it displays each of these 7 chuncks of data, then on the next loop them refersh.

    That's all I have for now

    If I understand the problem, you have a string that has a number of embedded commas, and you want an array of strings corresponding to the 'things' between each comma.  Your reference to 7 'chunks' might suggest that each VISA read will return a string of the form x 1, x 2, x 3, x 4, x 5, x 6, x 7 (7 points, commas 6), but this solution does not how 'chunks', just that they are separated by commas.

    It uses regular expression matching function, with the comma as the regular Expression.  This VI basically splits the string into two parts, everything before the comma (the upper exit, highlighted as an element of array) and everything (number less than forecasts, put on a shift made through new register).  Each time through the while loop pull on another element, by adding to the matrix.  When nothing is left, the loop stops.

    Examine the three odd cases - string with no comma (get a table of 1 item with the full, correct string), string starting with a comma (get an array whose first element is an empty string, correct), string 1 element, ending (or not) with a comma (get a table to correct 1 item).

    Enjoy.

    BS

  • the calendar on desktop gadget no longer date display.

    I have the calendar on dektop gadget and other gadgets and they has of worked but all suddenly stopped showing calendar date it was just empty. I clicked the x to get rid of him, then obtained and added to office still will not display date. I rebooted comp and it did not fix it?

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    See you soon.

    Mick Murphy - Microsoft partner

  • dynamic date display

    Hi all

    I want to display the version created date of my application. How to fix date identical file alx created date dynamically. Need help.

    Thanks in advance,

    SAL

    Does that help?

    http://supportforums.BlackBerry.com/T5/Java-development/read-version-from-inside-app/m-p/345845#M638...

  • Timestamp date displays year as 0015 or 0014

    Greetings,

    I have an oracle table with a timestamp column that stores the date as follows:

    BadDate2.jpg

    However, when I discovered this date through the front-end server Java I see this:

    BadDate.jpg

    I know that the year shows that 2014 but it is just one example of another date that is in the same format as above, but the same question.

    What would be the best way to solve this problem?

    Thanks in advance.

    Abu Dina wrote:

    Greetings,

    I have an oracle table with a timestamp column that stores the date as follows:

    No, he does not "store data as follows.

    Your tool front end displays the data 'as follows.

    If the column is, as you say, a TIMESTAMP, then it is stored in an internal binary format is quite regardless of how any program specific application (like sqlplus SQL Developer or any other application that queries the database) chooses to display everything.  And the front-end server chooses how he view by applying a rule NLS_DATE_FORMAT at various levels.

    For a more in-depth explanation, see but I want to keep my date under...

Maybe you are looking for

  • Opening works with Sierra

    How the opening has worked with Sierra?

  • Portege 7020 Setup Help - where can I download the drivers

    I have a laptop Portege 7020 I formatted the hard drive. I have a copy saved in Windows 98 SE and I installed it on the computer. I need the diskette and the drive of the tools. As said I have the OS if someone can tell me where I can download the di

  • Satellite A300D - upgrade RAM

    I bought a Satellite A300D PSAH8A 01K00H of a site affiliated with ebay.The laptop had some problems of virtual memory, but has not been slow etc.What is the maximum ram that can hold my laptop? don't know what other information is needed but will st

  • Satellite A500 - Toshiba Service Station is not responding

    Hello Recently alone time I use my Toshiba Satellite A500, I get an error message "Toshiba Service Station unresponsive". (1) that I start the computer. Everything is good.(2) I'm in internet explore, ms word or ms excellent (my three most often used

  • HP 6700 and CMYK printing colors

    Greetings I have a Dell laptop with Core i7, Windows 7. I designed a logo with the red and the black. The color of the design was derived from the RGB palette in paint. When it prints on my color inkjet HP 6700 the black color is fine, red, however,