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

Similar Messages

  • Can I use Parallel execution for Global Temporary table within SP and How

    Dear Gurus,
    I have Global temporary table as below
    Create global temporary table Temp_Emp
    empno number,
    ename varchar2(20),
    deptno number
    ) on commit preserve rows;
    During processing I insert the data into this table and then fire query on Temp_Emp, get the data and pass it to front end.
    The SP as shown below
    Create or replace procedure get_emp_data
    empid in number,
    emp_detail out RefCsr -- Ref cursor
    as
    begin
    -- some code here
    open emp_detail for
    select *
    from Temp_Emp
    where empno = empid;
    end get_emp_data;
    Can use Parallel Query execution on Temp_Emp table and how ?
    i.e. do need to explicitly use parallel construct in query or is it default.
    Because I have many SQL like above (on global temporary tables) within Stored Procedures.
    Can anybody give me any suggestion.
    Thanking in Advance
    Sanjeev

    How come you are populating a temporary table and then opening a cursor on this temporary table for the front end to use?
    Couldn't you presumably just form a query out of the code you use to populate the temporary table? This is the recommended approach in Oracle.

  • Create Temporary Tables in a Package

    In a package that I have I am trying to create a temp table. But when I try to alter the Package it gives me an error on the keyword CREATE. I am also unable to use the TRUNCATE Command. Has anyone ran into this problem and if so is there a work around?
    Thanks,
    TJ

    the reason i want to set the size of the varchar2 to a constant is,
    my guide is of the opinion that all these 'magic numbers' eg. size of a string
    must be placed separately and not embedded deep within the code.
    so that this implementation of my project can easily be put to use elsewhere whre the requirements may be different
    by just changing the value of size.
    I have another similar problem where i have a varray field in a table,
    and the max size of the varray must also be predefined.
    im not very clear abt pl/sql tables... they are more like arrays and are temporary right, simply to store session specific data.
    i want to be able to access the data in my table in subsequent sessions as well.
    Nim

  • PL/SQL block to create temporary table + load via cursor for loop

    Assume I have a table that contains a subset of data that I want to load into a temporary table within a cursor for-loop. Is it possible to have a single statement to create the table and load based on the results of the fetch?
    I was thinking something like:
    Declare CURSOR xyz is
    CREATE TABLE temp_table as
    select name, rank, serial number from
    HR table where rank = 'CAPTAIN'
    BEGIN
    OPEN xyz
    for name in xyz
    LOOP
    END LOOP
    What I see wrong with this is that the table would be created multiple times which is why this syntax is not acceptable. I'd prefer not to have to define the temporary table then load in two sepearte SQL statements and am hoping a single statement can be used.
    Thanks!

    What is the goal here?
    If you're just going to iterate over the rows that are returned in a cursor, a temporary table is unnecessary and only adds complexity. If you truly need a temporary table, you would declare it exactly once, at install time when you create all your other tables. You'd INSERT data into the temp table and the data would only be visible to the session that inserted it.
    Justin

  • Temp Table within an Stored Procedure

    I'm pretty new to Oracle, but I have been developing in MS SQL for about 15. So I'm still getting use to the syntax and features within Oracle.
    I'm trying to create a stored procedure that has two temporary tables within it, and then queries both them tables and inserts the results into a table.
    I created the script but when they try to run in on the server it wont run. Can you guys tell me what I'm doing wrong?
    CREATE OR REPLACE PROCEDURE UpdateFIDB_SP IS BEGIN               CREATE GLOBAL TEMPORARY TABLE myAAAA         AS               (SELECT  AAAA.1111, AAAA.2222, BBBB.3333_EXT, CCCC.4444, DDDD.5555, DDDD.6666, DDDD.7777,                       DDDD.8888, AAAA.9999, EEEE.1010, EEEE.1A1A, EEEE.1B1B, FFFF.3333_LO, FFFF.1C1C,                       AAAA.1D1D               FROM mySchema.FFFF_07 FFFF               RIGHT OUTER JOIN mySchema.EEEE EEEE ON FFFF.9999 = EEEE.1B1B               RIGHT OUTER JOIN (                                 mySchema.DDDD DDDD                                 RIGHT OUTER JOIN mySchema.AAAA AAAA ON DDDD.1D1D = AAAA.1D1D                                 ) ON EEEE.PSPNR = AAAA.9999               LEFT OUTER JOIN mySchema.CCCC CCCC ON AAAA.3333 = CCCC.3333               LEFT OUTER JOIN mySchema.BBBB BBBB ON AAAA.3333 = BBBB.3333_INT               GROUP BY  AAAA.1D1D, AAAA.1111, AAAA.2222, BBBB.3333_EXT, CCCC.4444, DDDD.5555, DDDD.6666,                         DDDD.7777, DDDD.8888, AAAA.9999, EEEE.1010, EEEE.1A1A, EEEE.1B1B, FFFF.3333_LO,                         FFFF.1C1C         ON COMMIT DELETE ROWS);                         CREATE GLOBAL TEMPORARY TABLE myGGGG         AS             (SELECT  GGGG.1E1E, GGGG.1F1F, GGGG.1G1G, GGGG.1H1H, GGGG.1I1I, GGGG.1J1J,                     GGGG.1K1K, GGGG.R1D1D, GGGG.1L1L, GGGG.1M1M, GGGG.1N1N, GGGG.1O1O, GGGG.1P1P,                     GGGG.1Q1Q, HHHH.1R1R, IIII.1S1S, IIII.1T1T, IIII.1U1U, IIII.1V1V             FROM  mySchema.IIII IIII                   INNER JOIN mySchema.GGGG GGGG ON IIII.1K1K = GGGG.1K1K                   LEFT OUTER JOIN mySchema.HHHH HHHH ON GGGG.1L1L = HHHH.1W1W             WHERE ( GGGG.1M1M IN ('20', '30') )             AND   ( TO_DATE(IIII.1V1V, 'dd-mon-yyyy') = TO_DATE('31-DEC-9999','dd-mon-yyyy') )             AND ( TO_DATE(GGGG.1N1N, 'dd-mon-yyyy') >= TO_DATE('01-Jan-2011','dd-mon-yyyy') )         ON COMMIT DELETE ROWS);                 TRUNCATE TABLE FIDB;                 INSERT INTO FIDB (1111, 2222, 3333_EXT, 4444, 5555, 6666, 7777, 8888, 9999,                                   1010, 1A1A, 1B1B,3333_LO, 1C1C, 1D1D, 1E1E, 1F1F, 1G1G,                                   1H1H, 1I1I, 1J1J, 1K1K, R1D1D, 1L1L, 1M1M, 1N1N,                                   1O1O, 1P1P, 1Q1Q, 1R1R, 1S1S, 1T1T, 1U1U, 1V1V)            SELECT  myAAAA.1111, myAAAA.2222, myAAAA.3333_EXT, myAAAA.4444, myAAAA.5555, myAAAA.6666,                 myAAAA.7777, myAAAA.8888, myAAAA.9999, myAAAA.1010, myAAAA.1A1A, myAAAA.1B1B,                 myAAAA.3333_LO, myAAAA.1C1C, myAAAA.1D1D, myGGGG.1E1E, myGGGG.1F1F, myGGGG.1G1G,                 myGGGG.1H1H, myGGGG.1I1I, myGGGG.1J1J, myGGGG.1K1K, myGGGG.R1D1D,                 myGGGG.1L1L, myGGGG.1M1M, myGGGG.1N1N, myGGGG.1O1O, myGGGG.1P1P,                 myGGGG.1Q1Q, myGGGG.1R1R, myGGGG.1S1S, myGGGG.1T1T, myGGGG.1U1U, myGGGG.1V1V         FROM myGGGG INNER JOIN myAAAA ON myGGGG.R1D1D = myAAAA.1D1D         ORDER BY myGGGG.R1D1D;        COMMIT;     END;
    Thanks!

    Some people still sound mad at me because I have two queries and use temp tables
    Because in Oracle, unlike in sql server, you generally do not NEED temp tables at all.
    One of the biggest mistakes new Oracle developers make is to use PL/SQL when SQL will do the job just fine. Using PL/SQL when it isn't needed generally makes the code slower, less scalable and harder to maintain.
    One of the biggest mistakes sql server developers make when they use Oracle is to use temp table when they aren't needed. They try to write code in Oracle exactly the same way they wrote it in sql server. That creates temp tables that aren't needed, makes their code perform horribly and also makes it less scalable and harder to maintain.
    Oracle works differently and generally doesn't need ANY temp tables. You need to learn about how Oracle handles transactions and read consistency and how writers do NOT block readers and vice versa.
    Create a new thread and post FORMATTED code that shows the PROBLEM you are trying to solve and we can show you the proper way to solve it. That 'proper way' will likely NOT include any need for or use of temp tables.

  • Using Global Temporary Table in Discoverer.

    Hi All
    I am currently working on a Disco report, where I am initializing a package at the disco condition level which inserts data in to a Global Temporary Table.
    The global temporary table will be having data based on the parameter entered by the user. But the problem occurs when we are trying to use the same GTT in the select statement as shown below. The desktop is not giving me the otuput but the GTT is getting populated with data.
    see below
    SELECT bla1,
    bla2,
    bla3
    FROM GTT (global temp table)
    WHERE 1= PACKAGE.FUNCTION(par1, par2, par3...) <- here we are trying to insert into GTT based on the paramenters passed.
    Can you please suggest how this can be achieved. Or is there any way to trigger the insertion in to GTT other than the calling it in the condition level.
    Thanks
    Arun

    Hi,
    You cannot use a GTT like this because you cannot write and read from the GTT using a single SQL statement. You must either have the insert in a separate worksheet and tell the users to run this worksheet first, or you wrap it all up in a table function called from within a view. The table function can then insert and select from the GTT using two statements.
    Which method is best depends on what you are trying to do and why you want to use a GTT.
    Rod West

  • 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.

  • Append data to a temporary table in Data Serices

    Folks,
    The job in data services that we have, has multiple work flows that try to append the data to the same target in multiple stages. I was wondering if there is a way to have a temporary table created within Data services where data can be appended to the temp table in each stage and at the end of all stages, the temporary table is mapped to the data target (BW datasource) in our case. I am not sure if data transfer transformation can be used for temp table storage, but can someone please advise if there is a way to do it.
    Best regards,
    Doniv

    Hi,
    For temp table just drag the table icon from the right side or menu pane.
    Connect to a query transform and run the job.
    You need to run the job atleast once for creating the table. After running the job once, double click the table and uncheck the two options i mentioned above from options.
    Then proceed with further runs to append the table with records.
    Hope this helps.
    Arun

  • Appropriate use of temporary table - or can pivot approach be used?

    I am relatively new to pl/sql. My problem is that I need to return one row of data (joining several tables, including a 1-many), but with a varying number of columns (from single values returned from the 1-many table), and record types cannot be dynamically defined or modified (such as with adding columns).
    I am not sure if pivoting the many table would work, because the range of values returned (albeit not expected to realistically exceed a dozen) do not fall within a small set.
    Would dynamically generating SQL to create a temporary table with the requisite number of columns be the best approach? Then I could select all the data into the table, iterate through the results from the 1-many and populate into the columns, and then select * from the temp table for the return resultset.
    Specifics: There is a document table which has a 1-many table containing the CC's for that document. Only one row will ever be returned from the master doc table, and 0-n rows from the CC table. There could be no CC's for the doc, or there could be any number. I need to be able to return all the columns from the document table PLUS the CC's as if they were all one row in a table.
    So example of a return row might be a doc with n # of cc's
    DOC_ID | DOC_TYPE | DOC_OWNER | <etc> | CC_1 | CC_2 | ... | CC_n
    or a doc with all its fields and no cc's
    DOC_ID | DOC_TYPE | DOC_OWNER | <etc>
    So I am thinking the pl/sql would have to
    1. declare the SQL statement to create a temporary table
    2. declare the SQL statement to insert data into the temporary table
    3. declare the SQL statement to query data from the temporary table
    4. fetch the count of CC's based on doc id from the CC table
    5. use that count to loop and
    1. append columns onto the sql that creates the temporary table
    2. append columns onto the sql that will query the temporary table
    6. query the CC's table and read the values into an array
    7. use the count again to loop and dynamically create the insert statement for the temporary table, using the values from step 6
    8. execute the insert statement
    9. query the temporary table using the sql generated in step 5.2 and return that rowset
    HUGE thanks to anyone who can provide input on this. I know it's not a new problem, I am just unsure of the best approach to the solution.

    It's not that I require a single SQL statement to do this; in fact I expected to have to execute at least 2 in the procedure to accomplish the goal. The problem I am running into is that I need to return a dynamic number of columns, based on the number of entries in the 1-many table.
    I'm guessing if I can look up the number of rows in the 1-many table that I need to pivot before I actually do the pivot, I will be able to use this technique?
    The reasoning for all this can be summed up in one word: legacy. The row is being sent back to a legacy component which only takes that one single row of data. Currently, we are only limited to 3 CC entries and are expanding the system to allow >3, hence the 1-many table. However, the legacy component isn't able to handle anything more complex than that one row. Our clients will be able to change their definitions easily to expand from CC1, CC2, CC3 to however many they want to use. However, changing to multiple rows wouldn't be an option because it would incur too much complexity.

  • Temporary Tables in Oracle

    Hi all,
    I am developing a .net application withe back end being oracle 10g. previously i worked with sql server 2005,2008 and i am new to oracle.
    i am working on a complex query which requiries, temporary table inside the procedure. In sql server easy to create and drop the temp table inside the proc.
    Can I use a Transaction specific GTT to store and process the temporary data inside my procedure??? My web application gets connected to the database through a one username and password. Since being a web applicatioin multiple users will execute the procedure at the same time, logged under the same username and password...
    I know its a coomon question, but i need it urgently..
    its very complicated to use WITH SELCT or inline views etc...
    Thank you,
    Kris.

    I know its a coomon question, but i need it urgently..If you know it is a common question then you should know the common answer. But let's rehearse it one more time.
    In Oracle temporary tables are permanent objects. It is only the data in them which is temporary. So for your scenario you shoudl have the DBA create the table once, like any other table.
    The trick with temporary tables is that each session sees its own data and nothing else. So your procedure can populate the table with data, process it and return it without a hitch.
    Since being a web applicatioin multiple users will execute the procedure at the same time, logged under the same username and password...Doesn't matter: the view of the data is controlled by session. So you haven't got a problem providing the table is populated and the resultset returned within a single call.
    its very complicated to use WITH SELCT or inline views etc...Yes it is hard. Fortunately CPUs keep getting more powerful and bandwidth keeps getting cheaper, so our systems continue to cope with the increasing amount of suck-y code being thrown at them. Isn't Moore's Law wonderful :)
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Direct Path Loading Issues with Global Temporary Tables - OCI & OCILib

    I am writing some code to import data into a warehouse from a CPU grid which computes risk data. Due to the fact a computing grid is used there will be many clients which can load the data concurrently and at any point in time.
    Currently the import uses Binding in OCCI and chunking with a prepared statement to import the data into a global temporary table in a staging area after which a stored procedure is called within the same session which will process the data and load the data into a star schema.
    The GTT has the advantage that if any clients have issues no dirty data will be left and each client only sees their own instance of the data.
    I have been looking at using direct path loading to increase the performance of the load and have written some OCI code to perform the same task. I have manged to import the data into a regular heap based table using the OCI direct path apis. However when I try and use the same code to import against a Global Temporary Table I get an OCI Error (ORA-00600: internal error code, arguments: [6979], [16], [1], [1318528], [], [], [], [], [], [], [], [])
    I get error when the function OCIDirPathPrepare is executed. The same issue occurs in both OCI and OCILib.
    Is it not possible to use Direct Path Loading against a Global Temporry Table ? Because you can use the /*+ APPEND */ hint and load global temporary tables this way from tools like SQL Devloper / toad which is surely informing the SQL Engine to use Direct Path ?
    Looking at the table USER_OBJECTS I can see that for a Global Temporary Table the DATA_OBJECT_ID is null. Does this mean that it is impossible to us a direct path load into Global Temporary Tables ?
    Any ideas / suggestions would be really appreciated. If this means redesigning the application then I would appreciate suggestions which would allow many client to quick write processes in a parallel fashion. If this means creating a new parition in a Heap Table for each writer and direct path loading into this table then so be it.
    Thanks
    H
    Edited by: 813640 on 19-Nov-2010 11:08

    Replying to my own message in case anyone else is interested.
    I have now managed to successfully load data using direct path into a global temporary table with OCI. There appears to be no reason why this approach will not work.
    I loaded data into the temporary table and then issued a select count(*) on the table from within the session and from a new session. The results were as expected.
    The resaon for the ORA-006000 error was due to the fact that I had enabled table level parallel loading
    ie
    OCIAttrSet((dvoid *) context, (ub4) OCI_HTYPE_DIRPATH_CTX, *(ub1) 1*, (ub4)0, (ub4) OCI_ATTR_DIRPATH_PARALLEL, errhp)
    When loading a Global Temporary Table the OCI_ATTR_DIRPATH_PARALLEL attribute needs to be zero
    This makes sense, since the temp table does not have any partitions so it would not be possible to write in parallel to multiple paritions.
    Edited by: 813640 on 22-Nov-2010 08:42

  • Global temporary table in a store procedure

    Hi,
    I REALLY need to create a global temporary table in a stored procedure but I don't know how .........
    My solution was
    create or replace procedure test(
    as
    begin
    execute immediate 'create global temporary table t(x number,..) ;';
    end;
    but the table is not created. What I am doing wrong and how to resolve the problem?
    Thanks.

    There is NO valid reason to create a GTT on the fly (except during installation of a package). This defeats the entire logic behind it. Precreate it and use it by a million users at the same time and it won't care. For more information On GTT's see.
    http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76939/adg03sch.htm#7807

  • Problem with temporary table in stored procedure

    Hi,
    I have to execute a stored procedure in java , where the stored procedure has refcursor as out parameter and within the procedure the refcursor out parameter is populated from a temporary table
    when iam trying to get the resultset in my program iam getting the oracle error: ora-08103 object is no longer in use.
    I think this is becos the temporary table object is not available to my program
    can any one please help me

    I don't understand this part.
    Your procedure has "argSchemaName" as input parameter. Why do you have hardcoded owner name here in the cursor?
    >>
    CURSOR csrEligTables IS
    SELECT
    object_name
    FROM
    all_objects
    WHERE
    Owner = 'HI0XXX001'
    AND
    >>
    The anonymous block that you are running also has same owner name.

  • Clearing out global temporary tables in a session.

    I have a global temporary table that is used within one stored procedure. Another procedure calls it twice in succession and the second time the child SP is called, the temp table is retaining the values from the first call. I want to clear the contents of the temp table before the child SP completes, but am getting an "invalid table name" error when I try to truncate it or delete the contents. Any thoughts?
    By the way, when I created the global temp table, I used 'on commit delete rows'
    Thanks
    Matt

    I have a global temporary table that is used within
    one stored procedure. Another procedure calls it
    twice in succession and the second time the child SP
    is called, the temp table is retaining the values
    from the first call. I want to clear the contents of
    the temp table before the child SP completes, but am
    getting an "invalid table name" error when I try to
    truncate it or delete the contents. Any thoughts?
    By the way, when I created the global temp table, I
    used 'on commit delete rows'
    Thanks
    MattCan you paste the create table script of the table?

  • Changing Names of Temporary tables Created BY CKm and LKM

    Hi,
    I am new to ODI.
    I want to know if we can change the default name structure that is used by ODi to create temp tables.
    I$,C$ and E$ table.
    E.G:- If i want to keep I$1 for one schema and I$2 for another schema.
    Is there any way by which we can do this?
    Thanks,
    Mahesh

    Hi,
    I have one situation where i am having various packages using different source tables but having single target table.
    Right now i am not running all packes at a time but as it would go in prod those will be run simultaneously which may result in errors.
    So for precautionary cause i am trying to fix it in Advance.
    eg:- We have multiple factories from which we are taking data and putting them in same table.
    Like i have A,B,C factories and each factory has X,Y,X schema as ax,bx,cx,by,cy.ay ......
    i AM TAKING DATA FROM these schema and resp tables in each factories packages and putting it in centralized database.
    So when i run thiose packages will it be a case that it will clash in Temporary tables?
    Let me know if u are clear with the question :)

Maybe you are looking for

  • Mm related year ending

    send me the financial year ending process regarding material management customisation in detail.

  • Is Airport a substitute for software firewall?

    I have a Windows PC behind my Airport network. Is my Airport's NAT (or the NAT of any router for that matter) a substitute for software firewall? As I understand it, the only thing software firewalls do is block un-used ports, which Airport's NAT alr

  • Find the purchase order from an article delivered to a customer ?

    Hi friends;  How to identify the purchase order from an article delivered from stock to a sales order. I only have the customer order and material number. Are there standard report that could provide me with this information. Thanks in advance for yo

  • Application iCal deleted - Impossible to download iCal on my MacBook

    Hi, I accidentally deleted the application iCal from my MacBook, and now it is impossible to download it again! I've been on the apple website and the only iCal available to download is iCal 1.5.5 but this version does not work because it is not comp

  • SMS Relay stopped working

    Ever since upgrading to iOS 8.1, I've been using SMS relay, no problem with my iMac. Today not so much. When I try to message someone without an iCloud account, I get an error that says they are not registered with iMessage. Both devices are on the s