Input with sql*plus and Output it with PL/SQL

Hi everyone,
I try to understand how can I get input and input by using sqlplus and plsql together. I get output like this:
Get User Input
Given Name: Iron
Family Name: Man
old   6:        Given_Name := '&GivenName';
new   6:        Given_Name := 'Iron';
old   7:        Family_Name := '&FamilyName';
new   7:        Family_Name := 'Man';
Given Name: Iron
Family Name: Man
PL/SQL procedure successfully completed.My Codes:
PROMPT Get User Input
ACCEPT GivenName PROMPT "Given Name: "
ACCEPT FamilyName PROMPT "Family Name: "
DECLARE
     Family_Name Varchar(15);
     Given_Name Varchar(15);
BEGIN
     Given_Name := '&GivenName';
     Family_Name := '&FamilyName';
     DBMS_OUTPUT.PUT_LINE('Given Name: ' || Given_Name); 
     DBMS_OUTPUT.PUT_LINE('Family Name: ' || Family_Name);
END;
/My question is why I get
old   6:        Given_Name := '&GivenName';
new   6:        Given_Name := 'Iron';
old   7:        Family_Name := '&FamilyName';
new   7:        Family_Name := 'Man';this bit?Is there something wrong in my code? Thanks.

Hi,
From SQL*Plus reference:
After you enter a value at the prompt, SQL*Plus lists the line containing the substitution variable twice: once before substituting the value you enter and once after substitution. You can suppress this listing by setting the SET command variable VERIFY to OFF.
So. you can remove current output with
SET VERIFY OFF
and enable your PL/SQL output by
SET SERVEROUTPUT ON
Regards
Peter

