Currval acting like nextval

It will be very beneficial if you help me solve this problem and greatly appreciated. Please focus on the problem I’m having not why I’m doing what I’m doing. I’m trying to avoid a cursor solution and I can’t accomplish this using any group by or aggregate/analytical functions. This approach is basically trying to apply a group by while forcing the group by to operate on the data in a specific order(not the group by order). Sounds confusing, but if we focus on the problem… why is currval giving me the nextval we should get somewhere? Thanks.
Query:
INSERT INTO WAREHOUSE_DEV.STG_COV_SUBPROGRAM_FUN_CS1 (
CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE, CS_COUNT)
select CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE,
case when
CS_COUNT = 0 then 0
else case when CS_COUNT = 1 then 1
else case when (CS_COUNT = -1 AND LAG (CS_COUNT ) OVER (ORDER BY CASENUMBER, CLIENT_NUMBER, PROGRAMNAME, SUBPROGRAMNAME, COVERAGE_YEARMONTH) <> 0 ) then -1
else 1 -- catches tricky restart.....
end
end
end CS_COUNT
from
(select CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE,
case when
(CASENUMBER = PREV_CASENUMBER AND CLIENT_NUMBER = PREV_CLIENT_NUMBER AND PROGRAMNAME = PREV_PROGRAMNAME AND SUBPROGRAMNAME = PREV_SUBPROGRAMNAME AND PREV_CLIENT_COVERAGE=0) then 0
else case when (CASENUMBER = PREV_CASENUMBER AND CLIENT_NUMBER = PREV_CLIENT_NUMBER AND PROGRAMNAME = PREV_PROGRAMNAME AND SUBPROGRAMNAME = PREV_SUBPROGRAMNAME AND PREV_CLIENT_COVERAGE=1) then -1 -- EXCEPT FOR WHEN PREV PREV_CLIENT_COVERAGE WAS ZERO THEN 1.
else case when ((CASENUMBER <> PREV_CASENUMBER OR CLIENT_NUMBER <> PREV_CLIENT_NUMBER OR PROGRAMNAME <> PREV_PROGRAMNAME OR SUBPROGRAMNAME <> PREV_SUBPROGRAMNAME) AND PREV_CLIENT_COVERAGE=1) then-1
else case when ((CASENUMBER <> PREV_CASENUMBER OR CLIENT_NUMBER <> PREV_CLIENT_NUMBER OR PROGRAMNAME <> PREV_PROGRAMNAME OR SUBPROGRAMNAME <> PREV_SUBPROGRAMNAME) AND PREV_CLIENT_COVERAGE=0) then 1
else 88
end
end
end
end CS_COUNT
from WAREHOUSE_DEV.STG_COVERAGE_SUBPROGRAM_FUN_CS
where CASENUMBER = '0042432' and client_number = '0000942256'
ORDER BY CASENUMBER, CLIENT_NUMBER, PROGRAMNAME, SUBPROGRAMNAME, COVERAGE_YEARMONTH, CLIENT_COVERAGE);
PRODUCES RESULTS:
0042432     0042419     0000942256     0001571135     Child Care     Child Care     Child Care     Child Care     201008     1     0     1 nextval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201009     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201010     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201011     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201012     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201101     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201102     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201103     0     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201104     1     0     0 0
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201105     1     1     1 nextval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201106     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201107     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201108     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201109     1     1     -1 currval
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201110     1     1     -1 currval
The key is that when you have cs_count of 1… get nexval, when you have value of -1 get currval, zero is zero… The first row would get nexval…. So 1 the next seven rows should be 1, then next row 0, the next row 2 and the last 5 rows will also be 2.
That’s not what happens.
Query with currval and nextval:
Query:
INSERT INTO WAREHOUSE_DEV.STG_COV_SUBPROGRAM_FUN_CS1 (
CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE, CS_COUNT)
select CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE,
case when
(CS_COUNT = 0) then (0/warehouse_dev.cs_count_seq.nextval)
else case when (CS_COUNT = -1 AND LAG (CS_COUNT ) OVER (ORDER BY CASENUMBER, CLIENT_NUMBER, PROGRAMNAME, SUBPROGRAMNAME, COVERAGE_YEARMONTH) <> 0 ) then warehouse_dev.cs_count_seq.currval
else case when (CS_COUNT = 1) then warehouse_dev.cs_count_seq.nextval
else warehouse_dev.cs_count_seq.nextval
end
end
end CS_COUNT
from
(select CASENUMBER, PREV_CASENUMBER, CLIENT_NUMBER,
PREV_CLIENT_NUMBER, PROGRAMNAME, PREV_PROGRAMNAME,
SUBPROGRAMNAME, PREV_SUBPROGRAMNAME, COVERAGE_YEARMONTH,
CLIENT_COVERAGE, PREV_CLIENT_COVERAGE,
case when
(CASENUMBER = PREV_CASENUMBER AND CLIENT_NUMBER = PREV_CLIENT_NUMBER AND PROGRAMNAME = PREV_PROGRAMNAME AND SUBPROGRAMNAME = PREV_SUBPROGRAMNAME AND PREV_CLIENT_COVERAGE=0) then 0
else case when (CASENUMBER = PREV_CASENUMBER AND CLIENT_NUMBER = PREV_CLIENT_NUMBER AND PROGRAMNAME = PREV_PROGRAMNAME AND SUBPROGRAMNAME = PREV_SUBPROGRAMNAME AND PREV_CLIENT_COVERAGE=1) then -1 -- EXCEPT FOR WHEN PREV PREV_CLIENT_COVERAGE WAS ZERO THEN 1.
else case when ((CASENUMBER <> PREV_CASENUMBER OR CLIENT_NUMBER <> PREV_CLIENT_NUMBER OR PROGRAMNAME <> PREV_PROGRAMNAME OR SUBPROGRAMNAME <> PREV_SUBPROGRAMNAME) AND PREV_CLIENT_COVERAGE=1) then-1
else case when ((CASENUMBER <> PREV_CASENUMBER OR CLIENT_NUMBER <> PREV_CLIENT_NUMBER OR PROGRAMNAME <> PREV_PROGRAMNAME OR SUBPROGRAMNAME <> PREV_SUBPROGRAMNAME) AND PREV_CLIENT_COVERAGE=0) then 1
else 88
end
end
end
end CS_COUNT
from WAREHOUSE_DEV.STG_COVERAGE_SUBPROGRAM_FUN_CS
where CASENUMBER = '0042432' and client_number = '0000942256'
ORDER BY CASENUMBER, CLIENT_NUMBER, PROGRAMNAME, SUBPROGRAMNAME, COVERAGE_YEARMONTH, CLIENT_COVERAGE);
PRODUCES RESULTS:
0042432     0042419     0000942256     0001571135     Child Care     Child Care     Child Care     Child Care     201008     1     0     1
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201009     1     1     2
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201010     1     1     3
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201011     1     1     4
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201012     1     1     5
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201101     1     1     6
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201102     1     1     7
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201103     0     1     8
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201104     1     0     0
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201105     1     1     10
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201106     1     1     11
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201107     1     1     12
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201108     1     1     13
0042432     0042432     0000942256     0000942256     Child Care     Child Care     Child Care     Child Care     201109     1     1     14

