Temporary Tables in APEX

Hello All,
How can a user refresh a temporary table using APEX. I created 2 temp tables. How can I be sure that the temp tables have been updated when the user runs the report. Is there a button or procedure that I need to create to refresh the temp tables?

Hello,
I'd advise using temporary tables in APEX, since you cannot guarantee you will get the same database session within the mod_plsq session pool (or dbms_epg if you're using 11g or XE).
Instead you will probably want to use a collection, there are details about collections in the documentation available here -
http://download.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABFFJJJ
Hope this helps,
John.
http://jes.blogs.shellprompt.net

Similar Messages

  • Global temporary table in PL/SQL called from APEX page

    I have a global temporary table in a PL/SQL procedure that is called from an APEX page.
    The global temp table is populated with data as the procedure runs and then at the end of the procedure I do a create_collection_from_query_b to populate a collection with the data from the temp table. (I do this b/c it is much faster than creating the collection and doing an add_member for each row.)
    The problem is that there are no commits in my procedure but I cannot get the bulk insert to work unless I define the temp table as on commit preserve rows.
    Can anyone shed any light on this issue.
    Thanks,
    Andrew

    alamantia wrote:
    My PL/SQL procedure is called from an after submit page process. Does that imply that there is a commit happening after that process is successful?Ultimately, yes.
    If the process calls the PL/SQL procedure and the temp table is in the procedure, wouldn't the commit fire after all the PL/SQL code is complete which would be after the bulk insert from the temp table to my collection?Yes, but at any point in the procedure containing code like
    :APEX_ITEM := ...or
    select ... into :APEX_ITEM from ...or
    my_procedure(p_in => ..., p_out => :APEX_ITEM, ...);or
    apex_util.set_session_state(...);then APEX will commit whilst maintaining session state.
    If you don't have any of these events in the procedure, then test to see if the commit is occurring in <tt>apex_collection.create_collection_from_query_b</tt> prior to creation of the collection.

  • Problem with temporary table refresh

    Hi,
    I running a process before validation on a page to populate a temporary table when I click a button.
    On the following page I've built a shuttle on the temporary table. Not the most elegant solution, but the shuttle LOV box wouldn't process the oracle text commands in the SQL.
    I'm not getting any error, but I have an unusual problem
    It takes two passes for the data to be replaced. i.e I enter 'ABCD' in the filter and it returns data with 'ABCD'
    If I return to the page and change the filter to 'EFGH' I still get 'ABCD'. I return to the page and click the button again and I get 'EFGH' results
    I've checked the data in the temporay table and that is updating in line with the problem.
    I've looked at the debug and that seems fine (i.e I can see the changed filter value), I've tried moving the truncate to a different process, that didn't help.
    I've run it in SQL developer and it seems to work fine.
    I've included the code below, but I can't see a problem with it.
    Can anybody help?
    begin
    EXECUTE IMMEDIATE('TRUNCATE TABLE temp_cat');
    commit;
    if length(:P26_ADD_FILTER) > 0 then
    insert into temp_cat (core_cat_id, core_cat_code, core_cat_desc)
    select core_cat_id,core_cat_code,core_cat_desc from core_cat where CONTAINS (core_cat_desc, '
    <query>
    <textquery lang="ENGLISH" grammar="CONTEXT">&P26_ADD_FILTER.
    <progression>
    <seq><rewrite>transform((TOKENS, "{", "}", " "))</rewrite></seq>
    <seq><rewrite>transform((TOKENS, "{", "}", " ; "))</rewrite></seq>
    <seq><rewrite>transform((TOKENS, "{", "}", "AND"))</rewrite></seq>
    <seq><rewrite>transform((TOKENS, "{", "}", "ACCUM"))</rewrite></seq>
    </progression>
    </textquery>
    <score datatype="INTEGER" algorithm="COUNT"/>
    </query>')>0 and core_cat_id not in (select pipe_project_cat.core_cat_id from pipe_project_cat where txtpamref = :p26_pamref);
    else
    insert into temp_cat (core_cat_id, core_cat_code, core_cat_desc)
    select core_cat_id,core_cat_code,core_cat_desc from core_cat where
    core_cat_id not in (select pipe_project_cat.core_cat_id from pipe_project_cat where txtpamref = :p26_pamref);
    end if;
    end;

    Hi,
    Apex does not work well with temporary tables as you cannot guarantee which session from the pool will be used to serve each page.
    In your case, it looks like the second page is using temporary data from the wrong session.
    Have you considered using Apex Collections instead?
    Luis

  • Temporary table within a package

    I'm not sure this is the best way to achieve it, but I'm trying to use a temporary table within my package, but I failed!
    In my package, my procedure do receive 5 different phone numbers (vTel1 to vTel5) and I need to order them, using data from a table. Also, if 2 of them are the same, I need only the one with the highest rank.
    Let say my TelOrder table look likes:
    Reason
    Tel1
    Tel2
    Tel3
    Tel4
    Tel5
    Reason1
    2
    3
    1
    5
    4
    Reason2
    1
    2
    null
    3
    4
    And I receive those variable
    vTel1='5141111111'
    vTel2=null
    vTel3='5143333333'
    vTel4='5141111111'
    vTel5='5145555555'
    vReason='Reason1'
    Using the Reason1, I need to be able to get the result looking like:
    RowNum
    Phone
    Order
    1
    5143333333
    1
    2
    5141111111
    2
    3
    5145555555
    4
    And I need this code to be apart from the procedure, cause many procedures will use the same code, and I don't want to abuse the ctrl+c, ctrl+v at each update.
    I've come close by using something like:
    EXECUTE IMMEDIATE '
         INSERT INTO Table
         SELECT Rownum as RN, Ordre, contact_info, Contact_info_type
         FROM
           (SELECT a.contact_info, a.ordre, contact_info_type FROM
             (SELECT contact_info,min(ordre) as Ordre FROM
               (SELECT Tel1 as Ordre, ''' || vTel1 || ''' as contact_info, 1 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
               UNION ALL
               SELECT Tel2 as Ordre, ''' || vTel2 || ''' as contact_info, 2 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
               UNION ALL
               SELECT Tel3 as Ordre, ''' || vTel3 || ''' as contact_info, 4 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
               UNION ALL
               SELECT Tel4 as Ordre, ''' || vTel4 || ''' as contact_info, 4 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
               UNION ALL
               SELECT Tel5 as Ordre, ''' || vTel5 || ''' as contact_info, 1 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             WHERE Ordre is not null and contact_info is not null
             GROUP BY contact_info
             ) a
           JOIN
             (SELECT Tel1 as Ordre, ''' || vTel1 || ''' as contact_info, 1 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             UNION ALL
             SELECT Tel2 as Ordre, ''' || vTel2 || ''' as contact_info, 2 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             UNION ALL
             SELECT Tel3 as Ordre, ''' || vTel3 || ''' as contact_info, 4 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             UNION ALL
             SELECT Tel4 as Ordre, ''' || vTel4 || ''' as contact_info, 4 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             UNION ALL
             SELECT Tel5 as Ordre, ''' || vTel5 || ''' as contact_info, 1 as contact_info_type FROM TelOrder WHERE Reason=''' || vReason || '''
             ) b ON a.contact_info=b.contact_info AND a.ordre=b.ordre
           ORDER BY a.Ordre
    But when I try to remove this code and send it into another procedure/function, I can't make it work.
    PLEASE HELP!!!!  

    No Database to try it. Check at your own risk if this might work for you
    no version specified from your side, NOT TESTED from my side, so let's say we're even
    select row_number() over (order by the_order) "RowNum",
           the_val "Phone",
           the_order "Order"
      from (select v.the_val,t.the_order,
                   row_number() over (partition by v.the_val order by t.the_order) rn
              from (select reason,the_order,the_phone
                      from (select reason,tel1,tel2,tel3,tel4,tel5
                              from telorder
                             where reason = :the_reason
                    unpivot include nulls (the_order for the_phone in (tel1 as 'tel1',
                                                                       tel2 as 'tel2',
                                                                       tel3 as 'tel3',
                                                                       tel4 as 'tel4',
                                                                       tel5 as 'tel5'
                   ) t,
                   (select 'tel1' the_var,:v_tel1 the_val from dual union all
                    select 'tel2' the_var,:v_tel2 the_val from dual union all
                    select 'tel3' the_var,:v_tel3 the_val from dual union all
                    select 'tel4' the_var,:v_tel4 the_val from dual union all
                    select 'tel5' the_var,:v_tel5 the_val from dual
                   ) v
             where t.reason = :v_reason
               and t.the_phone = v.the_var
    where rn = 1
       and the_val is not null
    Regards
    Etbin

  • CROSS TABLE in APEX

    Hello!
    I have to develop student attendance application in Oracle APEX.
    I have 2 databases. First contain personal info of all the students and class ID (of each of them).
    Second contains column for student_ID from first table (which is foreign key), the date and the comment, when combination of student_ID and date is set as unique, so no one can be attended at lecture twice a day.
    (Of course both tables have their own ID primary key).
    For example:
    first table
    ID | Name | Address | Class ID
    1 | Alex | USA | Group A
    2 | John | Canada | Group A
    3 | Peter | France | Group B
    second table
    ID | first_table_ID | date | comment
    1 | 1 | 1-aug-09 | attended
    2 | 2 | 1-aug-09 | skipped
    3 | 3 | 1-aug-09 | lateness
    4 | 1 | 3-aug-09 | attended
    5 | 2 | 3-aug-09 | attended
    6 | 3 | 3-aug-09 | attended
    So, what I need, is build report table for each of classes, i.e. lecturers choose the class (from list of values for example), and see table like this (for class A, in this case):
    ***** | 1-aug-09 | 3-aug-09
    Alex | attended | attended
    John | skipped | attended
    How can I do it?
    I experimented with PIVOT command and other stuff, but every time i get different errors in query builder.
    Do I need build some data view or some new table from existing ones?
    What will be query commands?
    THANKS.
    Edited by: mindhunter on Aug 9, 2009 4:32 AM
    Edited by: mindhunter on Aug 9, 2009 4:34 AM

    Hi Mindhunter - and, welcome!
    I actually found the new PIVOT functionality annoying - as (A) you have to hardcode the column headings and (B) you have to use an aggregate function to populate the columns.
    However, it is possible to handle this by using a "SQL Query (PL/SQL function body returning SQL query)" report. In this way, you can build up a SQL query as a string and then get Apex to run it for you.
    To create this type of report, create a normal SQL Query report using SELECT 1 FROM DUAL. When the report has been created, edit it and change the type from "SQL Query" to "SQL Query (PL/SQL function body returning SQL query)".
    Then, in the Region Source, you can enter in the PL/SQL that you need to construct the SQL statement. Here is an example using the DEPT and EMP tables:
    DECLARE
    vSQL VARCHAR2(1000);
    vDEPT VARCHAR2(1000);
    vSEP VARCHAR2(2);
    BEGIN
    vDEPT := '';
    vSEP := '';
    FOR d IN (SELECT DEPTNO, DNAME FROM DEPT ORDER BY DNAME)
    LOOP
      vDEPT := vDEPT || vSEP || d.DEPTNO || ' as "' || d.DNAME || '"';
      vSEP := ', ';
    END LOOP;
    vSQL := 'SELECT * FROM (SELECT ENAME, ENAME ENAME2, DEPTNO FROM EMP) PIVOT (MIN(ENAME2) FOR DEPTNO IN (' || vDEPT || '))';
    RETURN vSQL;
    END;In this example, I have to loop through all the departments on the DEPT table and make a list of the DEPTNO and DNAME values. The DEPTNO value is the one also used on the EMP table, and the DNAME value is the one that I want as column headings. When the PIVOT is being performed, the DEPTNO values are the ones that are used to determine what appears in each column. Also note that I've had to duplicate the ENAME column (giving the second instance of this a column alias of ENAME2) - I need to do this to get the ENAME value as the first column of the report and the ENAME2 value as an entry in the appropriate column.
    Once I had done this, I selected the "Use Generic Column Names (parse query at runtime only)" underneath the Region Source so that I don't have to specify the column names to Apex. It also allows the first ENAME value to appear as the first column in the first. If I ticked the "Use Query-Specific Column Names and Validate Query" option, for some reason, the ENAME column appears last.
    OK, that's an example using data that most users here would have. Now for your data. This is actually more complicate as you are using dates as these have to be sorted in order AND converted into strings (for the headings).
    Firstly, I would recommend that you create a view over the two tables (if you haven't already done so). Something like:
    CREATE OR REPLACE FORCE VIEW STUDENT_ATTENDANCE
      STUDENT_ID,
      STUDENT_NAME,
      CLASS_DATE,
      CLASS_COMMENT
    AS
    SELECT
      S.ID STUDENT_ID,
      S.NAME STUDENT_NAME,
      C.DATE CLASS_DATE,
      C.COMMENT CLASS_COMMENT
    FROM
      STUDENTS S
      INNER JOIN COMMENTS C ON S.ID = C.STUDENT_IDNow we can create a PL/SQL code:
    DECLARE
    vSQL VARCHAR2(1000);
    vDATES VARCHAR2(1000);
    vSEP VARCHAR2(2);
    BEGIN
    vDATES := '';
    vSEP := '';
    FOR d IN (SELECT DISTINCT TO_CHAR(CLASS_DATE,'YYYYMMDD') DATEVALUE, TO_CHAR(CLASS_DATE,'DD-MON-YY') HEADING, CLASS_DATE FROM STUDENT_ATTENDANCE WHERE CLASS_DATE IS NOT NULL ORDER BY CLASS_DATE)
    LOOP
      vDATES := vDATES || vSEP || d.DATEVALUE || ' AS "' || d.HEADING || '"';
      vSEP := ', ';
    END LOOP;
    vSQL := 'SELECT * FROM (SELECT STUDENT_NAME, CLASS_COMMENT, TO_CHAR(CLASS_DATE,''YYYYMMDD'') DATEVALUE FROM STUDENT_ATTENDANCE WHERE CLASS_DATE IS NOT NULL) PIVOT (MIN(CLASS_COMMENT) FOR DATEVALUE IN (' || vDATES || '))';
    RETURN vSQL;
    END;You will see that I have two versions of the dates - one in YYYYMMDD format and one in DD-MON-YY. The first is to allow me to create a number that can be used to identify the column (this is easier that trying to compare dates) and the second is for the column heading. As we have to use an aggregate function in the PIVOT, I've just used MIN(CLASS_COMMENT) - assuming that the student can only attend (or not!) one class per date, then this should be ok as this could only return one value.
    As I do not have your tables and data, I have created a sample page with a similar statement for the HIREDATE values on the EMP table: [http://apex.oracle.com/pls/otn/f?p=267:138]
    The PL/SQL for the top report is my example above. The PL/SQL for the bottom report is:
    DECLARE
    vSQL VARCHAR2(1000);
    vDATES VARCHAR2(1000);
    vSEP VARCHAR2(2);
    BEGIN
    vDATES := '';
    vSEP := '';
    FOR d IN (SELECT DISTINCT TO_CHAR(HIREDATE,'YYYYMMDD') DATEVALUE, TO_CHAR(HIREDATE,'DD/MM/YYYY') HEADING, HIREDATE FROM EMP WHERE HIREDATE IS NOT NULL ORDER BY HIREDATE)
    LOOP
      vDATES := vDATES || vSEP || d.DATEVALUE || ' AS "' || d.HEADING || '"';
      vSEP := ', ';
    END LOOP;
    vSQL := 'SELECT * FROM (SELECT ENAME, ENAME ENAME2, TO_CHAR(HIREDATE,''YYYYMMDD'') DATEVALUE FROM EMP WHERE HIREDATE IS NOT NULL) PIVOT (MIN(ENAME2) FOR DATEVALUE IN (' || vDATES || '))';
    RETURN vSQL;
    END;Andy

  • How create temporary table from list of values

    Can you anybody advise me how can I create temporary table from list of values? I have list of values and need create temporary table for next use with command JOIN etc.
    Thank you for help

    NO, you can not create temporary table in oracle on the fly ( Like #Tabels in SQl Server or Sybase ) , you will have to use the GTT i.e Global Temporary Tables
    check the following link GTT :
    to flush the tables after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT DELETE ROWS;In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until the end of the session.
    so to keep rows in Table after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT PRESERVE ROWS;

  • Can I get Date also from temporary table?

    --(1) get table ONLY
    create global temporary table cat1
    as select * from category;
    --(2) get table and data
    create table cat2 as select * from category;
    null

    Use Index

  • Report: sorting of data and temporary table sorting

    We have a report that runs a procedure, which inserts data into a temporary table using the supplied parameters. The report then selects data from this table.
    Previously the report has always displayed data in the same order in which it was inserted into the table, even though no sorting is specified by the report itself. I realize that the report itself ought to specify the sorting in order to guarantee it, but this has worked in the past.
    As part of an application/Oracle upgrade the report has been recompiled. Data is now displayed in a different order as before. However, each time we run it now, it IS the same (new) sorting. So it's still consistent, but consistent in a different way than before.
    Is there some way to go back to the old sorting (display in same order as inserted into table) - without having to re-code this (and all the other) reports in order to specify the sorting? We think that data is still inserted into the temporary table in the same order as before. We are using the same version of Crystal Reports.
    Edited by: user489847 on May 31, 2010 4:01 AM

    Crystal Reports.This is the Oracle Reports forum.
    Anyway, I have seen this in one of our applications too. Suddenly the ordering was different, because there was no explicit order by. There is never a guarantee of the ordering if you do not specify it.
    You should ask this in the database forum too, since this is not really Reports related.

  • Use of global temporary tables in Procedures

    Hi
    I am using global temporary tables in the procedures. Loading data in the same table through many procedures. I am fetching the data from the global temporary table in PRO-C by a cursor. Will this degrade performance?
    Please help me..
    Thanks in Advance...

    Will this degrade performance?That depends... in comparison to what?
    Loading data into temporary tables will generally be more efficient than loading data into permanent tables because Oracle needs to do less to protect this data since it is inherently transient. On the other hand, loading the data into a table in the first place tends to be more expensive than alternatives like using a single SQL statement, a pipelined table function, or an in memory collection.
    Justin

  • How to Use Temporary table on report builder

    Hi community!
    Well, i'm trying to build a temporary table based report in Oracle Report Builder. in "After Parameter Form Trigger" I've placed a stored procedure that populate a temporary table and I've based my report on it. The problem is Report shows no data. When i execute this procedure directly on database and i perform a select on my temporary table, it show all inserted data.
    I hope somebody can to help me because I tried many ways to build this report with my temporary table and always looks blank.

    Temporary tables are session specific.
    If particular session is closed then no data will be found on your temporary table in an another session.
    My suggestion is, on "After parameter form" trigger you directly populate the GTT without using procedure.
    Hope this will help.

  • How to Create a Temporary Table with SQL Server

    I know you can create a temporary table in SQL Server 2000, but not quite sure how to do it in CFMX 7, i.e., does the SQL go inside a <CFQUERY dbtype="query"> tag?
    I'm pulling the main set of records from an Oracle server (1st data source), but it does not contain employee names, only employee IDs.  Since I need to show the employee name along with the Emp ID, I'm then pulling a list of "current" employee names from a SQL Server (2nd data source), which is the main database on our CF server.
    I've got a QofQ that works fine, except it only matches EmpIDs that exist in both result sets.  Employees who are no longer employed, don't match, and don't display.  Since I can't do a LEFT OUTER JOIN with a QofQ, what I need to do is get the records from the Oracle server into the SQL Server.  Preferably in a temporary table.
    I was hoping if I could get those Oracle records written to a temp table on the main SQL Server, in same database as the Employee Name table, I could then write a normal <CFQUERY> that uses a LEFT OUTER JOIN.
    I think I could probably write a Stored Procedure that would execute the SQL to create the temporary table, but am trying to avoid having to write the SP, and do it the simplest way.
    This query will be a program that can be run hundreds of times per day, with a form that allows users to select date ranges, locations, and other options.  That starts the queries, which creates the report.  So I just need the temp table to exist only until all the SQL has run, and the <CFOUTPUT> has generated a report.
    If the premise is right, I just need some help with the syntax for creating a SQL Server temp table, when you want to write records to it from an external data source.  I'm trying the following, but getting an error:
    <CFQUERY name="ITE_Temp" datasource="SkynetSQL">
    CREATE TABLE #MyTemp
    (   INSERT INTO #MyTemp
    ITE2.TrueFile char (7) NOT NULL,
    ITE2.CountOfEmployee int NULL,
    ITE2.DTL_SUBTOT decimal NULL,
    ITE2.EMPTYPE char (3) NULL,
    ITE2.ARPT_CD char (3) NULL
    </CFQUERY>
    So I actually created a permanent table on the SQL Server, and wrote the below SQL, which does work, and does write the records to table.  I can then write another CFQUERY with a LEFT OUTER JOIN, and get all the records, including those that don't have matching employee name:
    <CFQUERY datasource="SkynetSQL">
    <CFLOOP index="i" from="1" to = "#ITE2.RecordCount#">
    INSERT INTO ITE_Temp
       (FullFile,
       EmployeeCount,
       DTL_Amount,
       EmployeeType,
       station)
    VALUES  ('#ITE2.TrueFile[i]#',
       #ITE2.CountOfEmployee[i]#,
       #ITE2.DTL_SUBTOT[i]#,
       '#ITE2.EMPTYPE[i]#',
       '#ITE2.ARPT_CD[i]#')
    </CFLOOP>
    </CFQUERY>
    But, I hate to have to create a table and physically write to it.  For one, it seems slower, and doing it in temp would be in memory, and probably much faster, correct?  Is there some way to code the above, so that it does something similar, but in a TEMPORARY TABLE?   If I can figure out how to do this, I can pull data from multiple data sources and servers, and using SQL Server temp tables, work with the data as if it was all on the same SQL Server, and do some cool reports.
    Everything I've done for the past few years, has all been from data from a single source, whether SQL Server, or another server.  Now I need to start writing reports where data can come from 3 or 4 different servers, and be able to do joins (inner and outer).  Thanks for any advice/help.  Much appreciated.
    Gary

    While waiting to hear back, I was able to write the query results from an outside Oracle server, to a table on the local SQL Server, and do the LEFT OUTER JOIN required for the final query and report to work.  That was with this syntax:
    <CFQUERY name="AddTableRecords" datasource="MyTable">
    TRUNCATE TABLE ITE_Temp
    <CFOUTPUT query="ITE2">
    INSERT INTO ITE_Temp
    (FullFile,EmployeeCount,DTL_Amount,EmployeeType,station)
    VALUES
    ('#TrueFile#', #CountOfEmployee#, #DTL_SUBTOT#, '#EMPTYPE#', '#ARPT_CD#')
    </CFOUTPUT>
    </CFQUERY>
    However, I was not able to write to a temporary table AND read the results. I got the syntax to run to write the above results to a temporary table.  But when I tried to read and output the results from the temp table, I got an error.  Also, it wouldn't take the single "#" (local) only the global "##" table var, using this syntax.  Note that if I didn't have the DROP TABLE in the beginning, the 2nd time you run this query, you get an error telling you the table already exists.
    <CFQUERY name="ITE_Temp2" datasource="MyTable">
    DROP TABLE ##MyTemp2
    CREATE TABLE ##MyTemp2
    FullFile char (7) NOT NULL,
    EmployeeCount int NULL,
    DTL_Amount decimal NULL,
    EmployeeType char (3) NULL,
    station char (3) NULL
    <CFOUTPUT query="ITE2">
    INSERT INTO ##MyTemp2 VALUES
    '#ITE2.TrueFile#',
    #ITE2.CountOfEmployee#,
    #ITE2.DTL_SUBTOT#,
    '#ITE2.EMPTYPE#',
    '#ITE2.ARPT_CD#'
    </CFOUTPUT>
    </CFQUERY>
    So even though the above works, I could use some help in reading/writing the output.  I've tried several things similar to below, but they don't work.  It't telling me ITE_Temp2 does not exist.  It's not easy to find good examples of creating temporary tables in SQL Server.
    <CFQUERY name="QueryTest2" datasource="SkynetSQL">
    SELECT *
    FROM ITE_Temp2
    </CFQUERY>
    <CFOUTPUT query="ITE_Temp2">
    Output from Temp Table<br>
    <p>FullFile: #FullFile#, EmployeeCount: #EmployeeCount#</p>
    </CFOUTPUT>
    Thanks for any help/advice.
    Gary.

  • Life time of data in a Global Temporary Table.

    Dear Friends,
    I have a global temporary table in which I insert some values via a backend package, when forms start up and accessing it via the same package when user performs some changes in it - storing the value and during exit saving it in the master table. My problem is the data is not accessible while processing. I'm using Oracle9i Enterprise Edition Release 9.2.0.1.0 database and Forms [32 Bit] Version 6.0.8.8.0. I also give you the script in using which I created the temporary table.
    CREATE GLOBAL TEMPORARY TABLE GTT_PRA
    A1 VARCHAR2(10 BYTE) NOT NULL,
    A2 VARCHAR2(15 BYTE) NOT NULL,
    A3 VARCHAR2(10 BYTE) NOT NULL
    ON COMMIT DELETE ROWS;
    Why is that so? Please help me.
    With Regards,
    Senthil .A. Perumal.

    Dear Arun,
    Thank you for your script. But I'm accessing a large table, so for each and every process, the table get populated and grows very large giving some space problem, that is why I'm deleting rows when commiting. I would appreciate your help.
    Dear Yogesh,
    From the same forms I'm calling the backend package - will that be a different session. Once I'm calling to populate the table and next time I'm calling to store the user modified data and finally calling to store the data to master table. I think all are in the same sessions. Please reply me.
    Thank you dear friends fr your immediate response. I would really appreciate it.
    Regards,
    Senthil .A. Perumal.

  • How to check the data in a temporary table

    Hi,
    A procedure inserting data into a temporary table , data exists in the table now. so, how to see the data from the temporary table. Is it possible to see from the sqlplus by selecting, right now i'm not getting any data. .thanks Bcj.

    If you are referring to Global Temporary Tables, then the only way to see the contents of the table are to select from the table while connected to the same session that inserted the data into the GTT.
    Please note however that there is not a 1 to 1 correspondence between sessions and users (shcemas). A user may be connected to 1 or more sessions, but it is only the session that inserted the records that will be able to view the records.

  • How can i create a temporary table in my report

    hi
    how to create temporary tables in reports
    please tell me detailed procedure with an example
    thanks in advance
    prasanth

    in before parameter form or before report trigger or in any triger where u want just pass u r query as..
    SRW.DO_SQL('CREATE TABLE MYTABLE....')
    hope it will solve your porb.
    Thanks

  • Is there a way to create "temporary" tables in SAP database?

    Hello,
    Is there a way to create temporary tables in ABAP?
    Here is our scenario:
    1. Invoke a custom RFC that creates a temporary table and returns the name of the table.
    2. Invoke another custom RFC and pass this table name as parameter. This RFC internally does some INNER JOIN with the temporary table.
    3. Invoke the third RFC to delete the temporary table.
    Note that the name of the table cannot be static. We have many users using our application simultaneously and connecting to the SAP server.
    I would appreciate it if you could point me in the right direction.
    Thank you in advance for your help.
    Peter

    I just ran into a similar issue.  While only calling the select statement 2 times, each time had so many entries in the 'for all entries' list, that the compiler converted this into about 700 calls to the select.  Now since the select joined three real tables on the database, the trace shows this one select as being the slowest item in this application.
    I think that happened because 'for all entries' gets converted to an 'IN' clause, and then the total number of characters in any SQL statement has an upper limit.   So the compiler must make the select statement over and over until it covers all entries in the 'for all entries' list.  Is that correct?
    Since every database I ever saw has the concept of db temporary tables, I have used db temp tables many times for this sort of thing.
    The ABAP compiler could determine that more than one IN statement will be need, then use an alternate: write all the FOR ALL ENTRIES to a db temp table, then join on the db temp table, then drop db temp table.  Since the compiler does this sort of thing, no application code needs change to get the speed boost.

Maybe you are looking for

  • Problem with iTunes and ringtones

    Hello everybody! I'm running iOS 7.1.2 on my iphone 5c and I have a really annoying problem with my ringtones.I can see all my ringtones in my iPhone by going to Settings>Sounds>Ringtone. However, when I connect to iTunes I can only see some of them,

  • Updates are not recognized

    Many of my apps have been updated recently, but iTunes isn't recognizing/downloading them. For free apps this is no problem, I just "buy" them again and force the update that way, but for commercial apps I don't know what to do. Crosswords cost $10,

  • SQL*Loader output issue

    Hi, When I load a flat file with SQL*Loader (V 8.1.7 on Windows), I get output something like, Commit point reached - logical record count 2352 Commit point reached - logical record count 2364 Commit point reached - logical record count 2376 Commit p

  • Convert 10.2.0.4 RDBMS from WE8ISO8859P1 to UTF8 without install new langua

    We are in 11.5.10.2 Ebusiness suite with 10.2.0.4 RDBMS. thinking to take advantage a downtime to convert the darabase character set from WE8ISO8859P1 to UTF8 right now even we ONLY want to install and configure new language in year or two in the fut

  • Policy not found / access to URL denied

    Hi, I've installed a policy agent for Apache on redhat and integrated it with SunOne ID server. The authentication works as i can login but i then get denied access to the requested URL. The log of the policy agent says that the policy cannot be foun