User interaction in pl/sql

hi!!
just wanna know how to accept user input in sql plus using pl/sql??
if i prompt a question "Are u happy today?(Y/N)"
how do i receive user's answer?
thanks..

Hi,
sueazri wrote:
hi!!
just wanna know how to accept user input in sql plus using pl/sql??
if i prompt a question "Are u happy today?(Y/N)"
how do i receive user's answer?
thanks..Sorry, you can't. There's no user input in PL/SQL.
You can use the SQL*Plus ACCEPT command to prompt the user for a value that gets stored in a substitution variable. You can then use that substitution variable in PL/SQL, but it will be resolved before the PL/SQL is compiled, not at run-time.
For example:
ACCEPT     happy_y_n     PROMPT "Are you happy today? (Y/N): "
SET     SERVEROUTPUT     ON
CREATE OR REPLACE PROCEDURE     happy_message
IS
BEGIN
     IF  UPPER ('&happy_y_n') LIKE 'Y%'
     THEN
          dbms_output.put_line ('That''s great!');
     ELSE
          dbms_output.put_line ('Hope you feel better soon.');
     END IF;
END     happy_message
/will create a procedure, but the user input is performed when you run the script above. When you execute the procedure, it uses whatever value the substitution variable &happy_y_n had when you compiled the procedure: it doesn't ask anything at run-time.
Other front-end tools (such as Forms) have their own ways of getting user input (such as dialogue windows).
Edited by: Frank Kulash on Mar 8, 2010 10:24 PM
Added example.

