Ask User confirmation before droping table

Hi,
I need to build a script that ask user a confirmation before that he execute the script that drop a table like "Do you check the log file before droping table Y/N"
I start to do this but it's not working well, I'm new in sql and PLsql
accept condition prompt "Do you check all log file (Y/N)"
DECLARE
V varchar2(1) := 'N';
BEGIN
if &condition=V then
EXECUTE IMMEDIATE 'drop table t';
else
dbms_output.put_line ('please check your log file');
end if;
END;
Regards,

vittel wrote:
Hi,
I need to build a script that ask user a confirmation before that he execute the script that drop a table like "Do you check the log file before droping table Y/N"
I start to do this but it's not working well, I'm new in sql and PLsql
accept condition prompt "Do you check all log file (Y/N)"
DECLARE
V varchar2(1) := 'N';
BEGIN
if &condition=V then
EXECUTE IMMEDIATE 'drop table t';
else
dbms_output.put_line ('please check your log file');
end if;
END;
/if the value of &condition is the single character N, then
if &condition=V thenwill be sent to the compiler as:
if N=V thenWhich assumes there is a variable called N.
I think what you meant was:
if '&condition' = V thenwhich will be sent to the compiler as
if 'N' = V thenNote that substitution variables (like &condition) are evaluated and replaced before the PL/SQL code is compiled, so you can use substitution variables in an anonymous block, like you're doing, but you can't use them in a stored procedure to get user input at run-time.