Similar Messages

  • Can SQL*PLUS deal with 'flat ASCII files' (input ) in UNIX ? and how?

    Can SQL*PLUS deal with 'flat ASCII files' (input ) in UNIX ? and how?

    No, but PL/SQL can. Look at utl_file.
    John Alexander www.summitsoftwaredesign.com

  • SQL PLUS log input and output to file

    What is the way to log every activity in sqlplus, input and output to a file (interactively).
    I managed to do it using rlwrap and tee but the only problem is, it is displaying the password and logging it into file as well :D. I can remove it from the logfile but am unable to prevent from showing the password.
    I hope many might have wanted to do this, and some might have been succeeded. Please share your ideas!

    N:\tools>sqlplus siva
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 19 03:12:04 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter password: password
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining optionsThe password is displayed on screen and it is in the log file as well.
    Here is the some environmental setup;
    I've installed cygwin with rlwrap package
    I've renamed the original sqlplus.exe to _sqlplus.exe
    I've placed mysqlplus.bat and sqlplus.bat in N:\tools and this location includes in the pathwhere sqlplus.bat contains
    @echo off
    rlwrap -a"Enter" mysqlplus.bat %*perhaps this is more related to linux commands but I want to log input and output of sqlplus!
    :)

  • How do I create an xControl with multiple inputs and outputs?

    Hello,
    i am trying to write a new Xcontrol Element. In the data model I can create data types using the cluster to create compound types, eg an int and an int array. But how do I create an xcontrol which has multiple data inputs and outputs?
    Kind Regards

    Limping_Twerp wrote:
    Alright: I see: An xcontrol is either an input OR an output. How do I achieve an output? Secondly: So you are saying the only Elements that can have multiple inputs and outputs are VIs?
    Can you take a few steps back and explain what you are actually trying to do. SubVIs and Xcontrols have nothing in common and it is not clear why you even try to compare them side by side (e.g. in terms of the number of connectors).
    Your questions about input or output tell us that you seems to have some misconceptions about xcontrols. Xcontrols are like regular controls, except they have some built-in intelligence that you can program. Most front panel object can be either controls or indicators and the same is true for Xcontrol. You create an Xcontrol, and after placing it on the front panel you can decide if it should be a control (where the code reads the value) or an indicator (were the code writes values to it). When you define the xcontrol facade, you also need to program how the visuals change if it is changed from control to indicator or vice versa.
    As a first step, you should opend the example finder and look at some xcontrol examples.
    Again, what are you actually trying to do? 
    LabVIEW Champion . Do more with less code and in less time .

  • SSIS: How to use one Variable as Input and Output Parameter in an Execute SQL Task

    Hello,
    i need your help,I'm working on this issue since yesterday and have no idea how to deal with it.
    As I already said in the tilte i want to start a stored procedure via a Execute SQL Task which has around 15 prameters. 10 of these should be used as input AND output value.
    As an example:
    i have three  Variable:
    var1    int        2
    var2    int     100
    var3    int     200
    the stroed procedure:
       sp_test
          @var1 int
          @var2 int output
          @var3 int output
       AS
       BEGIN
            SET @var2 = @var2 * @var1
            SET @var3 = @var3 + @var1
       END
    So in the Execute SQL Task i call the Stored Procedure as follwos:
        Exec sp_test  @var1 = ?, @var2 = ? output, @var3 = ? output
    (I use an OLE DB Connection)
    The parameter mapping is as follows:
    User::Var1        input                   numeric              0                 -1
    User::Var2        input/output         numeric              1                 -1
    User::Var3        input/output         numeric              2                 -1
    Now my problem. If i set  Var2 and Var3 as Input parameter the values are still the same after running the package. If i set them to a output value the are both Null because the procedure doesnt get any values.
    I already tried to list them a second time - like
        User::Var2        input                  numeric              1                 -1
        User::Var2        output                 numeric              1                 -1
    or i use a new variable
        User::Var2                  input                  numeric              1                 -1
        User::Var2Return        output                 numeric              1                 -1
    but i alwas get the error
    "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
    Has anybody an idea how I can solve this problem?
    Thanks a lot.
    Kind Regards,
    Alice

    Hi Alain,
    thx for your answer.
    I have around 15 procedures called one after the other to calculated and modify my values. Each procedure is responsible for an other but overlapping set of variables. So i thought it would be a good idea to call them one after the other with the needed variables via a execute sql task.
    So if i use a result set, how i get my stored procedure to return 10 values? I would have to use a Function instead of a procedure, wouldn't i?
    As if i have 15 procedures this would be a lot of work.
    But thanks a lot for the idea. I think an other idea would be to create one function which calls all stored procedures and returns all the calculated values as a result set, wouldn't it?.
    Kind Regards.
    Alice

  • Formatting code and output with Courier font

    Hi,
    I have several problem in inserting code and output for SQL and PL/SQL.
    I.e.:
    If I insert the code below formatting usin Syntax highlight as SQL:
    SELECT empno, sal
      FROM emp
    WHERE sal > ALL (2000, 3000, 4000);
    Is there a way to have Courier as font to retain the correct indentation?
    Another problem. Suppose that I run the query below:
    SELECT *
      FROM emp
    WHERE deptno = 10;
    and I want to paste the output as Courier:
    If I copy and paste the output from SQL Plus:
    EMPNO ENAME 
    JOB         
    MGR HIREDATE    
    SAL  
    COMM
    DEPTNO
    7782 CLARK 
    MANAGER    
    7839 09-JUN-81  
    2450               
    10
    7839 KING  
    PRESIDENT       
    17-NOV-81  
    5000               
    10
    7934 MILLER
    CLERK      
    7782 23-JAN-82  
    1300               
    10
    It is pasted as a table. Even changing the font is not helping to have a good formatted code (note the header not aligned with data columns).
    I can use HTML code to paste it. I.e.:
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    But it is taking quite a lot to paste the code.
    Any suggestion?
    Regards.
    Al
    Message was edited by: AlbertoFaenza

    BluShadow wrote:
    Well, I hope they get around to using fixed space fonts on the Syntax Highlighting options, as I quite like the fact it creates line numbers for the code, as that will be useful when discussing issues.
    I agree Blu. The line number is useful. If they only can use a fixed space font would be perfect.
    I also have the problem that randomly my output is pasted as a HTML table and still could not understand why it happens.
    This one i.e.:
    EMPNO ENAME
    JOB        
    MGR HIREDATE   
    SAL 
    COMM
    DEPTNO
    7369 SMITH
    CLERK     
    7902 17-DEC-80  
    800              
    20
    7566 JONES
    MANAGER   
    7839 02-APR-81 
    2975              
    20
    7788 SCOTT
    ANALYST   
    7566 19-APR-87 
    3000              
    20
    7876 ADAMS
    CLERK     
    7788 23-MAY-87 
    1100              
    20
    7902 FORD 
    ANALYST   
    7566 03-DEC-81 
    3000              
    20
    I notice that just adding a blank line as first line solve the issue.Regards.
    Al

  • Continuous in- and output with PCI-6229

    Hi All,
    I'm currently evaluating a PCI-6229 card on RTX (and maybe InTime later on). The main goal of the evaluation is to prove we can get hard real-time, deterministic behaviour from this system in order to use it to replace our current DSP-based solution.
    To do so, I'm setting up a rather simple program that should
    - continuously acquire 1 channel @ 20kHz
    - have a processing loop of 5mSec, ie 100 samples; this loop should be entered every 5mSec as exactly as possible
    - do some simple processing in the loop (thresholding the signal)
    - bring out the result on an analog output (low signal if signal is under threshold, high signal for all samples above the threshold)
    I could get the basics working pretty quickly: continuous input, continous output, continuous input with dma, input using interrupts.
    Trying to combine everything isn't really working out however.. Normally I'd try and try until knowing the device inside-out but now I have a rather strict timeframe so hopefully someone here can provide some insight.
    Questions:
    1. For the input, I can get an SC_TC interrupt each time one frame is scanned. I measured this on a scope by toggling a digital output on the card, and there's no noticable jitter on the squarewave which is a good sign.
    However I'd like to combine this with DMA, but the DMA is lagging a bit on the interrupt so I end up having to poll the DMA after all in the ISR, so there's no use using the interrupt in the first place.
    Is there a way to set up continuous DMA servicing and get an interrupt from the DMA system itself after 100 samples are transferred?
    2. For the output, I cannot get continuous mode working with DMA, only by writing to the FIFO manually. I can preload a couple of frames with the dma, but after calling aoStart(), tDMAChannel::write() works once, but all calls afterwards return kBufferUnderflow. Any ideas?
    I probably have to check when exactly to write to the DMA, but I have no idea which of the many status functions to use. Tried with AO_Status_1.readAO_FIFO_Half_Full_St() but that's not it. tried to write it on each UC_TC interrupt but that didn't work either.
    3. DMA is, to my understanding, a more performant way of getting samples into the host and doesn't require to call AI_FIFO_Data.readRegister() in a loop and vice-versa for the output side. But are there really benefits in using DMA?
    4. I made a basic program to bring everything together the simplest way possible: preload 100 samples in the output FIFO, start analog input, start analog output, have the ISR copy all values directly from input to output FIFO.
    Putting both analog signals on a scope, I expected to see the input and about (see question5) 5mSec later the same signal on the output, with no jitter.
    However what I see is the output is just floating around, in other words there is no fixed delay between output and input! How is this possible? I use the same divisor for in-and output. Is there any sample code available that achieves what I want?
    5. Is there a way to start both input and output at the exact same time, eg at the same edge of a certain clock pulse? How are input and output synchronized? Can I be sure they never go out of sync?
    Solved!
    Go to Solution.

    update: looking at the DAQmx control samples, it seems some of them set the start trigger for the AO to the AI start trigger. I mimicked this using kAO_START1_SelectAI_START_1 with the aoTrigger method, and the sync seems better now: the output starts exactly 10mSec after the input (or 5, if I preload only one frame) and stays in sync for about 25mSec. That it goes wrong.
    At the moment I'm using no DMA, just one simple interrupt routine that basically does
    board->Interrupt_A_Ack.writeAI_SC_TC_Interrupt_Ack( 1 );
    board->Interrupt_A_Ack.flush();
    toggle ^= 1;
    board->Static_Digital_Output.writeRegister( toggle ? 0x00 : 0xff );
    for( u32 i = 0 ; i < numSamples ; ++i )
      const u32 val = board->AI_FIFO_Data.readRegister();
      board->AO_FIFO_Data.writeRegister( val );
    In the screenshot in the attachment you can see this goes wrong: cursor A shows the position of the input signal (=AI 0, yellow) that should be shown 10mSec later at the output (blue line=AO). Cursor B shows this 10mSec later position, and you can see there's some garbage right after the cursor. This is the data that was written to the AO FIFO in the fifth interrupt (interrupt position show in purple).
    Trying to figure out where that comes from, I put board->AI_Status_1.readAI_FIFO_Empty_St() in the interrupt loop. And effectively, when trying to read the 500th sample, it reports that the FIFO is empty. Consequently the data written to the AO FIFO does not make sense anymore. But I do not understand how can this ever happen? The SC_TC interrupt is fired whenever 100 samples are read from the input. So after this interrupt occurs, the FIFO should always contain at least 100 samples, no?
    Attachments:
    tek00000.png ‏22 KB

  • GPI Dll Driver for DAC-Bock with in- and output

    Hello,
    i've a little problem creating a Diadem GPI Driver Dll. When i program a driver dll that only has outputs (output from the gpi-block to diadem) every thing works fine. But i need a driverblock with both, in- and outputs. This block has to calculate outputs depending on the inputs and will use an external dll for this calculation. I still get no output from the block i programmed. Are there any examples for a GPI block that does this, because i didn't found one.
    Thank you for your help.

    Hello,
    DIAdem offers three types of DAC blocks, input, output and processing. In most cases you will use just input or output blocks in your DAC scheme. However if you want to implement a special algorithm that calculates some signals depending on some inputs, you have to use the process blocks. You can implement all three kinds of DAC blocks using the GPI wizzard.
    The GPI Wizzard will guide you through the process of building a framework for your driver. At one point there will be a dialog to define the names of the input signals, output signals and process signals. If you enter a name for a process signal here, the wizzard will generate a framework for a DAC process block. This block will have both, inputs and outputs. Once you have finished the wizzard, you can implement your algorithm in the ...ProcessValueGet() function.
    Rainer

  • Hi, iam facing proble in synchronizing 4 ni 4472 cards input with pxi -6052e analog output. please help me out to sort out this problem

    hi, iam facing problem in synchronizing 4 ni 4472 cards input with pxi -6052e analog output. please help me out to sort out this problem

    Hi achyuth,
    Thank you for posting on the National Instruments forum.
    I am not sure what you are trying to do.  Are you trying to input and output at the
    same time?  Are you just trying to
    synchronize all of your inputs?  Do you
    want them to run off the same clock?  If
    you could, give me some more information so I can understand your problem
    better.
    In the meantime, this might help you:
    PXI Timing,
    Triggering, and Synchronization Capabilities of E-Series Multifunction Data
    Acquisition ...
    PXI Timing and Synchronization
    Thank You,
    Nick F.
    Applications Engineer

  • No guitar input with my Edirol UA-5 in Logic Pro 8 and Leopard

    I'm hoping someone else can guide me on getting my Edirol UA-5 working with Logic Pro 8 on my 24" iMac running Leopard. I am getting the sound out playing through the UA-5, but I am not getting any input from the guitar I have connected on Input 2.
    I downloaded the EDIROL UA-5 Driver Ver.2.2.1 for Mac OS X which indicates it is compatible with Leopard. The System Prefs Sound control panel gives me the option for Edirol for input and output and I see the Edirol option at the bottom for the advance settings. Edirol UA-5 is set to advance switch on the back. I have guitar plugged into input port 2 (1/4") with the impedance on High, Sample rate is on REC, Rec Source is Analog, Input Monitor on Mono. I have adjusted the Sensitivity just below setting that turns the Peak light red. I have restarted with UA-5 connected and disconnected and in hub as well as directly to my 24" iMac.
    I've tried in Garage Band and LP8 with input set to the Edirol, but am not getting any response.
    I've exhausted the things to try based on my searching the discussion boards and am hoping someone has a suggestion of what else to try. (besides telling me to buy a Apogee Duo)

    Couple of things to try
    Sounds like you done most of this, just to recheck.
    Open the OSX Audio/MIDI Setup.
    Set the Default Input and Output to the Edirol device.
    Set System Output to Built in Audio.
    Boot Logic, open Logic's audio prefs, Core Audio Enabled
    Set Device to Edirol.
    Buffer to 256 for now.
    Select an Audio track to record on
    Inspector opened, check which input is being used on the audio track,
    default mono tracks are set to input 1, you're plugged into input 2.
    Set Input to 2.
    See if that does it.
    Pancenter-
    Core Audio

  • I have a Sony radio in my car.   With IOS  4 on my IPhone I could use the docking plug to the usb input on the radio and stream ESPN radio or pandora to the radio.  After upgrading to IOS 5 on the phone the Sony radio will not recognize the phone .  Any t

    I have a Sony radio in my car.   With IOS  4 on my IPhone I could use the docking plug to the usb input on the radio and stream ESPN radio or pandora to the radio.  After upgrading to IOS 5 on the phone the Sony radio will not recognize the phone .  Any thoughts.

    I am reading on this site about the error I am getting and it wants me to change some files that I am not comfortable messing with. Mainly because it is like a foreign language. Will the store do this for me or tell me if it is neccessary?

  • I have a new iPhone 6 plus and all is OK. But the mail shows more than 400 'unread' messages whereas there are none in the mailbox or trash or anywhere else I have looked. I can send and receive with no problem. I'm sure I have no unread messages.

    I have a new iPhone 6 plus and all is OK. But the mail shows more than 400 'unread' messages whereas there are none in the mailbox or trash or anywhere else I have looked. I can send and receive with no problem. I'm sure I have no unread messages.

        jsavage9621,
    It pains me to hear about your experience with the Home Phone Connect.  This device usually works seamlessly and is a great alternative to a landline phone.  It sounds like we've done our fair share of work on your account here.  I'm going to go ahead and send you a Private Message so that we can access your account and review any open tickets for you.  I look forward to speaking with you.
    TrevorC_VZW
    Follow us on Twitter @VZWSupport

  • My reminders are gone from my Ical since upgrade.  What do I need to do to input reminders in Ical and be able to print reminders with my ical.  Thank you

    My reminders are gone from my Ical since upgrade.  What do I need to do to input reminders in Ical and be able to print reminders with my ical.  Thank you

    I totally agree.  I just wasted .5 hrs trying to figure out how to manipulate and sync the reminders with the iCAl.  Thanks for posting this thread online, I can stop wasting my time now.  Apple, please change it back or make these apps sync. 
    Side note.  I was creating my to do list and found the ability to asign a date by draging the task to the calendar in the bottom right.  Then I discovered that I can drag that same reminder/to-do task into iCal and it will be created as an event. Would be great if I could simply sync the reminders to iCal instead of draging them over though.  Then when I make the change in one the other can update with the next sync.  This also prevents human error if I drag and drop the reminder onto the wrong date in iCal.

  • I have Real Player Plus and with it you are ment to be able to download videos with it from any site bit the download video icon does not appear despite having everything enabled what's going on?

    I have got Real Player Plus and one of the features of it is being able to download any video.
    Now to do that you mouse on thevideo and a download icon appears on the top right of the video.
    Recently it has stopped working. I have all my Real Player plug-ins enabled and the feature enabled on Real Player Plus to recognise FX 3.6.17 but it doesn't work. Whats going on? I am having to use Internet Explorer to use that feature of Real Player.

    Noticed some of the comments about the new Verizon tv guide. I concur with the crowd indicating displeasure with the guide. Lots of wasted space on the left side, top and bottom of the new guide. The original guide presented more channels and more times with each screen display. The original guide was quite useful for me, and functioned perfectly fine. I would like the opportunity to choose between the two guides. Change isn't always a good thing.

  • App-V PowerShell: Script to Query XenApp Servers for App-V Publishing Errors and Output an Excel Document with the Results

    Please Vote if you find this to be helpful!
    App-V PowerShell:  Script to Query XenApp Servers for App-V Publishing Errors and Output an Excel Document with the Results
    Just posted this to the wiki:
    http://social.technet.microsoft.com/wiki/contents/articles/25323.app-v-powershell-script-to-query-xenapp-servers-for-app-v-publishing-errors-and-output-an-excel-document-with-the-results.aspx

    Hi petro_jemes,
    Just a little claritification, you need to add the value to the variable "[string]$ou", and also change the language in the variable "$emailbody" in the function "Get-ADUserPasswordExpirationDate".
    I hope this helps.

Maybe you are looking for