Similar Messages

  • Error in Installation of Aqualogic User Interaction 6.5

    Hi,
    I have installed Aqualogic User Interaction 6.5, with Weblogic 9.2, Apache 2.0.63, Oracle 10g.
    Portal Diagnostic is running successfully.
    But while i am trying to start the weblogic server it is throwing me the following error-
    Task 'InitPortalObjects' failed on startup
    Task #1 <InitPortalObjects) Step#3
    OpenKernal Initialization Failure(Java)
    Recommendation:Review the detailed exception listed below for specific analysis. Check that pthome.xml is in the correct place,check that the PT_HOME environment variables points to it, and check that your database settings by runing ptconfig. Check that your database settings by running ptconfig. check that the portalconfig.xml file is accessible by the web application server.
    My pthome is in the correct place, also the PT_HOME is pointing at the correct place.
    Also the weblogic is pointing to the other machine. Is this the reason for the above error?
    Thanks in Advance!

    Hi Patel,
                         Thanks for your update.
    Regards,
    Hari.

  • Using User Defined Function is SQL

    Hi
    I did the following test to see how expensive it is to use user defined functions in SQL queries, and found that it is really expensive.
    Calling SQRT in SQL costs less than calling a dummy function that just returns
    the parameter value; this has to do with context switchings, but how can we have
    a decent performance compared to Oracle provided functions?
    Any comments are welcome, specially regarding the performance of UDF in sql
    and for solutions.
    create or replace function f(i in number) return number is
    begin
      return i;
    end;
    declare
      l_start   number;
      l_elapsed number;
      n number;
    begin
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(rownum)
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('first: '||l_elapsed);
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(sqrt(rownum))
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('second: '||l_elapsed);
      select to_char(sysdate, 'sssssss')
        into l_start
        from dual;
      for i in 1 .. 20 loop
        select max(f(rownum))
          into n
          from t_tdz12_a0090;
      end loop;
      select to_char(sysdate, 'sssssss') - l_start
        into l_elapsed
        from dual;
      dbms_output.put_line('third: '||l_elapsed);
    end;
    Results:
       first: 303
       second: 1051
       third: 1515
    Kind regards
    Taoufik

    I find that inline SQL is bad for performance but
    good to simplify SQL. I keep thinking that it should
    be possible somehow to use a function to improve
    performance but have never seen that happen.inline SQL is only bad for performance if the database design (table structure, indexes etc.) is poor or the way the SQL is written is poor.
    Context switching between SQL and PL/SQL for a User defined function is definitely a way to slow down performance.
    Obviously built-in Oracle functions are going to be quicker than User-defined functions because they are written into the SQL and PL/SQL engines and are optimized for the internals of those engines.
    There are a few things you can do to improve function
    performance, shaving microseconds off execution time.
    Consider using the NOCOPY hints for your parameters
    to use pointers instead of copying values. NOCOPY
    is a hint rather than a directive so it may or may
    not work. Optimize any SQL in the called function.
    Don't do anything in loops that does not have to be
    done inside a loop.Well, yes, but it's even better to keep all processing in SQL where possible and only resort to PL/SQL when absolutely necessary.
    The on-line documentation has suggested that using a
    DETERMINISTIC function can improve performance but I
    have not been able to demonstrate this and there are
    notes in Metalink suggesting that this does not
    happen. My experience is that DETERMINISTIC
    functions always get executed. There's supposed to
    be a feature in 11g that acually caches function
    return values.Deterministic functions will work well if used in conjunction with a function based index. That can improve access times when querying data on the function results.
    You can use DBMS_PROFILER to get run-time statistics
    for each line of your function as it is executed to
    help tune it.Or code it as SQL. ;)

  • How to print a pdf without user interaction (With C#)

    My boss assigned me a task that to get the ImagePreview of 1st page of PDF.
    My thought is to print the 1st page of PDF to file(virtual print to file), and get the image source, but there comes the problem:
    How can print a pdf without user interaction(With C#),question are these:
    1. I can use the ShellExcute but cannot assign the destination of output file.
    2. User interface is unwanted, I don't want show anyone the Acrobat Reader interface who click the file just want to get a preview.
    3. No place to put those parameters in.
    This problem confused me a lot of days, I wish someone can give some hints.
    Thank you very much!
    (Maybe you will tell me to use Acrobat SDK, please don't, I'm afraid we cannot afford that)

    >I have not read the document yet
    This is the first step. There are many documents, but start with the
    introductory/getting started material.
    > with a index.pdx
    A PDX is a search database to allow you to do fast searching in
    Acrobat.
    >
    >About the relationship between Adobe Reader and Acrobat, as far as I know is that, the previous one is just the reading tool for PDF document, instead, Acrobat can modify and resave the PDF doc. Is it right?
    Effectively, yes. But the Acrobat SDK is mainly for working with
    Acrobat. It's very important to keep this clear, since you have said
    you only have the free Reader, so 95% of what is in the SDK cannot
    work for you.
    >
    >Simply my questions,
    >1. I don't know which dll to refer in the .Net project to print with. Is the ActiveX folder in product folder?
    Simply, there is no point asking these questions, yet, because you
    have not started on the documentation.
    But let's continue in the SDK forum, where I have posed what seems to
    be a very important question about why print to file at all.
    Aandi Inston

  • How to get the User Id from the user interactive task?

    If I need to get the user id or whoever process the user interactive task and save this information to the database, how can I get the user identity who process the interactive task? I tried the owner, creator on the execdata, but it doesn't work.
    Thank you

    try using
    Participant.id or Participant.name
    in the interactivity and update this value in the database.
    HTH
    Narasimha
    Edited by: Narasimha on Mar 6, 2011 9:42 PM

  • Is user interaction possible??

    Hi...
    just like passing parameters to the report... can we have user interaction possible with xml publisher??
    I mean can I specify something like this on the report...
    if(user clicked at some point)
    {   show table if table not shown
    hide table if table already shown }
    Want to know if this kind of interaction is possible....if yes, how?

    Brett
    Thanks for your reply.
    Actually my requirement is that I need to have a drill down of data like when I click on something, its details must be shown...
    So from your reply, I understood that it could'nt be done.
    And as you said , i tried embedding java script . but I am getting an exception saying-element script is not supported yet.
    So my doubt is ,is the syntax same as <script>my js code</script> or do we have any different syntax to follow?
    Thanks again!!

  • File Download Without User Interaction

    Hello,
    basically i want to transfer a file from one server to the
    other. I have a fixed source URL and a ready file handler .jsp at
    the destination server.
    In the past I did a lot with FileReference and their Browse()
    and Download() methods. Now i want to replace those points of user
    interaction and more or less stream the download file into the
    upload handler. Any ideas how i could achieve that?
    Thanks and GzG
    Nerun

    http://forum.java.sun.com/thread.jspa?messageID=3578246&#3578246
    Common sence would have told you that a <input type=file ... cannot be set with script.
    Since this input can be set to hidden you might unwantingly submit files on every page
    you visit.

  • Re-image computer with no user interaction at all - SCCM 2012

    I have searched many posts and havent found a clear solution for my question.
    Basically, I have OSD task sequence ready to go on my SCCM 2012 R2. It is fine to run it as "Available".
    If I deploy the OSD through Software Center as "Required" and "ASAP", then I login the client, the client will run OSD task sequence sometime after about 30Min-1 hour later, not sure. And there will be no user interaction needed. However
    this means I need remotely log into each computer to let OSD happen.
    If I deploy the same TASK Sequence as "Required" and "ASAP" through "PXE", it will first ask PXE Password(Which I set in DP->PXE Panel), then I need hit "Next" again to start the assigned OSD, which means I need
    physically go to each computer to do this. (EDIT: If needed, I can remove PXE password and add VB scripts in other Task Sequence, however I want to know if I still need press NEXT to start the OSD).
    The clients are not AMT enabled but Lan Wake up enabled and also can be set to LAN WAKE UP Enabled with boot from LAN. I can wake up/shutdown the whole collection with command if needed. 
    Is there a way that I can Re-image one collection of Computers without any interaction on client side?  
    The other question is how long to wait for OSD when it is set to "ASAP"?
    RockyOZ

    Guess I just answered question myself. With PXE Password removed, the OSD runs without user interaction. Thanks. I will add the password in task sequences instead.
    RockyOZ

  • How to create user defined metrics for SQL Server target?

    The customer is not able to create a user defined metrics for SQL Server target.
    This is very important for him to use this product.
    He is asking how to create user defined metrics?
    I sent him Note 304952.1 How to Create a User-Defined SQL Metric in EM 10g Grid Control
    But it would work for an Oracle DB, but his target is SQL Server DB
    Not able to find the "User-Defined Metrics" link from Database home page.
    How to create user defined metrics for SQL Server target?

    http://download-uk.oracle.com/docs/cd/B14099_19/manage.1012/b16241/Monitoring.htm

  • Storing User defined reports in SQL Developer

    Hi All,
         I have created some user defined reports in SQL Developer. My company requested me to update the OS from Win XP to Win 7. I forgot to export those reports. I got my machine back, they said that the data is retained. Now i need to take those reports back. Can anyone tell me in which folder would SQL Developer stores the User Defined Reports by default? My bad I dont remeber the Report Name too.
    Can anyone help me on this?
    Boopathy vasagam

    Hi,
    You can check at location
    C:\Documents and Settings\<your_user>\Application Data\SQL Developer
    HTH

  • How to prompt for user input in PL/SQL

    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
    Edited by: desgordon on Sep 3, 2008 10:33 AM

    desgordon wrote:
    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
    >
    If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
    >
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
    But if you call your procedure in that button then yes 'control will be passed back to the code'...
    Cheers!
    Edited by: Faust on Sep 3, 2008 7:57 PM
    Too slow...

  • [svn:fx-trunk] 11532: ComboBox user interactions

    Revision: 11532
    Author:   [email protected]
    Date:     2009-11-06 13:32:37 -0800 (Fri, 06 Nov 2009)
    Log Message:
    ComboBox user interactions
    Added support for an improved user interaction. When the user starts typing in the textInput, ComboBox will now update the textInput with the rest of the matching item. It will then select the non-typed text. When using the navigation keys, the textInput will change to the new highlighted item.
    QE notes: Tests need updating to account for new user interaction
    Doc notes: We should update the docs to describe the user interaction
    Bugs: N/A
    Reviewer: Glenn
    Tests run: DropDownList, ComboBox
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ComboBox.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as

  • Hi i want to execute 3 reports  at one click without user interaction

    hi Friends,
    Hi i want to execute 3 reports with one click ie  by putting radio button when we click on this this wants to execute all 3 reports with out user interaction pls try to understand and provide the solution pls
    Thanks & Regards
    Mohan  Reddy

    Hello,
    To achieve this you can use the SUBMIT command after an user action.
    Example
    The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.
    Program accessed
    REPORT report1.
    DATA text TYPE c LENGTH 10.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    Calling program
    REPORT report2.
    DATA: text       TYPE c LENGTH 10,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    Regards.

  • Is it possible to remove user interaction in a eventListener ?

    Hi,
    I am working on two scripts that both need to deal with the user interaction.
    This following script works just fine. The only matter is that Indesign alerts me that the script prevented the UI dialog from opening.
    What if I don't want any alert ?
    #targetengine "newdialog"
    Application.prototype.main = function(){
         //app.addEventListener ("beforeNew", preventMe, false);
         var myMenuAction = app.menuActions.item("$ID/Document...");
         myMenuAction.addEventListener ("beforeInvoke", preventMe, false)
    function preventMe(myEvent){
         //alert(myEvent.cancelable);
         myEvent.stopPropagation();
         myEvent.preventDefault();
    app.main();
    I thought about userInteractionLevel but I tried to use it recently and I couldn't get it working. My intention was to get an automated update of my modified links when opening a file.
    It's like
    app.scriptPreferences.userInteractionLevel
    couldn't be set once the script has been launched.
    #targetengine "autolinkupdate"
    main();
    function main(){
         var myMenuAction = app.menuActions.item("$ID/kPMOpenDocTextKey");
         myMenuAction.addEventListener("beforeInvoke",removeInteraction,false);
         //app.addEventListener("beforeOpen",removeInteraction, false);
         app.addEventListener("afterOpen",updatelinks, false);
    function updatelinks(myEvent){
         var doc=myEvent.parent;
         var lk = doc.links;
         for(var i=0; i<lk.length; i++){
              try{
                   lk[i].update();
              catch(e){}
         app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    function removeInteraction(myEvent){
         app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    So my question is : Is it possible to remove user interaction in a eventListener ?
    Thanks,
    Loic

    Assuiming NHTEST is a database link to the remote database connecting with SCOTT, use user_Tab_cols@NHTESTNicolas.

  • Dbanalyzer ERROR 25: SQLDBC error -4008, POS(1) Unknown user name/password combination (SQL state "28000").

    Hello Gurus,
    we have a unusual problem with our MaxDB 7.9.8.25
    We want to check the parameter like discribed in note 1111426, but dbanalyzer throws the following error.
    tttadm >/sapdb/TTT/db/bin/dbanalyzer -d TTT -u superdba,****** -f dbanalyzer_InstanceParameterCheck.cfg -o /tmp -i -c 1 -t 1,1
    SAP MaxDB Database Analyzer, The Performance Analysis Tool, Version 7.9.08.25
    Copyright 2000-2014 by SAP AG
    ERROR 25: SQLDBC error -4008, POS(1) Unknown user name/password combination (SQL state "28000").
    But with dbmcli we can connect with the same user.
    tttadm >  dbmcli -d TTT -u superdba,******
    dbmcli on KBP>
    Has anyone a suggestion?!

    Have you tried, if you can actually do SQL with that user? Maybe there is a problem with the SQL authorization?
    Does the following work for you?
    >sqlcli -d tz79 -u dba,dba select * from dual
    | DUMMY |
    | ----- |
    | a   
    1 row selected (1318 usec)
    dbmcli -d tz79 -u dba,dba sql_execute select * from dual
    OK
    END 'a'

Maybe you are looking for

  • Issue in 9.2.0.6 to 10.2.0.4 upgrade

    Hello All, We are in process of upgrading the database [ 9.2.0.6 to 10.2.0.4 ] and application [ 11i CU1 to CU2 ]. We have completed the Database upgrade and all the dba_registry components are VALID. But still there are lots of INVALID objects in th

  • [Lync 2013] Response groups : description size

    Hi. I have difficulties to create or modify groups, queues or workflows with no descriptions. In the web interface, I can set whatever I want as a description for these objects, including empty description, but when I try to do the same using the pow

  • Adding Oracle driver crashes MS ODBC adminstrator

    Howdy, I'm trying to set up the new Oracle 10g ODBC driver and it seems to be crashing the MS ODBC Data Source Administrator. After downloading and exploding the files on my drive, I used the Oracle Universal Installer to set it up. As the next step,

  • HT204088 How can I stop an automatic renewal of a subscription?

    How can I stop an automatic renewal of a subscription?

  • Steps to "de-pod" workspaces in FM 9

    In a current thread http://forums.adobe.com/thread/707908?tstart=0 a user is having problems working with a large file in FM9. I suggested he try "de-podding" the FM workspace to see whether that saved enough RAM and whether that might help to  succe