with regard to the exchange of two variables

I have two variables of type varchar2. I need to exchange them using a procedure which takes two variables as arguments and returns them exchanged.
can someone give me the procedure complete pl - sql for the same thing.
I'm new to pl sql.

Thank you.

Published by: user12773921 on March 9, 2010 08:48

Published by: user12773921 on March 9, 2010 08:50

Hello

You can use variables in the end.

create or replace the swap procedure (IN OUT VARCHAR2 var1, var2 IN OUT varchar2) as
Temp varchar2 (100);

Start
Temp: = var1;
var1: = var2;
var2: = temp;
end;
To check the output, I stated an anonymous pl/sql block

declare
VARCHAR2 (100) var1;
VARCHAR2 (100) var2;

Start
var1: = 'A ';
var2: = 'B ';.
dbms_output.put_line (' before swap var1:' | var1);
dbms_output.put_line (' before swap var2:' | var2);
dbms_output.put_line ('swapping');
swap (var1, var2);
dbms_output.put_line (' after swap var1:' | var1);
dbms_output.put_line (' after swap var2:' | var2);
end;

Published by: user8962436 on March 9, 2010 11:08

Tags: Database

Similar Questions

  • with regard to the concatenation of two entity object.

    Hello

    I created an object entity and a database table display. and in my page jspx I insert a new record into the database.

    Here I've created a table with 3 columns (id, name, username)

    I entered in my page jspx only id and name * and I want column _ usernameshould be inserted automatically as the concatenation of the name and id* IE

    guess my id = 73 and name = helene shetty username must be rs73... _

    How can I achieve this?

    If someone can give an idea, it will be appreciable.

    Hi Helen,

    I think it can work for you

    protected void doDML (int operation, TransactionEvent e) {}
    If (operation == DML_INSERT) {}
    If (this.) GetName()! = null) {}
    String userName = this.getName ();
    String tempVal = userName.substring (0, 1);
    If {(userName.contains(""))
    String tempVal1 = userName.split("") [1];
    tempVal = tempVal + tempVal1.substring (0, 1);
    }
    tempVal = tempVal + this.getUserId ();
    this.setUserName (tempVal);
    }
    }
    super.doDML (operation, e);
    }

    Kind regards
    Suganth.G

  • Automate the exchange of two images in the document.

    Good afternoon! A friend here can direct me to a nice script to automate the exchange of two images in the document, E.g.: when you select two layers A and B would look like this: picture A to picture B by changing the image B for the "Inversion of images' image and, if possible, keep the same report. Thank you!

    I found an old version that I changed and now it works with CS5 and CS6 lets hope it work in CC.

    Wikisend: free file-sharing service

  • With regard to the update of the locations of cards-oracle

    HII everyone,

    In my application, we using mapviewer, which was installed locally on our server, for map rendering and showing the locations of a client like pinball machines.

    Suppose that some places (address, City) is updated map... How mapviewer (which has been installed on our server locally) will update this site all in rendering...

    Thank you

    learner

    It depends on how you got the map features.  Mapfeatures are usually stored in the cache.  If a change in database may not appear in the card immediately.  If, however, given the characteristics of the map as a vectorlayer, then simple vector update updates map.  You should consider two options with regard to the update database process.  You can store the geometry as a function that is updated on the fly as change attributes of database, or you may use a database trigger to update the geometry when the attributes change.  Thus, using a combination of correct space architecture and mapviewer correct functions.

  • With regard to the application of Nook on the Surface RT. Is there a way to change the way that newspapers appear?

    With regard to the application of Nook on the Surface RT.  Is there a way to change the way that newspapers appear?  Like corners, they give a better way to navigate and get the overview for the different sections.

    Probably not "such what."  Next time you launch the application, make sure that the menu bar to it and see if there is a feedback icon.  You may be able to comment on what features you want and they can do just that.

  • I had Photoshop CS for a while. I use it for one purpose, which is to standardize my bronze products photos, all photos are identical with regard to the composition, lighting, backgrownd, actually, I always place the same scale of assessment pr

    I had Photoshop CS for a while. I use it for one purpose, which is to standardize my bronze products photos, all photos are identical with regard to the composition, lighting, backgrownd, actually, I always place the pillar of satisfaction even scale and then only switch products bronze... a simple task of worm. For this reason I have is no need to upgrade my old version of Photoshop. My problem is that it doesn't work anymore since Windows 10 recently installed in my PC. IO have tried to install it several times but can't. Is anyone out there help me please!

    Activation for CS is closed. Adobe provides you with a free replacement of CS2.

    Uninstall CS

    Go here: Download Adobe Acrobat 7 and Adobe Creative Suite 2 products

    Click English, download Photoshop CS2 and also copy the serial number that comes with it.

    Install CS2 and use this serial number CS2. There no need activation.

    Take your copy of the CS, it is no longer usable.

  • With regard to the previous discussion on the recent settings of the workspace page

    With regard to the post Re: recent files page , when I went back to answer, there is no way to reply to the post.  After trying the settings using the provided screenshots, page of recent files always came every time.  So the answers you have provided are not correct for my particular case.  Finally, I tried without any control in the preferences and that my custom workspace save as I wanted.  Here is how I had to define it.

    Thank you.

    cc-152.jpg

    It is doubly strange.  I just check and that the other thread is not locked and can be answered.  Someone else has a problem, you reply to this thread.

    Secondly, I turn off the settings described works for me and Photoshop opens without MRU and start work space.

    You did _uncheck_ these settings?  I like the new workspaces, so mine are checked, but it clearly says _Show_ at the beginning of each line.

  • With regard to the management of exceptions in coherence

    Hello
    I use c ++ connection of consistency

    try {}
    String::handle gridHandleCache = GridCacheName;

    if(hCommCache == null) {}
    hCommCache = CacheFactory::getCache (gridHandleCache);
    }
    else {}

    "cost < <" Info: "< < GridCacheName < <" Cache already in a State of assets "< < endl;"
    }
    }
    {catch (exception::handle Vex)}

    "' cost < < ' consistency exe;
    }
    {} catch (std::exception (e)
    cost < < e.what ();
    }
    catch (...) {
    cost < < 'unknown exception ';
    }


    When the error occurred (duration or other errors), I still get an exception unname. It will never enter the Exception::Handle part of vex.

    When he calls on Wrestling (Exception::Handle vex) {.} I want to separate the duration and connection error ecpetion sepeartyely.

    Can I know what would cause / or how to handle it separately.

    What are the mistakes is possible to connect / put/get/invoke (touchprocessor). serializable cast?


    -Thank you

    Edited by: 882600 August 31, 2011 05:51

    There are several ways to achieve this. Perhaps the simplest is to simply catch Exception as std::exception const &, or one of its derivatives, then call what(). However, if you want to use the specific exception hierarchy richer consistency, you can get the equivalent of the what() result by calling getDescription()-> getCString(). With regard to the rankings largely what types of exceptions are "fatal", which would be RuntimeException and its derivatives, but the scope which it was caught in general is going to be more telling.

    Mark
    The Oracle coherence

  • With regard to the decode function

    Hi all

    I want to know abt decode function in sql-oracle
    I... e passing parameters to decode using decode using the ': ' bind the parameter

    Select the WORK, decode(:j,'CLERK','MANAGER','ANALYST','EXEC',JOB) of EMP;
    I declared the variable j in sql environment
    VARCHAR2 (20) OF THE VARIABLE J;
    I have the query exec
    and had the clerk as an input parameter
    but the o/p as iam
    JOB DECODE(:J)
    --------- ---------
    MANAGER
    MANAGER
    MANAGER
    SELLER SELLER
    SELLER SELLER
    SELLER SELLER
    CLERK CLERK
    SELLER SELLER
    THE ANALYST ANALYST
    CLERK CLERK
    THE ANALYST ANALYST

    JOB DECODE(:J)
    --------- ---------
    CLERK CLERK

    12 selected lines.

    SQL > PRINT J;

    J
    --------------------------------------------------------------------------------

    im not getting o/p
    so please hlelp me only: should be used not &
    This is my first thread.
    execuse me if no errors

    tons of thanks in advance to all

    Hello

    We can try like this...

    Begin
    : j: = 'CLERK ';
    end;
    /

    then, we execute your SQL query as below...

    Select the WORK, decode(:j,'CLERK','MANAGER','ANALYST','EXEC',JOB) OF the EMP
    where JOB =: j;

    I think that this will solve your problem

    Kind regards
    Soak the Sevin rana

  • With regard to the deactivation of the program and installed

    At first, I installed Adobe Creative Suite 6 on both my desktop and laptop, after I found the capacity on my notebook isn't enough to carry them. So I turn off notebook and installed in my lab - top, but my lab - top was not working. The reason why I said I installed the program for two times. Please please tell me we should do? It's urgent! I need to do this weekend.

    If you can open one of the programs on your laptop computer, see help in the top toolbar and select Disable.

    If you are not able to open any program, you will need to contact the Support from Adobe and explain your problem.  They should be able to take care of necessary disabled.

    Here are some links to help get in touch:

    http://www.Adobe.com/support/chat/ivrchat.html

    http://www.Adobe.com/support/download-install/supportinfo/

  • message to the subject of the defective hosts SMTP and HTTP, with regard to the two reading: 'No. Socket Error 11001 error number Ox800CCCOD. »

    To set up my Outlook Express, questioned, by sending an e-mail with the download, to provide the above hosts "addresses", I have inserted the wrong information ignorance.  Now cannot send and open downloads, I try to access the page in question again and RE-ENTER the RIGHT "addresses", but all in vain.  Can someone help me to access this critical page, I could revisit the functional plan online?  PLEASE?

    Open Outlook Express, click the Tools menu, click accounts, click Mail, click Properties, verify each tab and enter the correct information. If you don't know, your ISP will give you the correct information.

  • With regard to the dynamic variable repository

    Hi Experts,

    I made a dynamic variable repository. This variable is calculated the date of beginning of the week.
    I use this variable in the command as a default prompt.
    the problem I am geeting that its value is not getting updated. It shows the static value that I gave you in default initializer
    RPD.i want to, its value is changed in every week, but it does not change, his shows always value that have default
    in view of the RPD.

    Please share any solution for this problem.

    Hello

    Please use the below SQL syntax in the default selection of the guest of dashboard.

    SELECT CASE WHEN 1 = 0 THEN date_column of another TIMESTAMPADD(SQL_TSI_DAY,-0, CURRENT_DATE) END OF SH

    Concerning
    Young

    NOTE: Please mention if this solved your problem/still face and close the message.

  • In RoboHelp 2015, are there changes with regard to the CHM files?

    I would like to know if there is a significant change for CHM files.

    The only option that I use for output is Microsoft HTML Help to generate CHM files. I can't use other (WebHelp and etc.).

    Well, I use the demo version of HR 2015 but I did not notice a significant change regarding the CHM files.

    The dynamic filter is not applied to it. I am currently using RoboHelp 9, so I ask you to these changes because I'm thinking that if it's worth changing HR 2015, because I use the output HTML, I only generate CHM files.

    I am trying to compare the two versions and I try to note their differences, but if you know some that it would be useful for me.

    Sorry if I make mistakes, because English is not my mother tongue. Thanks in advance!

    Hello, Camila

    Your English is very good! Yes, dynamic content filtering is only available with the latest reactive HTML5. Available for CHM output functions are mainly dictated by Microsoft because the format of HTML (.chm) help is their owner specification.

    RoboHelp has added a few things on top of the base CHM (skins for CHMS, glossary and browse sequences, etc.), but you won't find many features more modern in CHMS because Microsoft has continued to develop a long time ago.

    That said, while the CHM format may not have a lot of bells and whistles that you hope to, the new 2015 RoboHelp has many other advantages that make it easier create and justify an upgrade.

    Thank you

    John Daigle

    Adobe Certified RoboHelp and Captivate instructor

    Evergreen, Colorado

    www.showmethedemo.com

  • With regard to the total of a line

    Hi Experts,

    I have a report that the HS as a scheme where there is declaration of prod and date and the amount sold is there. Now my problem is if I want to display the sum of the total amount before a specific date to say(8/31/2009) for the year 2009 in a steamer.

    My reprot should show me the overall sum of the quantity sold before that particular date chosen for this year in a single line. the date that is selected is dynamic.

    can I reach through the MSUM functionality.


    Can someone help me...

    First of all, I agree with the previous poster: If you want to help your specific problem, describe it accurately (and briefly). Second, award points if it is useful. This shows the label forum. There are enough posts in this forum to explain what it means that I won't go into it save to say look at the high post by Justin Kesterly, one of the moderators of the RTO. Now about your problem...

    Yes, you will need guests and presentation variables dashboard for your (now more complicated than your question first, but still doable) goal.

    The first question is building correctly your report. Once this is done, you can basically follow the same procedure I gave above to get your total great line.

    What you need is a column that displays your measure for the "two months" and another column to view your measure "for the rest of the months of the year.

    Look at this link:

    http://oraclebizint.WordPress.com/2008/03/11/Oracle-BI-EE-101332-rolling-yearMonth-and-date-filters-moving-window-filters/

    Modify this to get the number of months (the blog is about years). (This blog gives the flexibility to the user to limit the report to the "current year" and "return of two months".) You can, of course restrict the scope of your report if required).

    Using the information collected from your guests, you can now calculate your two measure columns using the column filter (see filters on columns for details) and the PVs and TIMESTAMPADD function.

    This should give you enough to help you get started.

    Now, click in the top right of my two posts where you see 'useful' before you forget! ;)

  • With regard to the migration of the multiple 9i DBs to the same server AIX 5.2

    Hello

    We intend to spend a few databases Oracle 9i from AIX 5.2 to AIX 5.2.
    I have two questions about the approach that we plan to implement:

    1. We anticipate volumes having Oracle_Home and data files with the full operating system backup and restore on the target server. Installing Oracle will work on the target with this approach?

    2 can we use the same Oracle home for several Oracle databases? The goal is after copying above volumes/OS to the first server, we just copy the files/init.ora of backup data while offline connection/redo log files and control of the second source DB server to the target and will be starting the additional instance. This approach works?

    Thanks for your time...

    Rgds,
    Castillo

    We intend to spend a few databases Oracle 9i from AIX 5.2 to AIX 5.2.

    I think it's on AIX 5.2 to AIX 5.3.

    1. We anticipate volumes having Oracle_Home and data files with the full operating system backup and restore on the target server. Installing Oracle will work on the target with this approach?

    As far as I know Yes. The installation should work as we can even go to AIX and hot houses readers.

    2 can we use the same Oracle home for several Oracle databases? The goal is after copying above volumes/OS to the first server, we just copy the files/init.ora of backup data while offline connection/redo log files and control of the second source DB server to the target and will be starting the additional instance. This approach works?

    Yes. Same House can accommodate databases of the same versions. The approach is but OK.

    Kind regards.

Maybe you are looking for

  • Could not load the Norton power Eraser

    Installed Norton Security. Everything works well except a pop up window that says error 5013,3. Following the instructions I downloaded Norton Power Eraser. When you are finished, the pop-up with the addon window said I need a newer version of Power

  • BIOS doesn't recognize the new drive to CD/DVD on TECRA S1

    Replaced my default drive SD-R2412 with a new SD-R2512. Unfortunately, when I boot the drive is not recognized. Any help or advice gratefully received. Thank you very much Kevin

  • Why my iPhone 5 c rear camera has stopped working?

    I got my iPhone 5 c last Christmas and it has been fine for the verbal time. I realized my camera back no longer works. Before everyone tells me to reset, I tried so many things, I talked to apple and all, nothing seems to work. My iPhone has got out

  • Satellite U300-13V flashcards tcrdmain.exe - error R6025 Pure function

    I just bought a Satellite U300-13V, very happy with it so far except one small complaint. When you first start up, it has produced the following message is displayed: program files\toshiba\flashcards\tcrdmain.exeR6025 Pure function call He will then

  • Cannot acquire IP address

    What would cause a computer to lose the ability to acquire an IP address and how do I solve this problem?