User Prompts in SQL

Hello everybody,
I am trying to run a SELECT statement where I would like to use an input box to enter in the name of a customer in my database. However, when it runs, I just get a 'no data found' error.
Here is my code:
SELECT firstname, lastname
FROM customers
WHERE lastname = UPPER('&Custval');
So I have tried also using the ':' in instead of the character '&' but same result comes up.
Please let me know what I am doing wrong.
I am using the Oracle Application Express for this code.
Any advice would be great!
Thanks!

Hi,
Welcome to the forum!
Substitution variables (starting with &) work in SQL*Plus and some similar front ends. I don't think they work in Apex.
I'm sure Apex has a way to set bind variables (starting with : ).
Close this thread, and open one in the Apex forum
Oracle Application Express (APEX)
This is the SQL and PL/SQL forum. Neither SQL nor PL/SQL has any way of getting input that the user types at run-time; that's done by the front end, which in your case is Apex.

Similar Messages

  • Crystal Report not pulling over user prompts

    I am having issues with a Crystal Report that is pulled over into a third party CRM db. I've already checked the Forums and the SAP notes but have had no luck in finding any help. Our Crystal Report pulls up fine on the client, but it is missing the user prompts (parameters) when it comes through. We don't get any errors what so ever. The user is supposed to put in the date range that they would like to see. Other reports which don't have any prompts work fine. We've run the reports in Crystal on the server and they work just fine. We are just having this problem whenever the client is trying to run the report. When we've talked to our technical support for our CRM db they said we are supposed to get a lightning bolt and then when we click on it, it will prompt the user. However, the lightning bolt doesn't even show up when the report is pulled up. I'm not sure is there is something being done wrong within our report, or if this is an issue with the Active X controls. We are using Crystal Reports XI on an SQL 2005 server. Any help is greatly appreciated - I'm very new to this so if someone could please point me in the right direction it would be helpful. Thanks!

    Hello,
    The Lightning bolt is the report refresh button in CR 10. CR 11 has blue circular arrows, one on top of the other. Or you can simply press the F5 key to refresh. It may be you are mixing versions or something else.
    I suggest you work with your tech support to figure out how your application should work and what is posibly missing. If you have the report Designer and they work there then your app or DB has issues.
    We don't know your app or how it all is supposed to work so not much we can suggest other than to get your support to help you.
    If it's a WEB app then possibly the you have the Pop-up blocker enabled, the Parameter UI would considered a pop-up.
    You relaly need to get your CRM support guys to help you first. If thye can't figure it out then ask them to put a call into support.
    Thank you
    Don

  • Selecting a column in Answers report based on user prompt/ apply filter

    I need to do the following in OBIEE Answers report (version 10.1.3.4.1):
    1) Think of a simple table with dim TX_type and some measures like month_jan, month_feb, month_mar
    so the fact table looks like (column names) tx_type, month_jan, month_feb, month_mar
    2) I need to select the measure column based on a user dashboard prompt, prompt populates a presentation variable var_month = jan or feb or mar
    3) I need to select the correct measure (one of these month_jan, month_feb, month_mar) and then apply column filter based on the dim TX_type to split the values of these into multiple columns for report. So the report may look like (in Answers)
    Sales , Tax, overheads
    where Sales may be defined as sum(month_jan) where rows have TX_type = 'sales'
    where Tax may be defined as sum(month_feb) where rows have TX_type = 'tax'
    where overheads may be defined as sum(month_mar) where rows have TX_type = 'overheads'
    IF the user selects jan
    IF user selects Feb then the 3 report columns are based on month_feb and likewise for month_mar
    I cannot use column selector option as the report column further apply filter in column filter definitions in Answers...
    4) When I try to build the column filter using a presentation variable (var_month), the presentation variable is not getting populated in the column filter.
    For e.g. IF var_month = 'jan'
    THEN month_jan (let us assume the logical column name is month_jan too)
    ELSE month_feb and so on...
    However, the var_month always shows 0 in the IF clause. If we used a repository variable instead, it works fine. But since repostory variable cannot be changed on the fly (by user prompt) it is not usable.
    We cannot change fact table defintion....and we have 12 measures column and about 8-10 different colum filter based report columns using this measure.

    Hi shyamvaran,
    have you thought about a SQL statement in the prompt, something like:
    SELECT
    case when 1=0 then Table."Column" else 'Jan' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Feb' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Mar' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Apr' end
    FROM "Subject Area"
    etc...
    Use this to give you the 12 values for your months then give the prompt column a presentation variable name and set a default value in the 'Default To'. Also set the same default value for the filter.
    A couple of points:
    1. If you're transforming the presentation variable from 'Jan' to 'month_jan' you may need to edit the syntax for the filter column (not using the dialog box).
    2. If you're transforming the behaviour of a dimension / measure column in the report, have you specified the syntax correctly, e.g. sum('@{pres_var}')?
    Hope this helps,
    Justin

  • Change Prompt in Sql Plus

    Hi
    How can I to change Prompt in Sql Plus for to show Enviroment and user ?

    this wont work for a pre 10 client.
    there you can set the prompt manaualy and this is not dynamic.
    make a login.sql
    and place the following in the file.
    column sqlprompt_col new_value sqlprompt_value
    set termout off
    define sqlprompt_value='NOT CONNECTED'
    select sys_context('userenv','SESSION_USER')||case when sys_context('userenv','ISDBA') = 'TRUE' then ' as sysdba ' end ||'@'||sys_context('userenv','DB_NAME')||sys_context('userenv','INSTANCE') ||'('|| case when instr(sys_context('userenv','HOST'),'.')>1 then substr(sys_context('userenv','HOST'),1,instr(sys_context('userenv','HOST'),'.')-1) else sys_context('userenv','HOST') end ||')' as sqlprompt_col from dual;
    set termout on
    set sqlprompt '&sqlprompt_value SQL> '
    after connecting sqlplus will look for a login.sql file in you present working directory or in its $ORACLE_HOME\sqlplus\admin directory.
    if you reconnect is needs to be run again because it is not dynamic.
    there is no workaround for pre 10g clients

  • Accepting User input in SQL*Plus

    I am writing a SQL script in SQL*Plus that accepts a value from the user and plugs that value into a variable that exist in several locations outside of the PL/SQL block.
    I am able to do this, yet everytime this variable is encountered, the user is prompted for input. I would like to have the user prompted only once at the beginning and then use that value throughout. This seems like a simple task, yet I cannot get it to work.
    Any help would be greatly appreciated.

    You can use &&<variable_name> and it will define the variable and use it throughout the SQL code.

  • User input in SQL /PL-SQL

    Can I take the user input in SQL or PL/SQL please tell the procedure how can I do that suppose I am interested to get the information of the employee by respect to his age where age will be the user input (any person who will run the query prompted that enter the age)

    in PL/SQL you cannot make any terminal input because PL/SQL is running only on server side and has not been designed to handle such kind of input.
    With SQL*Plus, you can use PROMPT, ACCEPT instructions: see
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref1089

  • CR Server - Report with multiple sub reports prompts for SQL connection for

    I have a report published in CR Server. The Report has four subreports. When the report is run from CR Server, the initial SQL Server connection log in is automatically handled by the log in details in CR Server, but the report then prompts for SQL Server log in four times, presumably for each sub report.
    How can I get rid of these SQL login prompts?
    Rgds
    Tony Maguire

    ARF
    Yes - it looks like it might have been to do with the contents of the ".sqldeveloper" directory. Probably SQL Developer may have got confused with me running the same SQL on the same database under different users.
    We create a read-only user to carry out queries against the live schema. This read-only user has only select privileges and no insert/update/delete privileges.
    Thanks for the feedback

  • Possible to find session/user who ran SQL in v$SQLAREA ?

    Using this:
    select * from v$sqlarea where sql_text like '%2412982%' and sql_text like '%prms%' and module != 'sqlplusw.exe';
    I am able to locate a particular instance of a piece of SQL being executed and stored in the library cache.
    However, I would really like to know who run it but I never "catch them".
    Is there a way?
    1* select * from v$sqlarea where sql_text like '%2412982%' and sql_text like '%prms%' and module != 'sqlplusw.exe'
    SQL> /
    SQL_TEXT
    SHARABLE_MEM PERSISTENT_MEM RUNTIME_MEM SORTS VERSION_COUNT LOADED_VERSIONS OPEN_VERSIONS USERS_OPENING FETCHES EXECUTIONS USERS_EXECUTING LOADS FIRST_LOAD_TIME INVALIDATIONS
    PARSE_CALLS DISK_READS BUFFER_GETS ROWS_PROCESSED COMMAND_TYPE OPTIMIZER_MODE PARSING_USER_ID PARSING_SCHEMA_ID KEPT_VERSIONS ADDRESS HASH_VALUE
    MODULE MODULE_HASH ACTION ACTION_HASH SERIALIZABLE_ABORTS CPU_TIME ELAPSED_TIME I
    CHILD_LATCH
    select it.company, it.product, p.description, it.transaction_code, ifsapp.km_util_api.conv_to_date_fmt(it.company,to_date(it.transaction_date,'YYYY-MM-DD')) order_date, it.reference, it.wareh
    ouse_id warehouse, it.transaction_quantity, it.inventory_unit_of_measure, it.location_aisle, it.location_row, it.location_tier, it.lot_identifier, it.user_profile, it.reference_2, it.referenc
    e_3 from ifsapp.prms_inventory_transaction it, ifsapp.prms_product p where it.company=p.company (+) and it.product=p.product (+) and it.company=upper('OKM') and ((it.lot_identifier like upp
    er('%2412982%')) or ('' is not null and it.lot_identifier like upper('%%')) or ('' is not null and it.lot_identifier like upper('%%')) or ('' is not null and it.lot_identifier like upper('%%')) or
    ('' is not null and it.lot_identifier like upper('%%'))) and (('' is null or rtrim(it.product)=upper('')) or (rtrim(it.product)=upper('')) or (rtrim(it.product)=upper('')) or (rtrim(it.product)=
    8328 3616 17240 1 1 0 1 1 1 1 0 1 2006-09-28/08:47:09 0
    1 134719 134846 0 3 CHOOSE 166 166 0 07000004A8D88FB0 1040757058
    Repetitive Distribution.exe 0 0 0 34410000 58880847 N
    3

    I think the SQL listed is wrong, as it only display the SQL created by Oracle whenever the user login, which is:
    SELECT DECODE('A','A','1','2') FROM DUAL
    And all subsequent SQL issued by the user during the session is not listed.
    I am also in the midst of trying of get the user issuing the SQL :-).....MANY THANKS AHEAD....

  • Grouping of data based on user prompt having a list of dimensions

    Hi All,
    I have a requirement to be able to group data in OBIEE request or Dashboard based on user prompt selection.
    The prompt should list the Dimensions Available
    e.g.
    Dimensions: Product, Region, Employee
    Fact: Sales
    The report is to display sales total for the quarters of the current year.
    The user prompt should list the available dimensions (In this case - Location, Employee and Product).
    If I choose Product, the data is to be grouped by Products - Layout having a simple tabular grouping with Product names as Group headings.
    Similarly any other choice of Dimension from the prompt should group the data by that dimension and have the dimension values used in the group headings.
    How could we implement this? I understand this type of requirement (ability to choose dimension) is met in some OLAP reporting tools.
    I have used multiple views and the View Selector for similar requirements previously, but looking for a dynamic solution here.
    Any pointers or solution will be great.
    Thanks,
    Kiran
    Edited by: Kiran Kudumbur on Sep 8, 2009 5:43 PM
    Edited by: Kiran Kudumbur on Sep 9, 2009 12:42 PM
    Edited by: Kiran Kudumbur on Sep 10, 2009 2:26 PM

    Hi All,
    I used column view to address this requirement.
    Thanks,
    Kiran

  • 1 User Prompt for 2 rows in Financial Reporting ?

    Hello,
    for 2 years, I am struggling with following-
    we have very detailled (detailled in 2 or 3 dimensions - let's say here: CBU and CostCenter ) reports, which run very long
    in order to give user the overview/total as well, we want to give the total over all 2 or 3 dimensions only
    the user should be allowed to choose 1 or more values (CBUs) via user prompt
    current workaround is to have 2 user prompts (1 for detailled combinations) and (1 for total) and asking the user to fill the CBU 2 times
    if user is not chosing same CBU(s), then report is inconsistant:
    as many people have to use dozens of values and because there is no select all/ deselect all function - the handling is very annoying for the users.
    Sample Report Definition
    ...........................................Dimension 1...........................................Dimension 2
    Row 1 (of report definition): Descendants of Prompt for CBUs..............Descendants of Costcenter
    Row 2 (of report definition): Prompt for CBUs....................................Costcenter Total
    by this, we get a sample output like this: (Projects are the level 0 members of CBUs in CBU dimension)
    ...........................................Project A from CBU I.....................CostCenter X...............50
    ...........................................Project A from CBU I.....................CostCenter Y...............20
    ...........................................Project B from CBU II....................CostCenter X...............10
    ...........................................Project C from CBU III...................CostCenter Z...............100
    ...........................................Project D from CBU III...................CostCenter X...............200
    ...........................................CBU I..........................................CostCenter Total..........70
    ...........................................CBU II.........................................CostCenter Total..........10
    ...........................................CBU III........................................CostCenter Total..........300
    Problem is:
    I would like to define for
    Row 2 Prompt for CBUs
    and for
    Row 1 Descendants of Same as Row 2
    but then I get the error "5200 : Error executing query: +Server+/+Application+/+Database+/+User+/Error(1001005) Unknown Member [Same As Row  2] in Report
    any idea how to workaround with that ? (have same problem with *Children of Same as Row 2*
    I tried to combine *Same as Row 2* with *RelativeMember & Offset -1* definition in reporting is then: Relative to Same As Row 2 offset by -1
    - but no success - all I achieve is a true Same as - resulting in duplication of all data of Row 2 and nothing from row 1.
    Any other ideas, how to combine a same as function with functions like parent,children,descendants or relative member ? Did I do anything wrong in combining them or is the relativemember function not working in 9.3.1 ?
    Please note, that these detailled reports typicially run 10 to 20 minutes - so telling users to run 2 reports or including lot's of not needed data or first retrieving and then hiding again is not really helpful - I would also not ask, if this function was not used in dozens of reports.
    The user prompt function in financial reporting is the most used functionality in our reports- the users run approx. 100 reports a day - and fill between 3 and 10 user prompts (with a lot of default values & substitution variables) - this appeared the most efficient way for unexperienced users, who need different data every day.
    unfortunately, it does not allow the report designer to allow either 1 or many values
    it seems to struggle with our special request of "children of same as"
    and it has no "select all" / "unselect all" button - which would allow the user to select all/none of the Choices List, defined in the user prompt.
    Please do not recommend usage of Analyzer - this tool is far to slow, has no cancel button and the users simply go lost.
    Smartview is too risky for majority of our users, as they would use the refresh button only - and not zoom in & zoom out - and miss a lot of new combinations by using old smartview-excel-templates (from previous month/forecast)
    Any help on any of these items would be highly recommended.

    If I understand correctly you would only have one CBU on any given report.
    Instead of prompting for Row 2 and pulling the totals from the Outline. You could delete your current Row2 and have the report provide the totals based on the data results from ROW 1. Insert a row formula for Row 2 and sum the results for that paticular column.
    Formula:
    Sum([1])
    Edited by: ronnie on Apr 21, 2011 9:51 AM
    Edited by: ronnie on Apr 21, 2011 9:52 AM

  • Saving Changes - User Prompt issue

    Hi
    It would be helpful if you could suggest for the couple of things mentioned below:
    I refered the thread: Re: Save Changes Prompt Displays Twice to prompt user to save
    changes whenever they leaves the page.
    1)
    My application would prompt user to "Save the changes or Discard" whenever they make change in forms and leave the page/refreshing the page without saving the changes.
    In the application, i have Select list, where my Tabular report is based on the value of select list.
    Whenever i change the value in select list, and try to leave the page/ refresh it, i'm getting proper user prompt.
    but once I click Cancel in the prompt (i.e., to remain in the same page ) then the value which i recently changed in
    select list remains. My tabular report showing details of original select list value.
    I want to have my exisitng (original) value in the select list when i say cancel in User prompt msg.
    Eg: select list value: A
    Tabular report shows A details
    //Select list value cahnged to 'B' and user hit refresh button and cancel in the prompt to remain with 'A' detail.
    Select list value shows B
    Tabular Report shows A details.
    2)
    In my application, by default cursor points editable value (first row) of tabular report.
    Whenever i key in some values in the Tabular report and hit refresh button or back button to leave the page without saving the changes
    then page is not prompting the user to Save changes.
    This is happening because i didnt click anywhere in the form region. just i entered the value and refreshed it.
    It is obvious that the page would refresh since i didnt change anyvalues in the forms region.
    But my requirement would need to have user prompt for this case too.
    Any pointers on this would be really helpful.
    Thanks
    Vijay

    Hi
    It would be hard to understand the requirement with the above one :)
    So i come up with a sample application in OTN.
    Please refer : http://apex.oracle.com/pls/otn/f?p=53243:13
    Credentials:
    Workspace: vsanthanam
    user: vijay
    pswd: apex_demo
    In this one, we get a prompt when we change the Empid value in Select list.
    Once we cancel this action (by clicking CANCEL button in the alert), the value which we
    selected in the select list remains.
    But the requirement is : It should go back and show the previous value since we
    cancelled the action.Because of this there is a mismatch in displaying records.
    So How to put back the previous value in the select list if we Cancel the action.
    Any pointers on this would be of great help.
    Thanks
    Vijay

  • User Prompt in a Formula Column?

    Is there a way to have an user prompt in a formula column in HFM? For instance, Column E = Column B / User Prompt Entry.

    Hi Simran,
    Query properties Supression zero rows /columns would be working only when the entire row or column has zero value and not when one cell among then is zero.
    If you are not interested to see zero values in the formula, I think you should be able to use "zero value display".
    Naveen.A

  • Using Proxy User Authentication in Sql Developer

    Hi!
    Is it possible to use proxy user authentication in SQL Developer? I'm thinking that if I'm clever enough, I can craft a custom jdbc URL that will allow my users to proxy authenticate into my Oracle 10gR2 database while using SQL Developer.
    Unfortunately, I'm not feeling all that clever. ;)
    Can anybody help me out here? Is it even in the realm of possibility?
    Thanks!
    Kevin Ferlazzo
    DBA
    VA Department of Juvenile Justice

    I found the possibility that proxy authentication of both accounts can be enforced:
    SQL> alter user appuser grant connect through personaluser AUTHENTICATION REQUIRED;
    I guess that this is the motivation for implementing the 2-session proxy connection method in SQL Developer.
    Regards,
    Martin

  • How To Create User through Pl SQL Block

    Want to create user from pl sql block using dynamic SQl. Used dbms_sql package . But when I run the block it does not recognises the parameter v7 which is a constant in dbms_sql package. Message displayed is Can not access parameter from package being restricted procedure.
    Is there any method to create user through PL SQl block

    hi ranjit,
    hope this will work
    declare
    uname varchar2(30):=&uname;
    pword varchar2(30):=&pword;
    begin
    execute immediate ('grant connect, resource to '&#0124; &#0124;uname&#0124; &#0124;' identified by '&#0124; &#0124;pword);
    end;
    regards

  • Business Rule:Usage of @ISMBR with User Prompts/ Variables+Loop Function

    Hi,
    currently facing a business rule user prompt - if-selection issue - not sure, if it's simply a bug or other ways how to solve it:
    depending on runtimeprompt [RTP_VERSIONS], either the 1st or 2nd part of the rule should get executed using a loop command.
    The special thing is, that you can choose several versions simultaniously in runtimeprompt : as soon, as Data Input is part of the selection, the 1st part of the if-section should apply and the 2nd loop executed (and other way round)
    this works if I select 1 Member in the user prompt, but does not work, if I select several members.
    according to the manual, @ismbr function is "true", if already 1 member is matching !
    I experiemented in addition to @ismbr with @list and @range and also with additional == "Data Input"
    any idea, which other command should apply ? any experience, if using user-variables with several member selections in if-sections is a problem ?
    of course I could simply create separate businessrules or restrict runtimeprompt to 1 value/ version - but inconvenient.
    we are on system 9.3
    Businessrule:
    VAR breakvar1=1; /*Controls Deletion of Budgetdata on Version Data Input */
    VAR breakvar2=1; /*Controls Deletion of ALL Data on selected Versions */
    FIX( "BegBalance",
    [RTP_SCENARIO],
    *[RTP_VERSIONS]*,
    "Local",
    +..... other dimensions+ )
    "HSP_InputValue"
    IF( *@ISMBR("Data Input")* AND not @ISMBR(&Scenario_1_curr))
    breakvar1=1;
    breakvar2=0;
    ELSEIF( not @ISMBR(&Scenario_1_curr))
    breakvar1=0;
    breakvar2=1;
    ENDIF;
    ENDFIX;
    SET UPDATECALC OFF;
    SET MSG SUMMARY;
    Loop(1,breakvar1) /* delete all accounts = all data */
    FIX( [RTP_SCENARIO],
    [RTP_VERSIONS],
    @IDESCENDANTS([RTP_PROJECT])
    CLEARBLOCK ALL;
    ENDFIX;
    ENDLOOP
    Loop(1,breakvar2) /* delete only budget accounts, not setupdata */
    FIX( [RTP_SCENARIO],
    [RTP_VERSIONS],
    @IDESCENDANTS([RTP_PROJECT]),
    *@IDESCENDANTS("Costs")*
    CLEARBLOCK ALL;
    ENDFIX;
    ENDLOOP
    Edited by: Rodian Abel on May 4, 2010 10:38 PM
    Edited by: Rodian Abel on May 4, 2010 10:43 PM

    I think he is saying he does want to allow the user to select more than one member.
    You mention you are using @ismbr and @list. I would say that should be the one that would work.
    For example if you wanted Version1 and Version2 and you hardcoded it. It would look like this
    If (@ismbr(@list(Version1,Version2))
    So using your Variable I expect you wrote it like this
    if (@ismbr(@list(variable)) and that it didn't work.
    @range is useful as it is cross dimensional and that isn't the case here. So if @list doesn't work than this is a bug/problem for your specific situation and will have to approach it differently.

Maybe you are looking for

  • My html table is not showing on the 2nd tab panel (muse widget)

    The same table works just fine on the first tab however when I try to click on the second table in browser mode or preview page on browser, my table does not show up. Any tips for fixing this issue?

  • Text and Image component Image placing not working!

    Hi Guys, For some odd reason, when I drop text and image component to the page I do not see the left or right option to place image in "Styles" tab.  The styles tab shows blank and by default paragraph gets placed after image.  This only happens in m

  • "Splitting A Domain"

    I have a question about e-mail that I am hoping someone might be able to help with or point me in the right direction. I have a client with a domain name of example.com. The ISP concerned currently provides an SMTP feed for all the mail addressed to

  • PLS-00307: too many declarations of 'FN_Myfunc' match this call

    Dear all,      we have following two overloaded  functions, we are facing issue while calling with exact case. function FN_Myfunc( p_name IN OUT Varchar2,             P_DTLS IN OUT VARHCAR2) RETURN BOOLEAN; function FN_Myfunc( p_name IN OUT CLOB,    

  • Power PC G5 -,"The volume%@needs to be repaired."1)

    Hi folks, turned on our G5 this morning to be met with our usual screen saver, but no Dock, no hard drive on the desktop, no apple logo no finder in the top left corner and everything to the right of that apart from spotlight showing. Restarted the c