Select Query and Recordset on same page

I have been workig with Coldfusion for a while now.  Where I work there is a need for web pages to extract data from data sources.  I have been successful at doing this.  Typically I use a form that selects multiple criteria, which when submitted loads a target/action page that displays records that are filtered based on the SQL statement contained on that action page.  What I do is to conditionally check if criteria is passed using cfif.  And if a field parameter is indeed passed it becomes part of the cfquery.  This works out well - especially for reporting.
But now I am seeing more and more a need to accomplish the same process - but on a single cfm page.  So the page I seek will have both the form (select) and the recordset results on the same page. 
In this exercise I will be caching results od a query and having several queries to further refine what I seek (QOQ).  What I am seeking is the best practice to follow, I was thinking that using an iframe on the page would be and adequate solution whereby the query would pass the criteria and its form action would pass the variable(s) to the action page, which would be the source of the iframe.  But I am not certain that this is a best proctice.  Nor have I had great success at getting the pages to work in concert. 
Any advice that you can lend would be appreciated. 

I ideally start by reducing the 2-page functionality - of form page and action page - to just one. It goes like this:
<cfset isValidationPassed = false>
<cfif isDefined("form.someVar")>
<!--- Do validation. Validated form implies isValidationPassed is true --->
</cfif>
<cfif isValidationPassed>
<!--- Do action page stuff --->
<cfelseif NOT isDefined("form.someVar") OR NOT isValidationPassed>
<!--- Display the form. --->
<!--- If form had been submitted, inform user which validation failed, and what to correct. Display the form. --->
<cfoutput><form method="post" action="#CGI.SCRIPT_NAME#"></cfoutput>
</form>
</cfif>
The idea is then to pile on the complexity, layer by layer.