Similar Messages

  • Can I get Siri to ask for confirmation, before making a call to someone?

    Is it possible to get Siri to ask for confirmation before making a call, or delete the option completely of making a call with Siri, as I am right now avoiding using Siri completely, because it keeps calling up the wrong people, often making accidental transatlantic calls. Even when I am not even trying to make a call of any kind.

    No. I got no answers. i have just stopped using a headset where I accidentally activated Siri often.
    I just tested Siri again to see if the updates have helped, and with in 3 tests, it had made an transatlantic call while I was trying to do an email, so I guess not. If Apple could at least just program into it, that Siri should ask for confirmation, something like "Do you want me to call Andrew?

  • After using Tab Groups earlier today, now anytime I close FF with more than 1 tab open, FF does NOT ask me to confirm before closing

    After using Tab Groups earlier today, now anytime I close FF with more than 1 tab open, FF does NOT ask me to confirm before closing. FF always has asked me to confirm in the past and no settings were changed prior to trying the Tab Groups. Then when I reopen FF all the tabs that I had open are still there. I've tried refreshing FF and clearing history but that didn't work. It's almost as though FF thinks the window and tabs I have open are a tab group and it won't let me get rid of that group. How do I stop the Tab Groups now that I got them? Or is there something else going on? None of this was happening until I played with the Tab Groups this morning. I was curious what it was --- that's going to get me killed one of these days lol.

    Thanks. Somehow the "Show my windows and tabs" box had gotten checked. I know I didn't check that box and the "Warn me when closing multiple tabs" box has always been checked. Like I said, it was all working fine until I tried the tab groups so I'm wondering if maybe that checks the "Show my windows and tabs" box by default?
    Anyway, it's fixed now. Thanks so much!

  • Configure Firefox to confirm before overwriting a file

    I and most of the world's population do not have the best internet connection. At times it would manifest itself in a download that never finish and has to be manually canceled. The problem arises when after a successful download instead of clicking the "open folder containing file" I accidentally click the "Retry" button from the failed download just below it.
    Firefox would overwrite the successfully downloaded file without asking for a confirmation. This is especially vexing for larger files which has huge cost for the user both in wasted time and money.
    While this can be avoided if the user has the "Always ask me where to save files" option selected, said option caused another hassle when downloading a large number of smaller files.
    In short, my question is :
    is there a way to ensure Firefox -always- asks for a confirmation before overwriting a file ?

    Hi maladore,
    I suppose if this is a common problem there may be an addon or utility that addresses this problem already. Try searching for download managers.
    * For addons look in <br />https://addons.mozilla.org/en-US/firefox/extensions/download-management/
    * For a brief feedback comment use <br /> https://input.mozilla.org/en-US/feedback
    Someone may know of a good solution or addon.
    You are in the wrong place if trying to suggest a Firefox enhancement, developers are not going to notice requests on this forum.
    The people who answer questions here, for the most part, are other Firefox users volunteering their time (like me), not Mozilla employees or Firefox developers.
    If you want to leave feedback for Firefox developers, you can go to the Firefox ''Help'' menu and select ''Submit Feedback...'' or use [https://input.mozilla.org/feedback this link]. (You'll need to be on the latest version of Firefox to submit feedback). Your feedback gets collected at http://input.mozilla.org/, where a team of people read it and gather data about the most common issues.

  • User exit before TO creation to chage MAKTX field or FM to change it after

    Hi all,
         I need some WM Expertise help.
         When I create a Sales Order from program (with bapicreatefromdata2) , the system automatically create a delivery, and then, a transfer order with no immediate confirmation. The TO is manual confirmed. In bapicreatefromdata2 I completed on each item line the field ARKTX with a description (Example: red - material description ). This field is automatically completed in delivery( same field ARKTX). But I need this description also in transfer order for each line (field MAKTX). The TO is created automatically and  the field MAKTX is completed with the description from the material master.
         So, I need an user exit before TO creation to change the field MAKTX. I have tried user exit: MWMTO001 and is not working I think because the TO is created with no immediate confirmation. Also I putted break-point everywhere in program SAPML03T (standard program for TO creation)  and  I changed the settings in debugger mode. I checked System Debugging and Update Debugging. Nothing happened. I cannot find the place before TO is created.
         An alternative to this is to update LTAP (item table for TO) after TO immediate creation in include MV45AF0B_BELEG_SICHERN but I can't find a function module to update the table before TO manual confirmation. I tried L_TO_UPDATE_PREPARE but this I think is for confirmed TO.
         Any one who worked on this kind of things, Please help.
         Thanks in advice,
         Bogdan

    check these exits....                  
    EXIT_SAPMM06E_012 
    <b>EXIT_SAPMM06E_013</b>
    EXIT_SAPMM06E_014 
    EXIT_SAPMM06E_006 
    EXIT_SAPMM06E_007 
    EXIT_SAPMM06E_018 
    EXIT_SAPMM06E_016 
    EXIT_SAPMM06E_017 
    vijay

  • N8 Belle instaled without user confirmation

    I was just plug the usb cable to my N8 just to charge it to my computer as i always do every day cause battery sucks.
    after an hour my friend call me to my other phone and he tell me that my N8 is out of reach or it is turned off.
    So, immediatly, i went to my room, check my N8 screen and i saw a message to ask for my PIN.
    after inserting the PIN, phone ask for my security number (???) and.... **bleep**?
    welcome to Symbian Belle!
    who do this? without user confirmation? why?
    This is Illegal and it called Piracy!
    my conatcs and photos where there by all my apps, wifi settings etc where lost.
    Thank you Nokia, that's very clever! next time F**k  all my stuff and my computer too.
    The bigger problem is that there is no Greek language support. I can read Greeks but i Can't write, and menus are all to English
    Please help me because.... (*&^$##%^) aaarghhhhhh!
    Bytheway, Symbian Belle is stupid, slow, and ugly.
    also, i am living alone, so, no one is messing with my computer

    @gask10
    Whilst default setting within Nokia Suite is to launch application upon connecting device to PC I have never heard of it "clicking" on update confirmations by itself!
    If Greek language pack had been previously added to device this would unfortunately be lost upon updating to Symbian Belle.
    Happy to have helped forum with a Support Ratio = 42.5

  • How to ask user to enter value in select statement

    Hi,
    Can anyone tell me syntax of select statement where i can ask user to enter value .
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empname
    SP2-0552: Bind variable "empname" not declared.
    2.Is there any data dictionary table to see all pl/sql procedures and corresponding code?
    Thanks,
    sri

    user632733 wrote:
    Can anyone tell me syntax of select statement where i can ask user to enter value .None. The SQL engine resides on the server. It is incapable of prompting for data entry on the client.
    The client interacts with the user. The client is suppose to:
    a) prompt for variable values
    b) send a SQL statement to Oracle
    c) bind values to bind variables in the SQL statement
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empnameIn SQL*Plus, you need to create a bind variable:
    SQL> var empname varchar2(200)
    And then assign a value to it:
    SQL> exec :empname := 'John Doe';
    Note that this is still not ideal - as the assignment is also done via the server and sends a PL block to the server. This block contains non-sharable code and this can lead to fragmentation of the server's Shared Pool.
    But it does illustrate the basic principle.

  • How to reset All users and delete their table?

    Hi,
    i want to know How to reset All users and delete their tables with username- system and password-manager.
    thanks

    Hi
    Here delete means truncate or drop?????
    If drop use the following statement to generate the script:
    select 'drop table ' || Owner || '.' || Table_Name || ';' from Dba_tables
    where owner in (<All_the_users_you_want_to_reset>);
    But before firing the above statement extract the DDL's to create all the users and put it in a file and just run that file to re-create the users.
    if its truncate then:
    select 'truncate table ' || Owner || '.' || Table_Name || ';' from Dba_tables
    where owner in (<All_the_users_you_want_to_reset>);
    Hope this Helps
    Regards

  • User Exit BEFORE Login

    Hi experts,
    I have a problem:
    We use differerent solutions for Web Access for externals - Web Dynpro and a normal GUI, shown via WEBGUI.
    So we create a new user (SU01) for the external and he can access the system
    But this problem may appear:
    The external tries to login via OPERATOR, DDIC, SAP*,... and lock this user - system will hang up!
    Solution can be a user exit BEFORE login, so we can check the user name (OPERATOR...) and don't authorize for login.
    Is there a user exit? I know the exit EXIT_SAPLSUSF_001 - bt this one is too late (after login).
    Also it would be important to know if the login is via SAPGUI oder via WEBGUI/Webdynpro (in EXIT_SAPLSUSF_001)
    Any ideas on this?

    Hi,
    why don't you unlock the User?
    Try this:
    data: wa_return type table of BAPIRET2.
    If sy-uname = 'OPERATOR'
    CALL FUNCTION 'BAPI_USER_UNLOCK'
      EXPORTING
        USERNAME       = sy-uname
      TABLES
        RETURN         = WA_return.
         CALL 'SYST_LOGOFF'
    endif.
    Hmmm...I will try this. But I'm not sure if I will reach this point if I try to login with the wrong password?!
    Edit: I tried to logon with a wrong password (before i created a hardcoded Breakpoint in the user exit). But I won't reach this point.
    So the question is not solved. If someone tries to logon as Operator several times, user Operater will be locked. How to prevent to log on via specific users (like Operator, DDIC...) in the Webgui?

  • I have bought macbook air first form other owner from few month,but after i try reinstall back lion os x..its cant reinstall back already..i try ask the owner he keep saying you need send repair..so i decide ask at here before i send to any service..

    i have bought macbook air first form other owner from few month,but after i try reinstall back lion os x..its cant reinstall back already..i try ask the owner he keep saying you need send repair..so i decide ask at here before i send to any service..

    StoneComputers wrote:
    What about the incredable lag time from clicking on a program to the time it opens (or the time till the loading screen starts)? I wish I could record it and play it so I could see if thats normal from other members... the icon just sitting there for over 35 second (I just counted 36 till the loading screen popped up) at first I thought it was me not clicking hard enought cuz the mouse button I have is real stiff (any ideas on that?) but no it takes that long just to get to the app loading screen... this happens every time same amount of time with the 3 programs I use the most, prolly more but I know for a fact world of warcraft, uTorrent, and Google Chrome. I would just chalk it up to slow hardware but they load real quick in windows 7 and once this bad spot is loaded the program runs so fast and nice afterword. Maybe some tweeks? I wonder if this would happen in Snow?
    The coment "few outdated programs" Ive seen alot its not just a few its a lot and since games are not Apple's strong point I would think they would want to keep as many as they could...
    An example of the rants you will see from a lot here. Don't be put off as these problems are generally user specific, and these same old comments come out after the release of every OSX I can remember. When Lion is upgraded  to the next OSX you can gaurentee these forums will be full of people screaming about how great Lion was. Happened with Tiger, Leopard and Snow Leopard.
    So come to think of it you may be better off Googling sites that give you unbiased views on Lion, rather than expect any positive comments here. For every one complaint there are probably 100,000 people with no issues.
    Cheers

  • User confirmation message display

    Hi,
    When the user selects a menu item, I want to display a confirmation message and after the user confirms, I want to proceed forward else I want to close the application.
    Is it possible to display a message to user asking for his confirmation.
    Thanks in advance.
    Venu.

    I could able to achieve it by the display text itself. I am reading the response of the display text message and then according to the key press by the user I am proceeding. I am checking whether user has clicked USER_ABORT or BACKWARD_MOVE or TIME_OUT. Can you tell me whether this is supported by all the handsets??

  • Jquery confirmation before running delete process.

    All,
                Ive a process to delete a record in the table but i wan to show a jquery dialog confirmation(not simple js confirm function) with YES & NO button so if i click Yes it deletes that record otherwise cancel the delete. Ive written the delete process and that works and displays the successful message as needed but now i want to add the confirmation part which prompts before that delete, what do i need to change ?
    thank you.

    1. Re: jquery confirmation before running delete process.
    RameshP
    Hi,
    This is where iam so far, ive put the hidden DIV and added the js code and the hidden item, so if you click the button it popups the div with OK & CANCEL btn also set hidden item = ID value. also i put the process condition expression 1 eq 2 P1_REC_ID THE VALUE of ID eg 3. but clicking ok doesnt delete the record.
    what am i missing here?   thank you.

  • How to block order confirmation, before issue of raw materials?

    Dear Frndz,
    My client would like to block order confirmation, before issue of raw materials.Also, they do not want to use backflush concept.Pls help me out with the step by step process.
    Regards,
    Srini

    Srinivasan,
    You can think of using available user exits which are listed below,
    CONFPP01            PP order conf.: Determine customer specific default values
    CONFPP02            PP order conf.: Customer specific input checks 1
    CONFPP03            PP order conf.: Cust. specific check after op. selection
    CONFPP04            PP order conf.: Customer specific input checks 2
    CONFPP05            PP order conf.: Customer specific enhancements when saving
    CONFPP06            PP Order Confirmations: Actual Data Transfer
    CONFPP07            Single Screen Entry: Inclusion of User-Defined Subscreens
    Please take help from your ABAP consultant.
    Hope this helps you.
    SmanS

  • Need help to change user email id in table ADR6

    Hi,
    i want to update user email id in table adr6. i hv written following code but not working to change email in table adr6.
          DATA lo_nd_email TYPE REF TO if_wd_context_node.
          DATA lo_el_email TYPE REF TO if_wd_context_element.
          DATA ls_email TYPE wd_this->element_email.
          DATA lv_mail_id LIKE ls_email-mail_id.
        navigate from <CONTEXT> to <EMAIL> via lead selection
          lo_nd_email = wd_context->get_child_node( name = wd_this->wdctx_email ).
        get element via lead selection
          lo_el_email = lo_nd_email->get_element(  ).
        get single attribute
          lo_el_email->get_attribute(
            EXPORTING
              name =  `MAIL_ID`
            IMPORTING
              value = lv_mail_id ).
          DATA:lv_bname TYPE BAPIBNAME-BAPIBNAME.
          DATA:lt_return TYPE TABLE OF bapiret2.
          DATA:PER_NO TYPE AD_PERSNUM,
               ADDR_NO TYPE ADRC-ADDRNUMBER."AD_ADDRNUM.
          DATA:SEARCH TYPE REF TO IF_WD_CONTEXT_NODE.
          SEARCH = WD_CONTEXT->GET_CHILD_NODE( 'USER' ).
          SEARCH->GET_ATTRIBUTE( EXPORTING NAME = 'BNAME'
               IMPORTING VALUE =  lv_bname ).
          DATA:wa_address TYPE bapiaddr3.
          DATA : CONS_NO TYPE AD_CONSNUM.
        IF lv_mail_id IS INITIAL.
              get message manager
              DATA lo_api_controller TYPE REF TO if_wd_controller.
              DATA lo_message_manager TYPE REF TO if_wd_message_manager.
              lo_api_controller ?= wd_this->wd_get_api( ).
              CALL METHOD lo_api_controller->get_message_manager
                RECEIVING
                  message_manager = lo_message_manager.
              report message
              CALL METHOD lo_message_manager->report_error_message
                EXPORTING
                  message_text  = 'Please Enter Email Id'.
        ENDIF.
       DATA:l_addr type addr_keynr.
       DATA:C_YES(1).
            CLEAR:C_YES.
            C_YES = 'X'.
       TYPES: ty_comm_smtp TYPE  adsmtp ,             
            ty_returncode TYPE SZAD_FIELD-RETURNCODE,
            ty_error TYPE ADDR_ERROR,
            adsuse TYPE ADSUSE.
        DATA:EMAIL_ID TYPE AD_SMTPADR,
             lt_comm_smtp TYPE STANDARD TABLE OF ty_comm_smtp,    """"Data Object
             lv_returncode TYPE STANDARD TABLE OF ty_returncode,
             error_table TYPE STANDARD TABLE OF ty_error,
             lt_adsuse  TYPE STANDARD TABLE OF adsuse.
        data:ls_comm_smtp like LINE OF lt_comm_smtp,
             ls_returncode like LINE OF lv_returncode .
        CALL FUNCTION  'SUSR_USER_ADDRESSKEY_GET'
          EXPORTING  BNAME    = lv_bname
          IMPORTING  PERSNUMBER    = l_addr-persnumber
                     ADDRNUMBER    = l_addr-addrnumber
               EXCEPTIONS ADDRESS_NOT_FOUND = 1
                          OTHERS            = 2.
      IF SY-SUBRC = 0.
        REFRESH: lt_comm_smtp.
          CALL FUNCTION 'ADDR_PERS_COMP_COMM_GET'
               EXPORTING
                    address_handle    = ''
                    address_number    = l_addr-addrnumber
                    person_handle     = ''
                    person_number     = l_addr-persnumber
                    DATE_FROM         = '00010101'
                  LANGUAGE          = SY-LANGU
                    table_type        = 'ADSMTP'
                    iv_current_state  = space                       "*981i
               IMPORTING
                    returncode        = ls_returncode
               TABLES
                    comm_table        = lt_comm_smtp
                    error_table       = error_table
                    et_usage          = lt_adsuse                   "*981i
               EXCEPTIONS
                    parameter_error   = 1
                    address_not_exist = 2
                    person_not_exist  = 3
                    internal_error    = 4
                    OTHERS            = 99.
          IF sy-subrc <> 0.
            IF sy-subrc = 1 OR sy-subrc = 2 OR sy-subrc = 3.
             raise_message 'AM' 'A' 885 'ADDR_PERS_COMP_COMM_GET' space
             space space internal_error.
            ELSE.
             same_message_dia_a internal_error.
            ENDIF.
          ENDIF.
      ENDIF.
        CLEAR:ls_comm_smtp, email_id.
        READ TABLE lt_comm_smtp INTO ls_comm_smtp INDEX 1.
        EMAIL_ID = ls_comm_smtp-smtp_addr.    """""""OLD EMAIL ID which we get from ADDR_PERS_COMP_COMM_GET
        CONS_NO = ls_comm_smtp-CONSNUMBER.
        CLEAR:ls_comm_smtp.
        ls_comm_smtp-CONSNUMBER = CONS_NO.
        ls_comm_smtp-FLGDEFAULT = 'X'.
        ls_comm_smtp-HOME_FLAG = 'X'.
        ls_comm_smtp-UPDATEFLAG = 'U'.
        ls_comm_smtp-smtp_addr = lv_mail_id.
        TRANSLATE email_id TO UPPER CASE.
        ls_comm_smtp-smtp_srch = email_id.
        REFRESH :lt_comm_smtp.
         append ls_comm_smtp to lt_comm_smtp.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'ADDR_PERS_COMP_COMM_MAINTAIN'
             EXPORTING
                  address_handle    = ' '
                  address_number    = l_addr-addrnumber
                  person_handle     = ' '
                  person_number     = l_addr-persnumber
                  table_type        = 'ADSMTP'
                  iv_time_dependence = C_YES                   "*981i
            IMPORTING
                 returncode        =  ls_returncode
            TABLES
                 comm_table        =  lt_comm_smtp
                 error_table       =  error_table
            EXCEPTIONS
                 parameter_error   = 1
                 address_not_exist = 2
                 person_not_exist  = 3
                 internal_error    = 4
                 OTHERS            = 99.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
      ENDIF.
      IF sy-subrc = 0.
          COMMIT WORK.
      ENDIF.
    i hv also tried second approch available on sdn CALL FUNCTION 'ADDR_COMM_MAINTAIN'. but in this fm person number we can't pass.
    please help me

    Hi Abhilesh,
    You can use the following FM's to update the Email ID. There are many posts ADDR* FM using for updating Email ID.  Please have a look if you have a doubt.
    DATA: iadsmtp TYPE adsmtp    OCCURS 0 WITH HEADER LINE.
    "Retrieving Address Details
    CALL FUNCTION 'ADDR_COMM_GET'
          EXPORTING
            address_number =  addrnr
            table_type     = 'ADSMTP'
          TABLES
            comm_table     = iadsmtp
          EXCEPTIONS
            OTHERS         = 0.
    READ TABLE iadsmtp index 1.
    if sy-subrc is initial.
    iadsmtp-SMTP_ADDR = 'new mail ID'.  " Here pass your New Email ID
    Modify iadsmtp.
    Endif.
      CALL FUNCTION 'ADDR_COMM_MAINTAIN'
          EXPORTING
            address_number           = addrnr
            table_type               = 'ADSMTP'
            substitute_all_comm_data = 'X'
          TABLES
            comm_table               = iadsmtp
          EXCEPTIONS
            OTHERS                   = 0.
    Then call FM 'ADDR_SINGLE_SAVE'  to do the Commit.

  • How to Get Most Current User View Before Checking In.

    Hi,
    We have several custom workflows which users can start from end-user menu and have some resource accounts created/modified after approvals.
    User view is checked out once at the beginning of each workflow, then some user attributes are modified through forms and user view is checked in with new attributes at the end.
    If any user starts a workflow (say W2) before completion of another workflow (say W1) he started before, and W1 is completed when W2 is waiting for approvals or etc., W2 completely discards changes made to user view through W1 since it has already checked out the user view before.
    If I checkout the user once more just before checkin, I'm able to get a current user view but this time changes made through forms used in the current workflow are lost.
    What's the best way, to get an updated user view of the user without overwriting any changes made out of the running workflow and losing form data?
    Regards,
    Mehtap.

    In a situation like this, you should probably change the front end to store the changes in workflow variables instead of using the view directly. Then, post approval, you checkout the view and apply the changes. I've used this approach to perform changes on large numbers of users (kind of like a bulk action, only more reliable).
    Alternatively, you can checkout the user object at the beginning of the workflow, and this will prevent your race condition by putting a lock on it. This will obviously cause problems (for you) if your users expect to be able to do multiple changes simultaneously. Don't try this approach if an angry mob will storm your cubicle -- IDM coders are hard to come by.
    Jason

Maybe you are looking for