>
This approach is basically trying to apply a group by while forcing the group by to operate on the data in a specific order(not the group by order).
>
That is NOT a problem statement. That is you attempt at a solution.
You need to tell us what the problem is.
It is YOU that is trying to preach to us by telling us what we can, and cannot consider. No one is trying to preach to you.
Tell us what PROBLEM you are trying to solve; not what solution you want to use.
This is how preaching would read:
Read the FAQ for how to ask a question in the forums.
Use \ tags on the line before and after any code to preserver the formatting.
Don't post two sets of unformatted code and results.
When you do post code and results explain why those results are NOT correct and what results you are trying to produce.
ALWAYS provide your 4 digit Oracle version.
There: how'd I do?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • I connected an external monitor to my MacBook Pro, but it doesn't open any programs. It Just sits there with a blank screen.  How do I get it to open programs and act like a monitor?

    I connected an external monitor to my MacBook Pro, but it doesn't open any programs. It Just sits there with a blank screen.  How do I get it to open programs and act like a monitor?

    Dear Jean:
    It sounds like you are trying to get your external monitor to act as the primary viewing screen. For example it would have your Doc, Icons, Etc. In order to make the external monitor the primary screen you have to:
    Open System Preferences.
    Choose the Displays Icon
    There will be several tabs to choose from pick Arrangement
    Drag the toolbar to desired display
    Let me know if this helps at all!
    Lance

  • I have a Yahoo search bar acting like an App tab that I can't get rid of. There is no option to unpin when I right click on it.

    I have a yahoo search bar which was installed during a download and installation of SIW.exe a system information application from http://gtopala.com/. It was the freeware version which is add based software. However I didn't expect that the search function would be such a nusance and interfere with Firefox's functions.
    The search bar is acting like a App tab that I can't move or get rid of. Ther is no option to unpin the object when I right click on the bar or to change it in any way using the 'group your tab' function to the right of the tab tool bar.

    Reply: Cor-el > Excellent!! Thank You. In Tools, Add Ons, Extensions there was a Default Tab enntry which was the culprit. Am running W7 so the XP Tools, Options, Advanced , Use Hardware acceleration when available, wasn't of much help here, however I did fix a problem on another computer running XP with that same fix. Thank You very much! HD

  • I am having a problem. When I click on the Mobile Facebook icon it acts like it is going to start opening then it quits and goes back to the icon. So I can't use Facebook on my iPhone 4

    I am having a problem. When I click on the Mobile Facebook icon it acts like it is going to start opening then it quits and goes back to the icon. So I can't use Facebook on my iPhone 4

    Force quit the application and try again.
    Try a reset or restart of the device, trying the app after each step.

  • Is there a way to make the NAS200 act like a drive in my computer

    Not sure if this has been discussed here yet.
    I have a NAS200 connected to my router and I can access through my web browser no problem.
    I was wondering if there's a way to make it act like a drive that's in my computer. i.e give it a drive letter and have it show up in the "my computer" area.
    I am running win 8 pro desktop hard wired to the router with the nas200 connected. Is there a way to "mount" the nas200 as drive on the computer.
    Thanks,
    Bob
    Solved!
    Go to Solution.

    Yes, you just need to map the drive on your computer. You need to make sure first that the network drive is detected in the network. You can click on the following link to know how to map the drive:
    How to create a shortcut to map a network drive

  • Mobile account setup stops syncing and acts like a network user

    Mobile account setup stops syncing and acts like a network user system under ODM
    Setup: Mobile laptop users authenticating against an ODM. Every user has a networked home directory on an Xserve. The whole setup is 10.4 (client and server). All systems run a standard image. Most effected systems have been re-imaged since the onset of the issue.
    Issue: Some of the users are not syncing properly every time. It is as if the system forgets it is a mobile system and reverts to using the User's network home (instead of saving to /Users and syncing). If the user is effected, the system will not even accept cached credentials if they are off network. This forgetfulness does not seem to follow any pattern and does not effect all of our mobile users.
    In mucking about trying to find a cause to this issue I ran across an oddity in all effected systems Netinfo database. The users are each listed twice. Each entry has the same username, short name and UID. Also, In each case one record looks wrong... this varies somewhat from user to user, but in each case there is marked difference in the record's contents. Deleting the incomplete record in Netinfo manager seems to solve the issue (seems, as we are very early in testing this).
    Anyone have a clues as to where this double came from? The only lead so far is that it looks like the users having issues pre-date the use of mobile accounts. At some time they all had local accounts that authenticated against the ODM but never synced or had networked home directories. The pool of users who just got laptops (and thus never had a local account) seem unaffected so far.
    Also, what is the best way to browse the ODM master to find these duplicates?

    I have a similar issue with computers bound to Active Directory. Users occasionally have a problem logging into their computers even though their account is fine. Logging in as Admin and running netinfo manager always shows duplicate user accounts. Deleting the one that says disabled always clears up the issue. I'd like to find a startup script that would delete the disabled account, thus preventing the issue.

  • How do I return functionality of my bookmarks menu before Firefox update 23.0.1? I don't LIKE internet explorer, now my firefox is acting like IE; gee thanks.

    How can I restore the functionality of the Bookmarks shortcut. I DO NOT LIKE internet explorer, it is cumbersome and slow. How can I modify the bookmarks shortcut to act like a menu again? I do not like the bookmarks and history pop-out... Firefox was above the bar, now I have 2 copies of internet explorer on my computer, one with an icon that looks like an E and one that looks like my old firefox browser.... This was a result of the update 23.0.1 this morning, it was perfect when I went to bed last night.... Maybe I should use Chrome?

    does it work as expected when you launch firefox in safe mode once (to rule out the interfering of any addons)?
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Yesterday iTunes worked - today, it acts like it's newly installed (won't show any of my music or playlists) - what could have made it forget everything it knew yesterday and how can I fix it without having to redo all my previous work?

    The title says it all.  iTunes was working fine last night.  I added some more music to my playlists and synched my iPod last night, then shut down.  Today, when I start iTunes it opens up a welcome to setup screen and acts like it wants me to answer questions to configure it for the first time.  When I cancel out of that, it opens up a normal iTunes screen that's completely empty of music and has none of my custom playlists (all the playlists it does show are empty) and it's asking me if I want to have it search my PC and add media files, as if it's newly installed and that's never been done.
    Has anybody seen this behavior before, and is there some simple way I can fix it so it remembers all the stuff it knew last night, without having to start all over again and rebuild all my playlists and stuff?

    For general library squiffiness following an upgrade the easiest thing is to restore your last backup, but I guess if it were that simple you wouldn't be here.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • My iPhone 4s acts like I need to plug in to iTunes and I got an error message saying it failed to download update and now the screen won't go away. USB port end on phone with arrow pointing to iTunes...

    My iPhone 4s acts like I need to plug in to iTunes and I got an error message saying it failed to download update and now the screen won't go away. USB port end on phone with arrow pointing to iTunes...

    Now iTunes will not recognize my phone as a device...

  • My desktop disappeared. When the computer starts, it opens in finder. Also, it acts like something is running. The spinning circle is spinning, will stop for a minute then starts again. What is wrong? Help please.

    My Mac g5 starts and goes to finder. The desktop has disappeared. Also the circle keeps spinning. It will stop for a minute, then start again. It acts like something is running. I have restarted multiple times. Can anyone help please? Thank you.

    Spinning Beach Ball
    Spinning Beach ball (2)

  • CS2 uninstall, mac desktop screen acting like photoshop image

    Recently my creative suite on my mac stopped updating showing an error, so each time now when updates arrive I cannot update. Now my 20" intel macs desktop image acts like a photoshop image?
    The desktop starts up and then expands beyond the screen, by nearly 2", when the cursor is moved accross the screen the desktop image moves too, it is making its way to see the unseen edge which appears as cursor moves towards that edge, (eg from centre move cursor to right screen image moves left). This is quite a sea-sick effect. Also if you click and drag on the desktop it forms a box, like the one in photoshop. Something seems corrupted. I want to uninstall the creative suite then reinstall (this should help the updates) but I do not know if the screen on my mac will correct.
    I looked up how to uninstall and the first thing is to double click on the Activity Monitor in Utilities and select AHCRemind.
    I double click on the Activity Monitor and the window I get up does not show AHCRemind? I cannot proceed. Can anyone help, has anyone had the same problem with the desktop?

    I have managed to cure the screen moving but I still need to uninstall CS2 (creative suite 2) and reinstall. I have an intel mac 10.4 os running tiger. As I said before I cannot find the 1st step on the instruction, perhaps the instruction is pre tiger, or Leopard system? Please help.

  • The sound doesn't work.  It's set appropriately in settings, the volume is turned up all the way with the side buttons, but no volume.  When we try to play songs, it acts like it's going to play and then goes back to the play list.  Restored and still no

    It's set appropriately in settings, the volume is turned up all the way with the side buttons, but no volume.  When we try to play songs, it acts like it's going to play and then goes back to the play list.  Restored the device and still no sound.

    Try A and B
    (A) Restart iPad
    1. Hold down the Sleep/Wake button until the red slider appears.
    2. Drag the slider to turn off iPad.
    3. Turn iPad back on, hold down the Sleep/Wake until the Apple logo appears
    (B) Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Hi, how can I stop my screen from freezing up.Its acts like a scratch card, I use the mouse cursor to rub away to find the password box?

    HI,how can I stop my screen from freezing, It acts like a scratch card,I run over it with the mouse to scratch away at the grey screen to find the password box
    underneath?

    OS X: Login window partially appears, cursor movement redraws screen

  • Will apple tv act like a router?

    Will the apple tv (2nd gen) act like a router if I connect my smart tv to it via the ethernet cable?
    I know this is a long shot but seeing as how the apple tv is connect via the wireless it would save me running a network cable or network adapter to the tv which isn't wireless.
    Applekwacker

    The ATV is not a router and cannot act as one.

  • Does c_rt:import act like include directive or tag

    The include directive <%@ include ... will not recompile when the included file changes. The tag <jsp:inlcude will always re-fetch the included file so new content is picked up immediately.
    How do c:import and c_rt:import behave?
    Can someone point me to a good description of the difference between c and c_rt libraries. The short one or two sentence descriptions I've seen don't really say much.
    Thanks,
    -- Frank

    How do c:import and c_rt:import behave?The JSTL <c:import> tag acts like the <jsp:include> tag - it is evaluated at page runtime.
    It uses either a RequestDispatcher.forward (for local resources on the same application server) or the java.net classes to open a URL connection for remote resources.
    Can someone point me to a good description of the difference
    between c and c_rt libraries. The short one or two sentence
    descriptions I've seen don't really say much.The "c_rt" library is only included for historical reasons. If you are using JSTL and EL expressions, you should not be using the "c_rt" library.
    There is only one functional difference between the two, and it only applies to JSP1.2 containers (eg Tomcat 4).
    The "c" tags work only with el expressions: ${expr},
    The "c_rt" tags work only on standard runtime expressions ie <%= expr %>
    In a JSP2.0 containers (eg Tomcat 5), el expressions ARE runtime expressions, and you can use ${expr} or <%= expr %> interchangably with the JSTL1.1 "c" taglib.
    You should only be using the c_rt library if
    - you have a JSP1.2 container
    - you want to use <%= expr %> with one of the JSTL tags.
    Cheers,
    evnafets

Maybe you are looking for

  • Table ctrl - no screen-name - hav groupid but not visible in Loop at screen

    Hi... In pa30, for a pernr, of infotype 0008, we have a table control. In that table control, i hav to hide a field. ex: bet01 it has value..by default it will appear on the screen... Now I want this value not to appear on the screen. in loop at scre

  • How to approach this requirment

    Business  overview: For every organisation account management will be the core functionality. The account management should include the following: customer - company - vendor. 1. customer info 2. vendor info 3.organisation info 4.material info 5.purc

  • Copy data from 4 internal tables

    Hi Experts, I need to split a database field into 2 separate fields on the frontend and display it in an alv report. For this i used 4 internal tables. first one for regular fields and rest 3 of them for the split fields. Now the problem is, if i use

  • Restoring Leopard DVD to a disc

    I'm not asking for advice but leaving some of my experiences installing Leopard to the small % of people who may benefit. I've completed around 50 Leopard installs on my Mac Pro. This is my hobby, to learn. Every install has gone fine, just the norma

  • Clearing vendor account with customer

    Hi how can i clear a vendor account with customer. the customer is also created as vendor, vice-versa... and to print a receipt of that transaction? thanks