Similar Messages

  • Please give this awsome app more  by providing  features:: 1. thumbnails for pages ,2.  ability to annotaions( highlighter and underliner) to remain enabled once selected ( because many times it  becomes hectic to select again and again the same annotaion

    please give this awsome app more  by providing  features::
    1. thumbnails for pages ,
    2.  ability to annotaions( highlighter and underliner) to remain enabled once selected ( because many times it  becomes hectic to select again and again the same annotaion when selecting multiple words in a single page).
    thanks .. hope this will be soon adapted with

    please give this awsome app more  by providing  features::
    1. thumbnails for pages ,
    2.  ability to annotaions( highlighter and underliner) to remain enabled once selected ( because many times it  becomes hectic to select again and again the same annotaion when selecting multiple words in a single page).
    thanks .. hope this will be soon adapted with

  • How to print Header and footer in same page

    Hi All,
    I am using Oracle Report 10g. How can I add header and footer on same page as my body? Right now when a generate a pdf file, it is printing individual pages instead of 1 one page. Please help me.
    Regards

    HI
    First of all,
    Unless otherwise you selected some option like page break after/before - both body and header/footer will print on same page in report, so in pdf as well.
    If you have difference on report and PDF that you should look into your setup.
    If you want more help, please be particular on your issue
    james. wrote:
    Hi All,
    I am using Oracle Report 10g. How can I add header and footer on same page as my body? Right now when a generate a pdf file, it is printing individual pages instead of 1 one page. Please help me.
    Regards

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Use a Jump Menu to Make Selection and stay on same page.

    I have a form that you select a ID from a drop down list
    click submit, and then are redirected back to the same page with
    the results of a query based on the selection from the drop down
    list. I want to change this so the user doesn't have to click
    submit... I want my drop down list to act as a jump menu. How do I
    get my dropdown list to act like a jump menu, which essentially
    submits the form, and posts the results below?

    2 ways, both use javascript (you can't do it with just cf):
    1) add an onChange attribute to your select with
    'this.form.submit()' as
    value. this will submit the form, refresh the page and show
    your results
    - just as if user clicked your 'submit' button. be careful,
    though, if
    you are checking for existence of the submit button in your
    action page
    - it won;t be there since it has not been clicked.
    2) you can also employ some ajax features to submit your form
    asynchronously, 'behind the scenes', and show results without
    refreshing
    the page. CF8 has built-in ajax js functions and tags to do
    it,
    otherwise look into ajaxcfc by rob gonda or jQuery or other
    js framework
    that has these features.
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Navigate from tree selection to parameterized report on same page

    I have a simple tree showing the departments and roles within our organization.
    I have a simple report showing the skills required for each node in the tree, sometimes general skills that apply to whole department, sometimes specialized skills for the roles within a department.
    I've created a page that has two regions. I managed to get the tree on the left and report on the right by including the two regions in the same display point and changing the column of the report to "2".
    When I click a node in the tree, I want the ID behind the selection to be passed to the simple report. The report will show the skills mapped to the selected node in the tree.
    But since the report is on the same page, I imagine this might be a bit tricky. When the user clicks a node, the whole page would have to be refreshed, preserving the tree expanded to the point where the user clicked, and running the report with the now filled ID.
    In order to do this, I guessed I'd need an application item that preserved state. I created item F1000_OU_ID.
    The SQL for the tree is :
    select "OU_ID" id,
    "PARENT_OU_ID" pid,
    "OU_NM" name,
    'f?p=&APP_ID.:1:&SESSION.::NO::F1000_OU_ID:'||"OU_ID" link,
    null a1,
    null a2
    from "#OWNER#"."TR_OU"
    order by seq_num
    The SQL for the report is:
    SELECT s.skill_type,
    s.skill_nm
    FROM tr_skill s,
    tr_ou_skill os
    WHERE s.skill_id = os.skill_id
    AND os.ou_id = :F1000_OU_ID
    Under the report region, I gave it a conditional display directive to not display until F1000_OU_ID was not null.
    That's as far as I've gotten. The page runs. The regions display where I want them. But when I click nodes in the tree, the page blinks and nothing happens to the report. What am I missing Aces?
    bc

    200 views and 1 reply? Come, come, Aces, you can do better than that!
    Leo, thanks for taking the time to look at it. As I understand it, the "bind" or "host variable" syntax of preceding colon, e.g. ":F1000_OU_ID" is used when referring to application or page items from a SQL Query. The "substitution" syntax of preceding ampersand and following period, e.g. "&F1000_OU_ID." is used when referring to application or page items from things like HTML text.
    To verify this, I used one of the blank pages in my app, page 5. I created two regions, one HTML text, one a report based on a SQL Query.
    For the HTML text, I typed in
    Here is the application item value &F1000_OU_ID..
    For the report's SQL query, I typed in
    SELECT 'OU_ID selected is ['||:F1000_OU_ID||']' text
    FROM dual
    These both work as expected. After I have clicked on a node in Page 1's tree, the F1000_OU_ID is set to a value and that value then appears on page 5 in the two test regions mentioned above.
    So I have no trouble passing stateful values between different pages. My problem, perhaps poorly worded in the original post, is how to "pass" the selected value to the same page, since clicking a link in the tree refreshes the page it is on, in order to pass the value to the report region on the same page.
    If anyone has done this before, please chip in or point me to the thread. Various searches in the forum were just coming up with too many non-relevant results, so I thought I'd ask the experts. Thanks in advance!
    bc

  • Drop Down Menu selection query for recordset.

    I am looking to utilize a dynamic drop down menu to query a recordset...I am using Colfusion to import an MS Access database that contains the following fields: "Model Date", "Name", "Points" and "Target".  Each time the database updates, the "Model Date" field contains the date and time the model was run.  I have figured out how to create a dynamic drop down using SELECT DISTINCT "model date" and have also figured out how to create the dynamic recordset to be displayed showing the "Name", "Points" and "Target" data. 
    I want the user to select the "Model Date" from the drop down, hit a submit button and then have the appropriate "Name", "Points" and "Target" data queried and shown below.
    The query should take the selection from the "model date" dropdown and then query the "name", "points" and "target" fields for that particular "model date"
    I admit my knowledge of SQL and Coldfusion is not the best, but it seems like this is a somewhat simple task and I am just missing one or two pieces of the cog to put it all together.
    The database basically looks like this:
    Model Date...........Name..........Points........Target
    8/1/2010 08:00......John Doe.....1,250.........5.55%
    8/1/2010 08:00......Jane Doe.....850............2.35%
    8/1/2010 08:00......Bill Smith....11,832........-123.23%
    8/2/2010 09:02......John Doe.....1,323.........6.67%
    8/2/2010 09:02......Jane Doe.....1,001.........3.21%
    8/2/2010 09:02......Bill Smith....10,235........-110.26%
    The dropdown will only show the "model dates"
    8/1/2010 08:00
    8/2/2010 09:02
    For example, if 8/1/2010 08:00 was selected from the dropdown, I want the following displayed:
    Name..................Points...................Target
    John Doe.............1,250....................5.55%
    Jane Doe.............850.......................2.35%
    Bill Smith............11,832...................-123.23%
    Any help or suggestions would be greatly appreciated!!!
    Thanks,
    Mike

    My second paragraph talks about just displaying the filtered data, so I'm assuming that's what you're looking for, but still not quite sure based on what the other responses are. 
    But I head on anyway -
    On your first page, make note of the instance name of your drop down menu, such as "ModelDate".  Make sure it's in a Form and set the form action to the page where you want to display your data, set the form action to POST.
    On the results page, create a table with cells for each of the data elements you want to display. Create a recordset which you can do in Simple mode. Leave it at select all, and set the filter drop down to the database field which contains your Model Date. In the box to the right, select "=". the next dropdown selct "Form Variable" and the variable name type in the instance name of the drop down on the first page. 
    I may not have the terminology right, doing it from memory.
    From the data bindings tab, expand your recordset and locate each of the database fields you want to display.  Drag each one to the table cell on the page where you want it displayed.  The table cells have to be in a linear row.
    Now, select the table row buy selecting the TR tag in the tags just above the properties panel.  In the server behaviors tab, select repeat region and "All Records"
    Publish your pages and test!

  • Performance issue with select query and for all entries.

    hi,
    i have a report to be performance tuned.
    the database table has around 20 million entries and 25 fields.
    so, the report fetches the distinct values of two fields using one select query.
    so, the first select query fetches around 150 entries from the table for 2 fields.
    then it applies some logic and eliminates some entries and makes entries around 80-90...
    and then it again applies the select query on the same table using for all entries applied on the internal table with 80-90 entries...
    in short,
    it accesses the same database table twice.
    so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    is around 80-90 entries too much for using "for all entries"?
    the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    i really cant find the way out...
    please help.

    chinmay kulkarni wrote:Chinmay,
    Even though you tried to ask the question with detailed explanation, unfortunately it is still not clear.
    It is perfectly fine to access the same database twice. If that is working for you, I don't think there is any need to change the logic. As Rob mentioned, 80 or 8000 records is not a problem in "for all entries" clause.
    >
    > so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    >
    It is not clear what you tried to do here. Did you try to bring all 20 million records into an internal table? That will certainly cause the program to short dump with memory shortage.
    > the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    >
    That is fine. Actually, it is better (performance wise) to do much of the work in ABAP than writing a complex WHERE clause that might bog down the database.

  • Using VO as form and table on same page

    Hi,
    We are facing some issues while using same view object on one page. The view object is dropped as input form and as table on same page. There are few fields in the input form that have autosubmit property set to true. Now while entering the data into form, after clicking any autosubmit field, if we refresh the page, then new row gets created in table with value of the auto submit field. This is in cache only and not created in DB. We tried by exposing two instances of same view object in application module but still same issue. Finally we created two view object, one which is EO based and another ready only through query. Its working fine now. But is there any other possible solution, without creating two view objects?
    Jdev: 11.1.1.6.
    Thanks

    Hey Ami,
    I've tried understanding your problem but i'm not sure if i could.
    The problem is that you can insert via the form but it doesn't update the table ?
    Is that it ?
    Regards,
    Frederico.

  • Use Select Value in JSp on same Page

    Sir,
    In my Jsp page there is one dropdown,sir i want to get that select value in same page so that i can display data on same page below the dropdown based on the <select> value.
    Is it possible to do this things.
    Plz reply Soon.
    Thanks,
    Regards,
    Ashish

    I ideally start by reducing the 2-page functionality - of form page and action page - to just one. It goes like this:
    <cfset isValidationPassed = false>
    <cfif isDefined("form.someVar")>
    <!--- Do validation. Validated form implies isValidationPassed is true --->
    </cfif>
    <cfif isValidationPassed>
    <!--- Do action page stuff --->
    <cfelseif NOT isDefined("form.someVar") OR NOT isValidationPassed>
    <!--- Display the form. --->
    <!--- If form had been submitted, inform user which validation failed, and what to correct. Display the form. --->
    <cfoutput><form method="post" action="#CGI.SCRIPT_NAME#"></cfoutput>
    </form>
    </cfif>
    The idea is then to pile on the complexity, layer by layer.

  • WHERE rowID NOT IN (another recordset on same page?)

    Hi.
    I have a recordset that lists movie reviews.  On the same page, I have a menu that lists movies, for review.
    I want to hide movies, in that list, if they already exist in the users recordset of reviews.
    In other words, if the user has already submitted a movie review, I don't want them to be able to submit another review for the same movie.
    As I understand it, I can use the NOT IN function in my SELECT statement for my movie recordset, but I'm not sure how to call the movieID from the review recordset, in this statement.
    I'm aiming for something like this:
    rsUserReviews
    reviewID
    movieID
    rsMovies
    movieID
    In the movie recordset I need to do something like this:
    SELECT movieID, moviename FROM dbo.movies WHERE movieID NOT IN (SELECT movieID FROM rsUserReviews)
    Is this possible?
    Appreciate any advice.  Thanks.
    Nath.

    Hi David.  Sincere apologies.  That is a bad habit of mine.
    I'm using Classic ASP / VBScript.
    So you're suggesting:
    SELECT movieID FROM dbo.movies WHERE movieID NOT IN (SELECT dbo.reviews.userID, dbo.reviews.movieID FROM dbo.reviews WHERE dbo.reviews.userID = ?)
    Do I just add another parameter, in the movie recordset, to accommodate the userID reference?
    When I try that, I get this:
    [SQL Server]Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
    Hope you can help.  Thank you.
    Regards
    Nath.

  • Dynamic From statement in select query and/or outer join not working

    Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
    Select (dynamic columns) INTO <wa>
    FROM a inner join b on af1 = bf1
    inner join c on af2 = cf2......
    WHERE (dynamic conditios)
    ORDER BY ( dynamic sort condition).
    Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
    I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
    Kindly give me pointers.
    Thanks

    Hey thanks for the reply, but the problem is not solved.
    I am already using  ( fileds, value) like table in my where condition and the select statement was working properly.
    the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
    But I am getting a runtime error as below:
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
         caught in
        procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        The running ABAP program wanted to execute a SELECT statement whose
        WHERE condition was (partly) specified dynamically. The part that is
        specified in an internal table at runtime is compared to a field of the
        right table of an LEFT OUTER JOIN. Such comparisons are not supported by
         all database systems and are therefore not allowed.

  • How to refresh and redirect into same page after deleting a file

    Hi John,
    One more help I need. I implemented the brows and download file functionality in my application successfully. And I am interested to implement delete also like download. If user will click on download three options will come open, save, cancel in case of download. But like download I want to put delete link which will delete the corresponding file.
    I written the procedure in same fashion as download and compiled in my schema.
    The code is here:
    CREATE OR REPLACE PROCEDURE download_my_file_temp_delete (p_file IN NUMBER)
    AS
    BEGIN
    DELETE FROM file_subjects_temp
    WHERE ID = p_file;
    END download_my_file_temp_delete;
    And in
    Home>Application Builder>Application ID>my_page > Report Attributes>Column Attributes
    There I am entering
    Link text : Delete
    Target : URL
    URL : #OWNER#.download_my_file_temp_delete?p_file=#Delete#
    Where download_my_file_temp_delete is a procedure for deleting the file corresponding to ID .
    Here id alias is DELETE so I am passing #DELETE#.
    If I am click delete corresponding to any file its opening a blank page I seen URL is like
    http://abcd.com:portno/pls/workspace/owner.download_my_file_temp_delete?p_file=4031625747435433
    if I am clicking back and refreshing then getting file is deleted successfully.
    That means procedure is working but I want that after clicking on delete link corresponding to any file same page should appear with refresh then my problem will solved.
    Can u suggest me any approach.
    Thanks && Regards,
    Ravi

    [This is not John, hope that's ok!]
    This kind of thing is best done by rendering checkboxes next to each file in your report region;using apex_item.checkbox(1,file_id) and providing a Delete button that would fire a after-submit process that does
    for i in 1..htmldb_application.g_f01.count
    loop
    download_my_file_temp_delete(htmldb_application.g_f01(i));
    end loop;[And of course a same-page branch on the page]

  • Select query and read dataset

    i have to read an excel sheet from the application server into an internal table that i hv created.can you help me to write  select query &read dataset statement?
    suppose the internal table name is T_a and it has fields f1 to f7 which are all present in the excel sheet.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Anand.
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:33 PM

    Hi
    select f1 f2 f3 f4 f5 f6 f7
    from TABLE
    into table T_a.
    read table T_a with key f1 = <val1>.
    <REMOVED BY MODERATOR>
    Regards,
    Mansi.
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:33 PM

  • Select Query and Join Between int and Numeric(22)

    I have two tables
    tablea
    Field1 int
    tableb
    Field1 Numeric(22)
    I know this design is wrong but this is what I have ?
    tablea contains about 12M records
    Field1 in tablea is one to one related to Field1 in tableb
    Now I have Select Query
    Select tablea.* from tablea,tableb where tablea.field1=tableb.field1 and tableb.field2 > somrthing
    Query here is
    Does Join Between
    int type

    Yes, avinash said rightly.
    there is another way bit diffict.
    use the indexes properly as available in the mseg table and mkpf table even then it is diffcult
    else try using BAPI.
    some bapi will give the entire details of the MATERAIL DOCUMENT
    go to BAPI explorer tcode BAPI.
    where you can find the BAPI name like the 'GET_LIST'.
    Try this.
    hope this will serve your purpose.
    Thanks and regards
    Ramchander Rao.K

Maybe you are looking for

  • How to use the Bluetooth module natively in Parallels Desktop

    link to the instructions on how to enable bluetooth natively in parallels: http://www.mattiouz.com/blog/2007/04/13/how-to-use-the-built-in-mac-bluetooth-in -windows-under-parallels/ link to the .exe that installs the apple driver for the bluetooth mo

  • Can't drag text

    This must be the simplest process in iDVD. I am at the beginning, making the main menu. The Help guide says: 1.Choose Project > Add Text. The phrase "Click to edit" appears on the menu. 2.Double-click the text to select it, and type the new text. 3.D

  • Problem in creating cursor

    hi, i am using oracle forms & while creating following cursor it shows error CURSOR C_LEAVE IS SELECT LEAVE,FDATE,TODATE FROM LEAVETAB1 WHERE EMPNO=:DB_BLOCK1.EMPNO and YEAR=:DB_BLOCK1.LEAVEYEAR AND (SELECT FDATE FROM LEAVETAB2 WHERE '06-MAY-10' BETW

  • Upload Component, Pass extra Variable

    Hello all. I have been trying to get an upload component to work for some time now, but have been having a few troubles getting one to do what i need.  Recently i found a component that does pretty much everything i want bar one thing, pass an extra

  • Tree List height and width

    I am using a Tree List shared component. Is there a way for me to control the height and width of the Tree List on my page? Many thanks, Mark