MySQL:  SELECT * FROM with a Variable from an HTML form

Hello,
I would like to insert the variable "find" from the HTML form below in the MySQL "SELECT * FROM" query beneath it.  In other words, where the word "santafe" appears below, I would like to insert the variable "$find."  But I can't quite get it to work.  How do I do it?
Thanks in advance,
John
<form action="tsearch11.php" method="post">
<label>Enter Topic:
<input type="text" name="find" size="55"/>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</label>
</form>
Then, on tsearch11.php:
<?
mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
mysql_select_db("sand2") or die(mysql_error());
$find = strip_tags($find);
$find = trim ($find);
$t = "SELECT * FROM santafe"; 
$y = mysql_query($t);
?>

Putting a form variable in a SQL query to look for table or column names requires an extra level of security. You need to create an array of the valid names, and check that the form variable is in that array.
$find = get_magic_quotes_gpc() ? stripslashes($_POST['find']) : $_POST['find'];
$find = mysql_real_escape_string(trim($find));
// create an array of valid table names
$tables = array('santafe', 'sanfernando', 'guadalupe');
// check that the variable is in the permitted array
if (in_array($find, $tables)) {
  $t = "SELECT * FROM $find"; 
  $y = mysql_query($t);
} else {
  $error = 'Sorry, you selected an invalid table.';
In the page itself, check whether $y exists before using it. Otherwise display the error:
if (isset($y)) {
  // display the results
} elseif (isset($error)) {
  echo $error;

Similar Messages

  • Select list with bind variable does not work

    Hi,
    What can be wrong with a 'select list' with the a simple select
    select omschrijving o, id i
    from basiscodes b
    where domein = 'OPTIES'
    and b.id in
    (select eo.basiscode_id from evenementen_opties eo
    where eo.event_id = :P16_ID)
    The :P16_ID has a value and should give result
    But it does not work at all with 'select list'
    Using the POPUP LOV (display discription, return key value) works nice
    The select retuns less then 10 records

    Hi Flavio,
    As I explained, the P16_ID is an item of the master page (page 16)
    In Page 18 where I want to reuse that value, the item is not there, but I use it to assign
    P18_EVENT_ID with the value in P16_ID and that works fine.
    In an after submit process, I do this :
    declare
    function get_pk return varchar2
    is
    begin
    for c1 in (select EVENEMENT_INSCHRIJVING_SEQ.nextval next_val
    from dual)
    loop
    return c1.next_val;
    end loop;
    end;
    begin
    :P18_ID := get_pk;
    :P18_EVENT_ID := :P16_ID;
    :P18_CREATIE_DT := TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS');
    :P18_CREATIE_USER := APEX_APPLICATION.G_USER;
    end;
    The value P16_ID is there before I open page 18
    I made a display item that displays the value P16_ID
    If I change the LOV select in :
    select b.omschrijving o, b.id i
    from basiscodes b
    , evenementen_opties eo
    where b.domein = 'OPTIES'
    and b.id = eo.basiscode_id
    and eo.event_id = 16
    then it returns the value I want : 1 record
    You see, I'm a really new one in apex.
    Forms 6i was easier for me...
    Regards Jules
    null

  • Can we have the 'select list with submit' type within a tabular form?

    An item can be the "Select list with submit' type so a form has no problem with it. However, when I built a tabular form manually, I couldn't find this type. There are only three types avaiable: "named", "static", and "dynamic".
    Is it possible to have the "submit" type so columns of the tabular form can be dynamically rendered based on the user inputs?
    Another question I have is how to dynamically build the tabular form with decode func. For example, if the value of col_1 is 'val_1', then build a select list in col_2; otherwise null in col_2.
    I tried to use
    select col1,
    decode (col1, 'val_1', select htmldb_item.select_list_from_lov(2, first, 'lov1') from dual, null)
    from....
    where....
    But it didn't work.
    I'd like to know whether it's feasible to have something like that.
    TIA.
    Message was edited by:
    Luc

    You could use a region of type PL/SQL function
    returning SQL query to dynamically build this kind of
    tabular form. However if you want to use the built-in
    multi-row insert, update and delete processes, all
    items in a column must have the same display type. Marc, thanks for the quick reply. I appreciate it.
    I got your idea. However, I need to have the javascript 'ToggleAll' as the heading so the form works as same as the built-in one. If I put the query definition into a pl/sql procedure, where I can put this html tab attribute? It can not be inside the checkbox function, otherwise the checkbox of any row would act as same as the header.
    I hope I've made this clear.
    To Vikas: It's our clients who want this, not us. :(

  • Return to selected row with refresh after update in edit  form

    Hi,
    I created a database view.When selected a single row and click on button i can edit the row in a form for update.What i want, when doing some update and click on the commit button i return back on the initial row with a refresh to see the update done on this row.I succeeded to modify the form and commit.But when i return on the selected row my update is not visible.How can i return to the same selected row with a refresh.In oracle form i can do a go record with execute_query, but how to do this in ADF.Please someone can help so that i do not spend many days on it.
    Thanks
    Soodesh

    [click for the tutorial|http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CFQQFjAF&url=http%3A%2F%2Fandrejusb.blogspot.com%2F2013%2F03%2Fadf-rollback-and-keep-current-row.html&ei=Tnl3Ucn3BoXIrQeemICQAw&usg=AFQjCNHdYcJL8kJKymqbWBT9XDGTWmeUvQ&bvm=bv.45580626,d.bmk&cad=rja]
    here you go :)

  • Exit with bind variable from sqlplus and then echo $?

    Hello world.
    I don't know why they are different between :v_num and the value of "echo $?"
    thanks.
    SANOWT:oratest:/data3/oratest/oratest/hgjung> cat t.sql
    select count(*) from all_objects;
    variable v_num number;
    begin
    select count(*) into :v_num from all_objects ;
    exception
    when no_data_found then
    :v_num := 1403;
    end;
    exit *:v_num*
    SANOWT:oratest:/data3/oratest/oratest/hgjung> \sqlplus scott/***** @t
    SQL*Plus: Release 10.2.0.3.0 - Production on Wed Feb 17 10:11:59 2010
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    COUNT(*)
    *50497*
    PL/SQL procedure successfully completed.
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SANOWT:oratest:/data3/oratest/oratest/hgjung> echo $?
    *65*
    SANOWT:oratest:/data3/oratest/oratest/hgjung>

    The $? variable in UNIX is the exit code for the program. In most *NIX versions that I am aware of, it is limited to values between 0 and 255 (i.e. one byte), so the value is truncated.  The hex value of 50497 is C541, or two bytes, so the $? variable is only getting the last byte 0X41 which is decimal 65.
    John

  • Combo box with bind variable from popup

    Hi.
    I had two comboboxes on a form, one having a bind variable. It works great, with the first one as bind field.
    But i want to have the first LOV to be a POPUP. So, the second LOV (combo box) needs to be refreshed when a user has picked a value from the popup list. When i do that, the second LOV is not refresehed...
    Is there a way to do this?
    (3.0.9.8.3.A)

    Hi,
    This was a bug and is fixed in 30984.
    Thanks,
    Sharmila

  • To pass the selected data to a variable from the drop down list in abap wd

    Hi,
    I have already created a drop down list and populated it with data from table by using the node and linking it with the internal table. Now I need to know which element is selected so based on that I need to perform some function. eg. based on the selected data , i need to populate the next drop down list.
    A demo code will be really helpful.
    Thanks and Regards
    Tenzin

    Hi,
    On selcting the value from the drop down, we have one event ONSELECT.
    Write the code in this event.
    Get the attribute value to lV_xxxxxx using get attribute.
    then using that you can fill the next DDBK attribute.
    method wddoinit .
      data:
            lo_nd_spfli type ref to if_wd_context_node,
            lo_el_spfli type ref to if_wd_context_element,
            ls_spfli type wd_this->element_spfli.
      data:
          lv_carrid LIKE ls_sflight-carrid,
             itab_carrid type wd_this->elements_spfli,
             wa_carrid type wd_this->element_spfli,
             lo_nodeinfo_spfli type ref to if_wd_context_node_info,
             lt_value_set type wdy_key_value_table,
             ls_value_set type wdy_key_value.
      lo_nd_spfli = wd_context->get_child_node( name = wd_this->wdctx_spfli ).
      lo_nodeinfo_spfli = lo_nd_spfli->get_node_info( ).
      select carrid
        from spfli
        into corresponding fields of table itab_carrid.
      if sy-subrc = 0.
        sort itab_carrid by carrid.
        delete adjacent duplicates from itab_carrid comparing carrid.
      endif.
      loop at itab_carrid into wa_carrid.
        ls_value_set-key = wa_carrid-carrid.
        ls_value_set-value = wa_carrid-carrid.
        append ls_value_set to lt_value_set.
      endloop.
      lo_nodeinfo_spfli->set_attribute_value_set( name = 'CARRID'
      value_set = lt_value_set ).
    endmethod.
    in the event of first DDBK, write the select statement wsing where condition of lv_XXX.
    and append the record as above.
    Regards,
    sarath

  • List out on the one row with all variables from db

    from DB
    namn
    namnID namn
    166 -----------------------
    167 pierre lemon
    170 Lena Jakobsson
    171 adas
    172 Lena M Jakobsson
    175 Per Olofsson
    Inmata
    id namnID startdate slutdate vc fargkod
    50 167 2006-04-20 2006-04-27 Uddevalla Re
    54 167 2006-05-20 2006-07-20 Vänersborg A
    58 167 2006-08-21 2006-09-01 Uddevalla O
    61 170 2006-04-24 2006-05-03 ----- P
    <cfquery name="row_stsl" datasource="at">
    SELECT DISTINCT count(namnID) as sum_namnID
    FROM inmata
    group by namnID
    </cfquery>
    <cfset sum_namnIDa = row_stsl.sum_namnID>
    <cfoutput query="row_stsl">
    <table border="1">
    <tr><td>#sum_namnID#</td></tr>
    </cfoutput>
    <cfscript>
    for (i=1; i lt sum_namnIDa; i=i+1)
    writeoutput ( "<td>" & startdate & slutdate
    & "</td>");
    </cfscript>
    <cfoutput>
    </table>
    </cfoutput>
    My idea is to count number of nameID and build one row using
    <td> within startdate and slutdate </td>
    if there is 3 namnID so create three startdate and slutdate
    but don't know exact how to code.
    Any suggestion?
    I tried to get out startdate and slutdate in ordinal on the
    one row.
    Name:
    eg.
    Pierre Lemon 1. 2006-04-24 2006-06-02 2. 2006-06-03
    2006-07-25 3. etc startdate and slutdate on the row.

    <cfquery name="row_stsl" datasource="at">
    SELECT Count(inmata.namnID) AS sum_namnID,
    First(inmata.startdate) AS Förstaförstartdate,
    Last(inmata.slutdate) AS Sistaförslutdate
    FROM inmata
    WHERE ((inmata.startdate) AND (inmata.slutdate))
    GROUP BY inmata.namnID;
    </cfquery>
    <cfloop query="row_stsl">
    <table border="1">
    <tr>
    <cfscript>
    for (i=1; i lte sum_namnID; i=i+1)
    writeoutput ("<td>" & #dateformat
    (Förstaförstartdate,"yyyy-mm-dd")# & " "
    & #dateformat (Sistaförslutdate,"yyyy-mm-dd")# &
    "</td>");
    </cfscript>
    </tr>
    </table>
    </cfloop>
    Resultat:
    2006-04-20 2006-09-01 2006-04-20 2006-09-01 2006-04-20
    2006-09-01
    2006-04-24 2006-05-03
    In DB
    id namnID startdate slutdate
    50 167 2006-04-20 2006-04-27
    54 167 2006-05-20 2006-07-20
    58 167 2006-08-21 2006-09-01
    61 170 2006-04-24 2006-05-03
    yes, startdate and slutdate is date as datatype
    Is it SQL statement or cfscript I will change on?
    Have tried with other sql question but it will not take
    effect to get out answer.
    SELECT inmata.namnID, Count(inmata.namnID) AS Antal,
    inmata.startdate AS start_datum, inmata.slutdate AS slut_datum
    FROM inmata
    GROUP BY inmata.namnID, inmata.startdate, inmata.slutdate
    HAVING (((inmata.startdate) Is Not Null) AND
    ((inmata.slutdate) Is Not Null));
    Because the result is :
    2006-04-20 2006-05-03
    2006-04-20 2006-04-27
    2006-05-20 2006-07-20
    2006-08-21 2006-09-01
    2006-04-24 2006-05-03
    2006-04-20 2006-04-27
    2006-08-21 2007-05-03
    Any idea?!

  • Need help with getting variable from static

    Hello,
    What I am building is an application that prompts for username/password before it shows the main screen. Once they have successfully logged in, I need to assign the username that they used, in order to use it for a button event if the make any updates.
    Here is the code that I have tried to use.
    public String username;
    ///This set's the public variable username
    public void setUserName(String UserName){
    username = UserName;
    /////////////////Here is where they login, and assign the name to setUsername
    public static void main(String args[]) throws SQLException {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    JFrame frame = new JFrame();
    JTextField userName = new JTextField();
    JTextField passWord = new JTextField();
    Object[] options = {"OK","CANCEL"};
    Object[] msg = {"UserName:", userName, "Password:", passWord};
    final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
    JDialog dialog = op.createDialog(frame, "Please Login");
    dialog.show();
    int result = JOptionPane.OK_OPTION;
    try {
    result = ((Integer)op.getValue()).intValue();
    }catch(Exception uninitializedValue){}
    if(result == JOptionPane.OK_OPTION) {
    String userID = userName.getText();
    String passID = passWord.getText();
    Main myMain = new Main();
    myMain.setUserName(userID);
    if(!userID.equals("") && !passID.equals("")) {
    new Main().setVisible(true);
    }else {
    // user cancelled
    ////here is the button event that also will need the username
    private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {
    Connection conn = null;
    Statement stmt3 = null;
    Statement stmt4 = null;
    ResultSet rset3 = null;
    ResultSet rset4 = null;
    String usernum = null;
    String xemu = null;
    String loc = null;
    String ustat = null;
    String manager = null;
    String dept = null;
    String Add = "Add";
    String Update = "Update";
    String groupID = "9999";
    Vector columnNames = new Vector();
    Vector data = new Vector();
    String Manager_info[] = {"managerindex", "managers", "managername"};
    String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
    String Group_info[] = {"groupnum", "groups", "groupcode"};
    String System_info[] = {"systemindex", "systems", "systemname"};
    String Dept_info[] = {"departindex", "departments", "departname"};
    String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
    String Location_info[] = {"locindex", "location", "locdesc"};
    String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
    Date myDate = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
    String today = formatter.format(myDate);
    System.out.println(username);
    I am trying to set the public username variable to what the person enters, however since I am creating a seperate instance of it, I don't believe it will work. Any help would be very much appreciated.
    Thanks.
    Josh

    I am developing in Netbeans. If I try to remove the static keyword from main(), netbeans canno't find a main to run. I have created the User class.
    Here is the main again to show what I have done.
    public static void main(String args[]) throws SQLException {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    User user = new User();
    JFrame frame = new JFrame();
    JTextField userName = new JTextField();
    JTextField passWord = new JTextField();
    Object[] options = {"OK","CANCEL"};
    Object[] msg = {"UserName:", userName, "Password:", passWord};
    final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
    JDialog dialog = op.createDialog(frame, "Please Login");
    dialog.show();
    int result = JOptionPane.OK_OPTION;
    try {
    result = ((Integer)op.getValue()).intValue();
    }catch(Exception uninitializedValue){}
    if(result == JOptionPane.OK_OPTION) {
    String userID = userName.getText();
    String passID = passWord.getText();
    user.setName(userID);
    user.setPassword(passID);
    if(!userID.equals("") && !passID.equals("")) {
    //Auth.setUserName(userID);
    //Auth.setPassword(passID);
    new Main().setVisible(true);
    }else {
    // user cancelled
    This set's the variables
    Here is the beginning of the evt that I am using to try and get the data.
    private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
    Connection conn = null;
    Statement stmt3 = null;
    Statement stmt4 = null;
    ResultSet rset3 = null;
    ResultSet rset4 = null;
    String usernum = null;
    String xemu = null;
    String loc = null;
    String ustat = null;
    String manager = null;
    String dept = null;
    String Add = "Add";
    String Update = "Update";
    String groupID = "9999";
    Vector columnNames = new Vector();
    Vector data = new Vector();
    User user = new User();
    String User = user.getName();
    System.out.println(User);
    String Manager_info[] = {"managerindex", "managers", "managername"};
    String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
    String Group_info[] = {"groupnum", "groups", "groupcode"};
    String System_info[] = {"systemindex", "systems", "systemname"};
    String Dept_info[] = {"departindex", "departments", "departname"};
    String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
    String Location_info[] = {"locindex", "location", "locdesc"};
    String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
    Date myDate = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
    String today = formatter.format(myDate);
    String [] str = {
    "EmpID", "Account", "System", "Type", "Status", "UserID", "Group"
    This gives me a null on the println, how can I get the data that was entered in main()?
    Thanks,
    Josh

  • How do I generate URL with multiple variables from input fields?

    I'm creating an ad with four input text fields labels fname, lname, city and prov, and I wanted to know how to generate URLs based on information entered into the fields. The text fields default to display "First Name," "Last Name," "City" and "State," respectively, but if a user does not enter information in those fields, I want the URL to behave as if those were empty, if that makes sense. The text fields are in a movie clip called "input_text" and the button is labeled "send". If any of you can provide insight, I would be greatly appreciative. Thank you.

    1. use if-statements to see if the text properties of your textfields meets your requirements for creating that url.
    2. you can use the flash string methods and properties to create your url.
    p.s.  the plus sign + can be used to concatenate strings.

  • InfoPackage selection offset with OLAP variable

    Hi Bw Gurus,
    I have a requirement to load ODS with full upload everytime but in order to reduce repeated loads I am trying to use a DATE field which is not part of communication str. as a selection critera in InfoPacakge.
    I changed DS to include this field avaialable for selection and It's working fine when I input date to and from values hard coded in InfoPackage.
    Further I am trying to automate this InfoPackage scheduled weekly and I need to include date offset value for this DATE field to load for additional last 2 weeks every time to capture changes for already loaded data.
    I have created OLAP customer exit variable having Date interval for Date starting from last 3 weeks to Current DAte and included in InfoPackage selection for DATE field but it's not working. By the way if someone can explain what's meaning for two columns there for TYPE(Variable change to selection.....) and detail for type.
    Any clue for reason or any other way to accomplish this requirement?
    Thanks in advance,

    hi,
    can you explain me ,hw you solved the pbm,
    the same pbm i am facing.
    i am trying to load the data everyweek ( i have date field ),so i have selected OLAP Variable option -7 and there i have selected 0WEEK,but data is not comining from R/3,then i have selected the option -6 abap code,i have written code to get the date range,even though i am not able to retrive the data.
    can you suggest me
    Thanks
    Madhu

  • Best LKM to move data from with in Oracle from one schema to another Schema

    Hi Gurus,
    What is the best KM to move data from one schema to another schema within same oracle database.
    Thanks in advance

    Dear,
    If your source and target are on the same database server then you dont need LKM.
    You have to 1. create one data server for the database server
    2. Create one physical schema for your source and another physical schema for your target under the above created data server.
    3. Then create models for each above created physical schema
    In this case you just need IKM knowledge module
    Please refer http://oditrainings.blogspot.in/2012/08/odi-interface-source-target-on-same.html
    If your source and target are on different server then you must create two different data servers in topology. You have to use LKM.
    The best LKM to use is LKM oracle to Oracle dblink. But you should have proper grants to use it
    If your source has very few records you can go with LKM SQL to Oracle other wise use LKM oracle to Oracle dblink

  • Search help needed! select box with 2 variables? is it possible

    Using coldfusion 8 and MySQL.  I need to make a search form that has a drop select that displays the department and category together in the drop select.
    Is it possible? what would the form and search query look like. any help would be appreciated. thanks in advance.
    example: each is a line item for the drop select. then when one is selected it returns the results if records are found.
    mens/shoes
    mens/clothing
    mens/accessories
    womens/shoes
    womens/clothing

    Gee, what a coincidence, my current project has one of those.  My approach is to include a concatonated field in the query and use it for the desired attribute of cfselect.
    The details of the contcatonated field depend on the db.  I don't use mySql but if I wanted to know badly enough, I would google "mySql concatonate"

  • I have to select a file – get Info – and change – open with and change from preview to another program and CHANGE ALL everytime I boot up

    Why do I have to select a file – get Info – select – open with – and change from Preview to another program and click CHANGE ALL with every file extention everytime I boot up.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Report Performance with Bind Variable

    Getting some very odd behaviour with a report in APEX v 3.2.1.00.10
    I have a complex query that takes 5 seconds to return via TOAD, but takes from 5 to 10 minutes in an APEX report.
    I've narrowed it down to one particular bind. If I hard code the date in it returns in 6 seconds, but if I let the date be passed in from a parameter it takes 5+ minutes again.
    Relevant part of the query (an inline view) is:
    ,(select rglr_lect lect
    ,sum(tpm) mtr_tpm
    ,sum(enrols) mtr_enrols
    from ops_dash_meetings_report
    where meet_ev_date between to_date(:P35_END_DATE,'DD/MM/YYYY') - 363 and to_date(:P35_END_DATE,'DD/MM/YYYY')
    group by rglr_lect) RPV
    I've tried replacing the "to_date(:P35_END_DATE,'DD/MM/YYYY') - 363" with another item which is populated with the date required (and verified by checking session state). If I replace the :P35_END_DATE with an actual date the performance is fine again.
    The weird thing is that a trace file shows me exactly the same Explain Plan as the TOAD Explain where it runs in 5 seconds.
    Another odd thing is that another page in my application has the same inline view and doesn't hit the performance problem.
    The trace file did show some control characters (circumflex M) after each line of this report's query where these weren't anywhere else on the trace queries. I wondered if there was some sort of corruption in the source?
    No problems due to pagination as the result set is only 31 records and all being displayed.
    Really stumped here. Any advice or pointers would be most welcome.
    Jon.

    Don't worry about the Time column, the cost and cardinality are more important to see whther the CBO is making different decisions for whatever reason.
    Remember that the explain plan shows the expected execution plan and a trace shows the actual execution plan. So what you want to do is compare the query with bind variables from an APEX page trace to a trace from TOAD (or sqlplus or whatever). You can do this outside APEX like this...
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 1';Enter and run your SQL statement...;
    ALTER SESSION SET sql_trace=FALSE;This will create a a trace file in the directory returned by...
    SELECT value FROM v$parameter WHERE name = 'user_dump_dest' Which you can use tkprof to format.
    I am assuming that your not going over DB links or anything else slightly unusual?
    Cheers
    Ben

Maybe you are looking for

  • Table name for VAT ...

    Hi Friends What is table name for Reg No and VAT NO for Company Code What is table name for Customer Vat No ITs urgent Regards Bobbili

  • HD DVR QIP 7216-1, sound and picture issues.

    Just got fios yesterday, and i am very pleased with picture quality. although right from start, i had issues. First off, I run the HDMI cable right into my receiver Onkyo TX-SR606 and then from there into my TV. Well, i saw a green screen. No big dea

  • How to I get a transparent background in CS4 ?

    I have a Mac computer and am following Lynda.com's tutorials, but I haven't been able to find anything about how to clear the background of a photo so that I can give it another background.  Could anybody help me?

  • How to export a Flex3 project in AS3?

    Hi, I have read somewhere that I can export any flex project in AS3 to edit some default values of different components. Does anybody knows how to export it? Thanks She

  • Why can't I installed my createJS extension?

    helo guys and all Adobe administrator, I'd like to ask you a few question, such as : - How can't I installed the createJS extension for Adobe Flash CS 6? - Are there any specifications or newer version to install it? Well for your info, I'm using Ado