Execution of SQL queries based on user input in the text box on the page of the APEX

Hello

I am new to develop in the APEX, and I encountered a problem...

It is even possible to do such a thing: use the text box to enter a SQL query and then run it on my schema and display the results in the report item? And if the answer is Yes, can someone give me advice on how to do this?

Thanks in advance.

In my example, the text is from a file in a text box. The report source is a function returning the SQL query:

DECLARE
   v_query   VARCHAR2 (4000);
BEGIN
v_query := :p91_sql_query;
      RETURN v_query;
END;

Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Apress.com/9781430235125
https://Apex.Oracle.com/pls/Apex/f?p=31517:1
http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
-------------------------------------------------------------------

Tags: Database

Similar Questions

  • Can I restrict user input in the fields of characters?

    Hello world
    I'm new to forms (using version 6), and I try to limit user input in a CHAR field, of a set of characters, say 'A', the of ' and 'X '. With numeric fields, I can use the Value property of permit/more.

    Is there a way to limit the user input in the fields of characters?

    Thanks in advance
    Oscar

    Is there a way to limit the user input in the fields of characters?

    Yes, but you will have to code your limitation of the when-validate-Item trigger (VMI). As you have discovered, there is no property that allows you to establish the equivielent of a "check constraint" on your article.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • User access to the Apex

    Dear all,

    What is the 'user access' in the Apex. When I type:

    Select the username of all_users;

    I do not see users that I created at the Apex (I use Oracle XE). What I need is:

    I have a table by its name of 'Agents' and I need to let each officer sees its files only without displaying the records of others.

    Maybe have a look at this picture you would understand my request.

    [Click here to see the image | http://www.9m.com/upfiles/XLr36804.jpg]

    Thanks in advance.

    I need to let each officer sees its files only without displaying the records of others

    In the agents table how do you store the user details (of the apex user who packed / "holds" the record)? In other words how can a record to identify the user, can you have a column where you insert these data, do you establish this apex or use a trigger?

  • If you do not have such a column add a first

    ALTER table add Agents (record_owner VARCHAR2 (100))

  • When you insert records into this table, set this column with v ('APP_USER') as a trigger or directly from the PLSQL process.

  • Then change the report query to filter the records owned by this user

    Select * agents where record_owner =: APP_USER.

  • You can mark the fields to show or hide based on user input?

    I have a 25 part form my users quite frequently - currently, it is stored in 25 documents Word and end users choose parts whatever they need and copy and paste into a form.  I am responsible for creating a form with all its 25 parts in there - not much, but the form should work so that the text they choose to is displayed and the rest is hidden. Is there a way to label conditional text field based on the selection of the end user?

    For example - there are checkboxes with a number followed by a text box with a sentence or 2 up to 5 or 6 short paragraphs. Users would select the required check boxes and have the text flow in a letter and the Coachman does not display areas of respective text that are disabled.

    Can I put each box and the following text in a subform and code somehow to display when the user wants?

    Thanks in advance for your help with this.

    R

    Sent the updated form a separately.

    Let me know if it helps.

    Thank you

    Srini

  • Select text in the text box based on user input?

    I need to select (highlight) text that is present in the users choice i.e SystemPrompt from TextArea is shown where the user enters the desired text and if this text is currently present in the text box, put it highlighted, otherwise display additional information. Something like the search feature in the standard Notepad application.

    I can't find what I'm looking for in a TextEditor.

    Text of the text box is available by using the text property.

    If you can access the text typed by the user and then the index can be easily calculated. Something like this (untested):

    QString textAreaText = textArea->text();
    QString userInput = ...;
    
    int startIndex = textAreaText.indexOf(userInput, 0, Qt::CaseInsensitive);
    int endIndex = startIndex + userInput.length();
    
  • How to find the sql queries executed in one day with the sql and runtime text

    Hi Experts,

    Please tell me the sql query to find out the queries executed on a particular day and the runtime and the sql text of the query.

    Please reply urgent.

    Thanks in advance

    Database instance 'A' may have run 100 SQL queries today.  As for the instance of database 'B' could have exploited queries SQL 1 million today.  Instance of database 'B' to 'keep' the 1 million SQL statements - in memory or on disk do you expect?  Of course not.  There the age or flush or invalidate memory SQL statements.  He can't keep them on the disk (imagine running a completely different set of 1.2million SQL statements tomorrow and 1.3 the next day).

    AWR and StatsPack can make counts the number of "n" top of the page ("n" default to 30) SQL statements which are still present in the cache of the library (not years, rinsed, invalidated) when a snapshot was taken.  They can't declare "all" SQL statements.

    To return to your needs.  WHY do you need all the SQL statements?  Or are there only certain operations specific SQL would you be interested?  Could they have been treated by allowing audit (for example, UPDATE and DELETE with EXTENDED verification instructions)?

    Hemant K Collette

  • How to convert user input on the page in capital letters?

    For the experienced:

    I use JDeveloper 10.1.3.4 to develop my application.

    The application has an Oracle database table named USERS. A column named USER_ID, must be uppercase when recording in the table.

    I dragged the create action of the corresponding VO named users to a page to create a commandButton control. When you click this button, the user is navigated to a page "Create an account" to fill in all the fields and save the entry in the USERS table.

    On the page "Create a new account", users of VO is slid to the page as a form of the ADF. The action of validation is dragged to the page as the "Save" button. User input is stored in the USERS table as a new row when the user clicks on the button "Save". But what the user types in the user name field can contain lower-case characters. This entry should be converted to uppercase before saved in the USERS table. I tried to convert the setter in the VO or EO, such as:
        public void setUserid(String value) {
            value.toUpperCase();   //I added this line.
            setAttributeInternal(USERID, value);
        }
    But this has no effect. Then I tried to make a change similar to the Get accessor method, such as:
        public String getUserid() {
            //return (String)getAttributeInternal(USERID);  // this is original code.
            //What I added:
           String uppperUserid = (String)getAttributeInternal(USERID);
            return upperUserid.toUpperCase();
        }
    But I get an error: {color: red} Houston-27019: getting the method for the attribute 'Userid' in users could not be resolved. {color}

    Can anyone help? Thank you very much!

    Newman

    check this one

    ADF faces: how to 'auto UpperCase' on InputText?

    Info. All custom converter...

    Re: all lowercase?

  • for relaxation: where is the table created by the Wizzard users create in the APEX?

    Hello everyone and Tony in particular since it was followed and mentoring my progress on this.

    Well,.

    Here we have 2 things:



    (1) when the wizzard of Administration > database > manage users creates a user. Where is the table it creates? What name does have? Why is it not visible in the object browser? I need the name of this table to put it on my trigger (I called users_table)



    (2) how to do that whenever a user connects, his formerly generated by the trigger sequence is used by a State to extract personal data (it's sort of VPD) in this case would be, how do you know what surrogate key, we need to call. To do this, I think, the thing would be to request the: = APP_USER (that was created in step 1) and each APP_USER will surrogate that are associated with this key.



    I set up a simple trigger, but just the substring of the concatenation of the given username, the system randomly generated pwd up to 12 characters.



    CREATE OR REPLACE
    GENERATE_SEQUENCE RELAXATION
    AFTER INSERT ON USERS_TABLE
    FOR EACH LINE
    BEGIN
    insert into users_table (surrogate_key)
    values (SUBSTR (¦¦ username password), 1.12);
    END;


    but as I said, this users_table must be the table where the wizzard to create users stores its data,... .but where is this table?


    Thank you very much

    Alvaro

    Published by: Alvaroe on February 6, 2010 09:13

    Published by: Alvaroe on February 6, 2010 10:00

    Hello

    (1) create a table and then start filling in

    I think you need to have a custom table of your patients (and users), say,

    CREATE TABLE patients
      (
        "USER_ID"   NUMBER,
        "USER_NAME" VARCHAR2(100 BYTE),
        "FIRST_NAME" VARCHAR2(100 BYTE),
        "LAST_NAME" VARCHAR2(100 BYTE),
        "PASSWORD"  VARCHAR2(4000 BYTE),
        "CREATED_ON" DATE
        CONSTRAINT patients_PK PRIMARY KEY ("USER_ID")
      );
    

    you need to build customized in your appl authentication and do not use the Apex or Db authentication.
    To do this, you must do this table in the schema that is used in the analysis of your application's schema.
    And you need create the function custom_hash like this:

    create or replace
    function custom_hash (p_username in varchar2, p_password in varchar2)
    return varchar2
    is
      l_password varchar2(4000);
      l_salt varchar2(4000) := '55PSP4P78JLDQ2AMBXQ60DW9OW7G9Z';
    begin
    
    l_password := utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5
      (input_string => p_password || substr(l_salt,10,13) || p_username ||
        substr(l_salt, 4,10)));
    return l_password;
    end;
    

    (2) then build the trigger when it detects that I completed a line
    It generates this sequence AND inserts it into another table (as you say, I could not put it in the same table)

    users must register themselves?
    Or register?
    Then you must create the free registration form or a form where you fill in your table above users.

    I think that your user_name must be unique. Put a Unique about this strain.

    When creating the patient button is pressed, then the above table is filled (you must and name, user in the form fill password)
    You must calculate USER_ID, user_name, password and created_on, this can be done in the trigger

    create or replace
    TRIGGER patients_trg_bi
      before insert on patients
      for each row
    begin
    if :NEW.USER_ID is null then
        select patients_seq.nextval into :NEW.USER_ID from dual;
    end if;
    
    if :NEW.CREATED_ON is null then
        :NEW.CREATED_ON := SYSDATE;
    end if;
    
    if :NEW.USER_NAME  is null then
        :NEW.USER_NAME  := :NEW.LAST_NAME || :NEW.USER_ID;
    end if;
    
       :NEW.PASSWORD := custom_hash(:NEW.USER_NAME, :NEW.PASSWORD);
    
    end;   
    

    you create the sequence of patients_seq

    In this case the surrogate key be hashed password.
    And you can use it by selecting table using patients: APP_USER
    that is when the user is connected to his USER_NAME, variable APP_USER is filled

    (3) then, the SQL query would recover this surrogate_key and show as connected individual data.

    Yes, when the user logs on, the key is populated by users based on table: APP_USER
    using

    select password
    from patients
    where user_name = :APP_USER;
    

    You must understand how EVP can be implemented at the Apex.

    You can use any application for this SURROGATE_KEY say

    which is calculated by Application of calculation on the new Instance

    4) but in order to know what to ask, surrogate key should be a key with the substitution APP_USER connection

    is that correct?

    Yes. You have the info from the users table

    Do you have examples of Applications Apex somewhere.
    If you use Apex 2.1, you can install it from the repository and if you have 3 Apex, they are normally automatically installed if you create the new workspace.

    You can use it a lot to manage users.

    Concerning
    Oleg

    BTW,

    Alvaro,
    Yo have your appl?
    If you sent your Db and tables all the Pl/SQl, as well as application Apex, you have for me by email, I can check and make/suggest improvements
    (For free, of course)
    I need to check what you did there, otherwise it seems to be a very long subject.
    Well, I have the time to discuss

    Yes, you can make the trigger like this

    CREATE OR REPLACE
    GENERATE_SEQUENCE RELAXATION
    AFTER INSERT ON USERS_TABLE
    FOR EACH LINE
    BEGIN
    insert into GENERATED_SEQUENCES_TABLE (lastinserted_name, surrogate_key)
    values (SELECT name from USER OF USERS_TABLE WHERE USERID..., SUBSTR (lastinsertedname¦¦ password), 1.12);
    END;

    but where the values are made here
    SUBSTR (lastinsertedname¦¦ password), 1.12

    Published by: oleg.lihvoinen on February 6, 2010 14:55

  • Return specific text based on a percentage in another text box

    Hi all

    OK, got a head scratcher, and I'm sure it's easy for any experienced writer. Just not so easy for someone just to get into it.

    I have a form that count percentage in the text box. Based on the percentage of return in this box, that I would like to return a permission level in an adjacent area. The table below gives you an idea on what I'm after.

    PercentageApproval level
    0-30%TEXT1
    31 50%TEXT2
    51 60%TEXT3
    61 80%TEXT4
    81 100%TEXT5

    Any help would be appreciated.

    Thanks in advance!

    Okay, so that the custom field approval level calculation script you can use something like this:

    var perc = this.getField("Perc1").value; // let's say the percentage field is called "Perc1"
    if (perc>=0 && perc<=0.3) event.value = "TEXT1";
    else if (perc>0.3 && perc<=0.5) event.value = "TEXT2";
    else if (perc>0.5 && perc<=0.6) event.value = "TEXT3";
    else if (perc>0.6 && perc<=0.8) event.value = "TEXT4";
    else if (perc>0.8 && perc<=1) event.value = "TEXT5";
    else event.value = "";
    
  • AF:query of automatic execution under certain conditions the search form based on user input

    I read the post 160 in "not yet documented ADF application examples.
    I have a question. How can I create a view criteria according to ListOfValidDnames with a parameter that is the chosen filter Loc in ListOfValidLocs.
    Let me explain. The numbers the user or chooses 1700 in field Loc using ListOfValidLocs. I want to filter ListOfValidDnames with 1700.

    Thank you

    See this demo:
    http://blogs.Oracle.com/Shay/2011/01/dependent_lovs_in_an_afquery_c.html

  • How to filter through a set of data based on user input

    Hi all

    I'm trying to filter through a set of data, purchase only the files that meet the requirements of users.

    I ask the user to enter three different values, one for a frequency to start another for a frequency of end and also the value of the rated power.

    The way I am filtering from now thanks to this data set is using a function called the regular expression function as well as the analysis of string function to break up the name of file and data digital take-away, then compare these data on the entries of users.

    These values that meet the conditional statement will be sent to a ring of results for a user to go through.

    For now, I filled it is not as much functionality in this method, the user must be very careful in the way which he or she saves files and my program may work correctly.

    I am ataching a photo of this part of the program.

    Thanks for the help.

    I think that my second statement should check on a white paper OR PDM.  Have you noticed the color?  This is a clickable link.  If you read the material here, it should clear up confusion in the first part of my post.

    I have a colleague who, like you, encodes the parameters of the study of the (very long) string of the name of the file.  I always shout at him about it, because it requires him (because you are considering do) build routines for (a) analyzes the names (to retrieve the information hidden in them), (b) to organize the data in a form of "LabVIEW Database" and then (c) figure out how (in LabVIEW) for write "queries" on this database.  More file names are not particularly easy for a human to read, are extremely long and invite more mischief (have you thought about putting your files in folders which are similarly 'file-information-coded'?  Becomes even more messy more fast).

    You might think Oh, "it's too late to make a change, I have already all of these data", but what good is it if you can't analyze easily, group them, sort, etc. ?

    Bob Schor

  • How can I delay the t0 to a waveform based on user input without affecting the beginning of another form of wave in the while loop?

    I would like the Waveform generated with the signal generator to wait until the user presses a button to start. I tried this implementation with a structure of the case, but have failed. The problem is that I don't know what to make out of case for when the user has not yet pressed the button.

    Consider using the structure of the event instead of the structure of the case. So pass the generator of waveform in the structure of the event, so that it will be executed when an event like the mouse click occurs. http://zone.NI.com/reference/en-XX/help/371361J-01/Glang/event_structure/

  • Dynamically choose vSphere objects based on user input

    I have currently a workflow wrapper that will automate the deployment of a vCD vOrg, OrgVDC, Org Admin, and even go up to create a Port dvSwitch group in a go. The idea is to standardize our deployments and set default values. Currently, various outfits of the attributes (vCloud:VmwNetworkPool, VC:VmwareDistributedVirtualSwitch, etc.) are hard coded to match vCloud/vSphere Manager instance registered with vCO. I take this workflow with other data centres, or try to get the work of several nodes plugin vCO and invite the user to a place (DSB, STL, etc) and have these hard-coded values to change to match the appropriate data center.

    I suppose that this would be via a Scriptable job (probably with a switch/case statement) - but I'm pretty lost on how to set the attributes for the real objects of vSphere/vCD. Any ideas?

    All of these values hard-coded (attributes) should have their values set in the Configuration... in this way items, the only change required site to site's values in the elements of your config, not across all workflows. That's what are configuration items for

    See this article for more details: revisited Configuration items. VMware vCenter Orchestrator Blog - VMware Blogs

  • Hide the Table Sections based on user input

    I connected my form below. I'm trying to script the "Hide" button closed I want to hide all instances of the table "ActionItemGrp" sections when the user has entered a date in the field "ClosedDate". I tried the following script, but may not have to work.

    Form1.ButtonsPage.HideClosed::click - (JavaScript, client)
    for (var a=0;a<Table1.ActionItemGrp.instanceManager.count;a++){
    for (var b=0;b<Table1.ActionItemGrp.all.item(a).Table1.ActionItemGrp.Row5.instanceManager.count;b++) {
      if (Table1.ActionItemGrp.all.item(a).Table1.ActionItemGrp.Row5.all.item(b).ClosedDate.rawValue!==null)
       Table1.ActionItemGrp.all.item(a).presence = "hidden";
    }
    

    Link to my file on WeTransfer: http://we.tl/bmZjwdb52u

    The help is apprecaited...

    Ah ok.

    It is difficult, but this script should do.

    for (var t = 0; t < _Table1.count; t += 1) {
              for (var a = 0; a < xfa.resolveNode("Table1[" + t + "]")._ActionItemGrp.count; a += 1) {
                        var aTarget = xfa.resolveNode("Table1[" + t + "].ActionItemGrp[" + a + "]");
                        if (!aTarget.Row5.ClosedDate.isNull) {
                                  aTarget.Row3.presence = "hidden";
                                  aTarget.Row4.presence = "hidden";
                                  aTarget.Row5.presence = "hidden";
                                  aTarget.Row6.presence = "hidden";
                        }
              }
    }
    
  • How to display records based on user input

    Hi all

    On the front side, there are two date fields, for example, beginning and end. Whenever the user enters the start date and end date, I want to display the dates from the start date of
    date of the end all what the user has entered.

    For example, the user enters start date: 15/01/2012 and end date: 19/01/2012
    I want to display like this * 15/01/2012 01/16/2012 01 2012 17 01/18/2012 01/19/2012 *.


    Thanks in advance.

    Thank you
    PAL

    Select sysdate + rownum-1
    Double log in 1 = 1 and rownum<= ((sysdate+7)-="">

    put to sysdate startdate and enddate sysdate + 7 as & startdate and enddate &

Maybe you are looking for