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.

Similar Messages

  • How to use Oracle Table Type values in Select Statement.

    Hi,
    I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
    For example, try something like the following:
    TYPE t_record IS RECORD (
    ID TABLEA.ID%type,
    NO TABLEA.NO%type,
    v_record t_record;
    TYPE t_table IS TABLE OF v_record%TYPE;
    v_table t_table;
    -- Code to populate the values in v_table here.
    SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
    WHERE ID IN v_table(i).ID;
    I want to know how to use the values from Oracle Table Type in the Select Statement.

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to stop user from entering value for already existing data

    Hi ,
    We have a situation , where we need to give user a template for entering the data and then send it to the database. But we want that if user has already entered the value for a combination, then he should not be allowed to select the same combination again in that template.
    In other words , there should be write access but not update access.
    So I have two questions related to it:
    1. How to build report with giving user , the drop-down list of available members under each dimensions. (I know that we can provide list by writing all of them in excel and then using those values in drop-down)
    2. How to restrict the user for selecting the combination which has already been selected.
    Need your suggestion
    Thanks
    Sanjay

    Hi Sanjay,
    for your first question...
    you can build an EVDRE in a hidden area/sheet to display all values of a desired dimension in rows. Set Option SuppressDataCol to 'Y'. Also maintain MemberSet options to display only the values you need.
    Now you can reference your DD-box to the key- or description range.
    With some VBA-code you can refresh this EVDRE on Workbook_Open and also set the range (attribute ListFillRange?) of you DD-box dynamically to the RowKeyRange.
    Hope, it helps.
    Regards
    Steve

  • Forcing user to enter values at table level

    Hi,
    I have created a table ztest. How to force user to enter the values for certain fields in the table which are not keys, similar to not null in RDBMS. selecting the initial values filed in SE11 populates with some default value, but it doesnt force the user to enter the value.
    Regards,
    Raghu

    Hi,
    Just check out transaction code SE54 for events.
    Go in SE54.
    Give your table name.
    Go in Environment --> Events.
    Here add the Event '01' i.e. Before saving the data.
    Give the name for event eg 'BEFORE_SAVE'.
    Click on Editor to create an include program.
    In the include program write
    form before_save.
      data: f_index like sy-tabix. "Index to note the lines
      loop at total.
        if <action> = 'N' or <action> = 'U'.
          read table extract with key <vim_xtotal_key>.
          if sy-subrc eq 0.
            f_index = sy-tabix.
          else.
            clear f_index.
          endif.
          "(make desired changes to the line TOTAL)
          "End of Modification.
          modify total.
          check f_index gt 0.
          extract = total.
          modify extract index f_index.
        endif.
      endloop.
      sy-subrc = 0.
    endform.
    Note here in field symbol 'Total' your workarea will be their. You can make necessary checks here.
    Or else you can go for making a custom transaction for your requirement.
    Regards,
    Nitin
    *Mark all helpful answers

  • How to force users to enter their ID and password ?

    I am considering installing AirPort Extreme at our office. We don't want guests connecting to our network. is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.

    How to force users to enter their ID and password?
    is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.
    The AirPort Extreme does not have the features necessary to create a "splash page" that provides basic information about the company and asks users for their identity and password....like you see at most hotels.
    Basically, with an AirPort Extreme, users would have to scan to look for the name of the wireless network to join, and then enter the password to connect.
    The best that you might be able to achieve with the AirPort Extreme is create a "hidden" network, which would require that users know both the name of the wireless network and password to connect.  However, based on experience, this might be more of a hassle than anything else.
    The bottom line.....Apple really designed the AirPort routers for home use, so that might be the best place for them in most cases.

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

  • How to force user to enter supplier/customer name in captial letters in R12

    Dear all,
    Could anyone pls advise how to force user to enter supplier/customer name in captial letters in R12? Can I do it using OA framework personalization?
    HY

    Pl post exact versions of OS and EBS.
    The ability to do this exists in forms (professional user interface) using forms personalization, but does not exist in the OAF (self-service) interface, AFAIK. See related MOS Doc 399892.1 (Is It Possible To Restrict Employee Name Entry To All Upper Case in the PUI And SSHR ?) for some details.
    Pl confirm by opening an SR with Support.
    HTH
    Srini

  • Do u know how to prompt user to enter password and validate the password?

    hi all,anyone knows how to prompt user to enter password and validate the password as well?I do not need the GUI.Can someone post the codes here?Thanks!

    hi all,anyone knows how to prompt user to enter
    password and validate the password as well?I do not
    need the GUI.Can someone post the codes here?Thanks!Codes are
    BufferedReader
    System.in
    if
    else
    System.out.

  • Restricting user to exclude values in selection screen

    Hi Everybody,
    I am facing a problem with f.m SELECT_OPTIONS_RESTRICT.
    I want to restrict user, so that he will only be able to exclude values (single, multiple or range) from a selection-option.
    The code snippet is as follows:
    item messages -> restrict selection
      opt_list-name = 'EXCLUDE'.
      opt_list-options-ne = 'X'.
      opt_list-options-nb = 'X'.
      APPEND opt_list TO restrict-opt_list_tab.
      ***-kind = 'B'.
      ***-name = 'A2'.
      ***-sg_main = 'I'.
      ***-sg_addy = ' '.
    ***-op_main = 'EXCLUDE'.
      ***-op_addy = 'EXCLUDE'.
      APPEND *** TO restrict-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
        PROGRAM                      =
          restriction                  = restrict
        DB                           = ' '
        EXCEPTIONS
         TOO_LATE                     = 1
         REPEATED                     = 2
         SELOPT_WITHOUT_OPTIONS       = 3
         SELOPT_WITHOUT_SIGNS         = 4
         INVALID_SIGN                 = 5
         EMPTY_OPTION_LIST            = 6
         INVALID_KIND                 = 7
         REPEATED_KIND_A              = 8
         OTHERS                       = 9
    But this is only including the single multiple and range value. Can anyone throw some light on it?
    Thanks
    Samit

    I took a look at the documentation of this FM to confirm what I was thinking:
    "You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E')."
    So I think this is trying to tell us that we can turn off the ability for the user to enter "exclude" but we cannot turn off the option for the user to enter "include" options.
    When you set ***-sg_main = 'I', it means that only "include" options are allowed.
    I think you will need to do your own validation.
    In the event AT SELECTION SCREEN you can do a LOOP on your selection option name and validate the users selections:
    LOOP AT SO_MINE.
      IF SO_MINE-SIGN NE 'E'.
        SET CURSOR FIELD 'SO_MINE-LOW'.
        MESSAGE E123.
      ENDIF.
    ENDLOOP.
    It has been awhile since I used this FM so please let us know how it goes.

  • How to separate debit and credit values in gl statement report (daywise)

    hi
    experts,
    i have report.
    selection criteria is
    chars of account.
    gl account
    date .
    how to separate debit and credit values in gl statement?.(i know there is a indicator shkzg).
    but send me code.
    op
    date,   total credit,total debit , balances.
    also calculate opening and closing balance.
    u created such type of report then plz help me.
    thanks&regards.\
    ajay.

    Hi,
    Usually it can be determined using the field shkzg. If it contain 'S' its debit and if it contains 'H' then its credit.
    Before showing the amount you need to do like;
    IF wa_gl-shkzg = 'H'.
    wa_gl-dmbtr = wa_gl-dmbtr * (-1). " dbmtr - amount
    ENDIF.
    This will solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Jun 3, 2009 12:29 PM

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • How to block user create personal view and select ALL VIEW?

    How to block user create personal view and select ALL VIEW?

    Hello,
    >create personal view
    To restrict creating personal view, you need to modify your existing permission level or create new one. Login with admin account to your site and open role.aspx page (http://siteurl/_layouts/role.aspx). Then click on existing permission or add new permission
    level-->and move to "Personal Permissions" section-->uncheck "Manage Personal Views - Create, change, and delete personal views of lists" option. Later you can assign this permission to all users, whom you don't want
    to allow to create.
    >and select ALL VIEW
    Since SP does not supports view level permission directly so you have to use custom solution or use below designer solution to restrict user to open any view.
    http://www.codeproject.com/Articles/433486/How-to-set-view-level-permissions-out-of-the-box-i
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • On and iPad how to Allow User To Enter Custom Text  (Dropdown only) Enables users to enter a value other than the ones in the list.

    On an iPad, how do I :
    Allow User To Enter Custom Text
    (Dropdown only) Enables users to enter a value other than the ones in the list.'?

    Are you using the built-in Currency option under the Format tab? If so,
    what you're describing should not happen.

  • How to prevent users from entering '+' or '0' in front of country code in the phone number field?

    Requirement:
    How can I prevent guest users from entering '+' sign or '0' in front of country-code in the visitor phone number field during self registration?
    Few SMS service providers are not looking for '+' sign or '0' or '00' in front of the international phone numbers to trigger the sms. Providing these values in front of country code during self-registration may fail to deliver the sms to recipient.
    Solution:
    Using a simple regular expression, you can validate the entered phone number during the guest registration. 
    The below regular expression will help you to validate the phone number and allows to register only  when the phone number is not staring with '+' or '0'. 
    ^[1-9][0-9](\d{7}|\d{8}|\d{9}|\d{10}|\d{11}|\d{12})$
    It also performs the below validations.
    only numbers are allowed.
    first digit of the entered phone number should be 1 to 9, so '+' or '0' is not allowed. 
    numbers from 0 to 9 are allowed from the second digit.
    also validates phone number length, the length of the phone number should be 9 to 14.
    Configuration:
    To add the above regex in the visitor_phone number filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >>  select the filed visitor_phone and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.
    Note:  Edit the Validation Error as per your requirement.
    Verification
    Adding the given regex will validate the phone number and prevent the guest user from registering the phone number starts with '+' or '0'.
    Please find below the sample outputs for your reference.
    Result when phone number starts with '+' or '0'.
    Successful registration.

    Is this a Mac Preview issue?

  • How To Allow User To Enter "$" In A Number Field

    I have a form that includes various numeric fields in which the user should enter dollar values. It works fine if the user enters a number WITHOUT a dollar sign. Suppose the user enters "1234", the field will display "$1,234.00", which is exactly what I want. However, if the user decides to change the value, clicks on the field, and replaces the "00" with "56" then when they leave the field it will display "$0.00". I've figured out this is because they left the dollar sign in the field when editing.
    So, how can I fix the validation or other settings so that someone could enter "$1234" and have it show "$1,234.00" instead of "$0.00"?
    Thank you!
      Mike

    Hi MJD729,
    Have you applied patterns on the numeric field? select pattern like $1,234.21 in Display and Edit TAB of Patterns- Numeric Field dialog box and then check.
    Regards,
    Ratnesh

Maybe you are looking for