Truncate and populate temp tables
Hi - I need to convert oracle reportwriter reports that call procedures to truncate/populate tables and return REF CURSORs. Can I call these same procedures from BI Publisher ? Thank-you.
Hi ,
Please look the below threads ....
How call procedure or package from Oracle BI Publisher 10.1.3.2.1
BI publisher to use Stored Procedure
This will helpful for you.
Thanks,
Ananth
Similar Messages
-
Fetch Data from BI system and populate a Table in webdynpro
Hi,
I have to fetch the data from BI system into a model and populate the Table.
The data resides in BI system. I am creating model from adaptive RFC and the function module is RRW3_GET_QUERY_VIEW_DATA. This is the max information i have got to execute the query
Infoprovider ZM_SC_GR
Query T_SUPGR003
Variable: Vendor Number
VAR_NAME_1 SPRPVEN
VAR_OPERATOR_1 EQ
VAR_VALUE_LOW_EXT_1 Value
VAR_VALUE_HIGH_EXT_1
VAR_SIGN_2 I
Variable: Purchasing Group
VAR_NAME_2 CSMPGRP
VAR_OPERATOR_2 EQ
VAR_VALUE_LOW_EXT_2 Value
VAR_VALUE_HIGH_EXT_2
VAR_SIGN_2 I
Variable: Calendar Day Range
VAR_NAME_3 SPGRDT01
VAR_OPERATOR_3 BT
VAR_VALUE_LOW_EXT_3 Value1
VAR_VALUE_HIGH_EXT_3 Value2
VAR_SIGN_3 I
I am not able to understand which parameters of the model I should map for context mapping to map cotroller with model.
Thanks and Regards,
Pankajafter you imported Rrw3_Get_Query_View_Data function as adaptive rfc model in your component and mapped its node controller context Rrw3_Get_Query_View_Data_Input model to your controller context do the following:
i.e.
Rrw3_Get_Query_View_Data_Input model = new Rrw3_Get_Query_View_Data_Input();
model.setI_Infoprovider("0FIA_MDS2");
model.setI_Query("FIA_MDS2_Q0005MP");
wdContext.nodeGetQueryView().bind(model);
W3Query paramElement1 = new W3Query();
paramElement1.setName("VAR_NAME_1");
paramElement1.setValue("0P_CSDAT");
W3Query paramElement2 = new W3Query();
paramElement2.setName("VAR_OPERATOR_1");
paramElement2.setValue("LE");
W3Query paramElement3 = new W3Query();
paramElement3.setName("VAR_VALUE_EXT_1");
paramElement3.setValue(cdate);
W3Query paramElement5 = new W3Query();
paramElement5.setName("VAR_NAME_2");
paramElement5.setValue("0S_CCTR");
W3Query paramElement6 = new W3Query();
paramElement6.setName("VAR_OPERATOR_2");
paramElement6.setValue("EQ");
W3Query paramElement7 = new W3Query();
paramElement7.setName("VAR_VALUE_LOW_EXT_2");
paramElement7.setValue(mvz);
W3Query paramElement8 = new W3Query();
paramElement8.setName("VAR_VALUE_HIGH_EXT_2");
paramElement8.setValue(mvz);
W3Query paramElement9 = new W3Query();
paramElement9.setName("VAR_SIGN_2");
paramElement9.setValue("1");
model.addI_T_Parameter(paramElement1);
model.addI_T_Parameter(paramElement2);
model.addI_T_Parameter(paramElement3);
model.addI_T_Parameter(paramElement5);
model.addI_T_Parameter(paramElement6);
model.addI_T_Parameter(paramElement7);
model.addI_T_Parameter(paramElement8);
model.addI_T_Parameter(paramElement9);
then execute
wdContext.currentGetQueryViewElement().modelObject().execute();
and invalidate output node
and then you get the data from r3 system.
then you should correctly parse output node and read the data from E_Axis_Data node E_Cell_Data node. -
Fetch Data from BI system and populate a Table
Hi,
I have to fetch the data from BI system into a model and populate the Table.
The data resides in BI system. I am creating model from adaptive RFC and the function module is RRW3_GET_QUERY_VIEW_DATA. This is the max information i have got to execute the query
Infoprovider ZM_SC_GR
Query T_SUPGR003
Variable: Vendor Number
VAR_NAME_1 SPRPVEN
VAR_OPERATOR_1 EQ
VAR_VALUE_LOW_EXT_1 Value
VAR_VALUE_HIGH_EXT_1
VAR_SIGN_2 I
Variable: Purchasing Group
VAR_NAME_2 CSMPGRP
VAR_OPERATOR_2 EQ
VAR_VALUE_LOW_EXT_2 Value
VAR_VALUE_HIGH_EXT_2
VAR_SIGN_2 I
Variable: Calendar Day Range
VAR_NAME_3 SPGRDT01
VAR_OPERATOR_3 BT
VAR_VALUE_LOW_EXT_3 Value1
VAR_VALUE_HIGH_EXT_3 Value2
VAR_SIGN_3 I
I am not able to understand which parameters of the model I should map for context mapping to map cotroller with model.
Thanks and Regards,
Pankaj
Edited by: pankaj pathak on Sep 9, 2010 12:25 PMafter you imported Rrw3_Get_Query_View_Data function as adaptive rfc model in your component and mapped its node controller context Rrw3_Get_Query_View_Data_Input model to your controller context do the following:
i.e.
Rrw3_Get_Query_View_Data_Input model = new Rrw3_Get_Query_View_Data_Input();
model.setI_Infoprovider("0FIA_MDS2");
model.setI_Query("FIA_MDS2_Q0005MP");
wdContext.nodeGetQueryView().bind(model);
W3Query paramElement1 = new W3Query();
paramElement1.setName("VAR_NAME_1");
paramElement1.setValue("0P_CSDAT");
W3Query paramElement2 = new W3Query();
paramElement2.setName("VAR_OPERATOR_1");
paramElement2.setValue("LE");
W3Query paramElement3 = new W3Query();
paramElement3.setName("VAR_VALUE_EXT_1");
paramElement3.setValue(cdate);
W3Query paramElement5 = new W3Query();
paramElement5.setName("VAR_NAME_2");
paramElement5.setValue("0S_CCTR");
W3Query paramElement6 = new W3Query();
paramElement6.setName("VAR_OPERATOR_2");
paramElement6.setValue("EQ");
W3Query paramElement7 = new W3Query();
paramElement7.setName("VAR_VALUE_LOW_EXT_2");
paramElement7.setValue(mvz);
W3Query paramElement8 = new W3Query();
paramElement8.setName("VAR_VALUE_HIGH_EXT_2");
paramElement8.setValue(mvz);
W3Query paramElement9 = new W3Query();
paramElement9.setName("VAR_SIGN_2");
paramElement9.setValue("1");
model.addI_T_Parameter(paramElement1);
model.addI_T_Parameter(paramElement2);
model.addI_T_Parameter(paramElement3);
model.addI_T_Parameter(paramElement5);
model.addI_T_Parameter(paramElement6);
model.addI_T_Parameter(paramElement7);
model.addI_T_Parameter(paramElement8);
model.addI_T_Parameter(paramElement9);
then execute
wdContext.currentGetQueryViewElement().modelObject().execute();
and invalidate output node
and then you get the data from r3 system.
then you should correctly parse output node and read the data from E_Axis_Data node E_Cell_Data node. -
Sys_refcursor and Global Temp Table
I have a stored proc that returns a sys_refcursor that is a query from the Global Temporary Table. The problem is that I cannot get ODP.Net to return the results. It comes back empty every time.
The GTT is set for preserve on commit but ultimately I want to have it set to delete.
Does anyone have any experience with this and is willing to share some sample code for getting the values back from the stored proc?Where did you populate the GTT from? Was it from the same ODP session, using the same OracleConnection? GTT data is only visible to the session that inserted it.
A kinda goofy thing about using GTT with an app that utilizes connection pooling is when you put a connection back in the pool and then call con.Open again
a) you dont know for sure what connection you're getting.
b) the connection you got from the pool could also have leftover state, as it does not get "cleaned up" between going in and coming out, and is not restored to pristine condition. If you have PLSQL package state, GTT with on commit preserve, alter session, it's possible two con.Open calls could result in differing behavior.
I assume if you use a single Oracle connection to populate the table, then use it to call a proc to open a ref cursor from it, that works?
comments/corrections welcome.
Greg -
Pass Value From One Form to Another and Populate Join Table
I have a table “std_controls” and a table “actual_controls”. The standard controls table is updated with the expected business control or process. The actual controls table is updated with the control or business process the company actually
has in place. These two tables may be updated at different times by different individuals. Later I need to be able to map the actual controls to the standard controls. I have done this before using a join query which then matched the primary
keys and populates a new table with the joined keys. What I would like to be able to do is this: Have a form open, “form1” (which is where the standard controls are entered). The user could then click a button which would open another form,
“form2”, that listed all actual controls at that time from which they could choose. The user could then select the actual control on “form2” they wanted to map to the current standard control on “form1”. The user could select the actual control
on “form2” by selecting a check box. The effect of this mapping would populate my join table.
I have seen other posts that describe doing something similar, but I need more help on how to actually set it up. Thanks for your help.Hi jdmcleod,
According to your description, I don’t understand clearly about your requirement.
But I think you could access “form1”/”form2”’s control in either of “form1” or “form2”, so you could have a button in “form1” or “form2”, then in the click event get these forms control’s value (e.g. checkbox) and update the database.
For example to access other form’s checkbox value:
Dim f As Form
Set f = Forms!OtherFrom
MsgBox f.Controls("Check11").Value
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Read data from xml files and populate internal table
Hi.
How to read data from xml files into internal tables?
Can u tell me the classes and methods to read xml data..
Can u explain it with a sample program...<pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
DATA l_o_error TYPE REF TO cx_root.
DATA: filename type string ,
xmldata type xstring .
DATA: mr TYPE REF TO if_mr_api.
mr = cl_mime_repository_api=>get_api( ).
mr->get( EXPORTING i_url = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
IMPORTING e_content = xmldata ).
WRITE xmldata.
TRY.
CALL TRANSFORMATION id
SOURCE XML xmldata
RESULT shiva = itab_accontextdir.
CATCH cx_root INTO l_o_error.
ENDTRY.
LOOP AT itab_accontextdir INTO struct_accontextdir.
WRITE: / struct_accontextdir-context_id,
struct_accontextdir-context_name,
struct_accontextdir-context_type.
NEW-LINE.
ENDLOOP.</pre>
<br/>
Description:
In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of xml file).
mr = cl_mime_repository_api=>get_api( ).
mr->get( EXPORTING i_url = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
IMPORTING e_content = xmldata ).
Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
<pre>TRY.
CALL TRANSFORMATION id
SOURCE XML xmldata
RESULT shiva = itab_accontextdir.
CATCH cx_root INTO l_o_error.
ENDTRY.</pre>
Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'. In the RESULT root of the xml file has to be specified. (In my the root is 'shiva').
Things to be taken care:
One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table. Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.
<pre>TRY.
CALL TRANSFORMATION id
SOURCE shiv = t_internal_tab
RESULT XML xml.
CATCH cx_root INTO l_o_error.
ENDTRY.
WRITE xml.
NEW-LINE.</pre>
<br/>
This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table.
Thank you, Hope this will help you!!!
Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM -
Hi all,
Can someone tell me why when I create a GTT and insert the data like the followijng ,I get insert 14 rows msg. But when I do a select statement from sqlwork shop , sometimes i get the data sometimes I don't. my understanding is this data is supposed to stay during my logon session then got cleaned out when I exit session.
I am developing a screen in apex and will use this temp table for user to do some editing work. Once ithe editing is done then I save the data into a static table. Can this be done ? So far my every attempt to update the temp table always result to 0 rows updated and the temp table reversed back to 0 rows. CAn you help me ?
CREATE GLOBAL TEMPORARY TABLE "EMP_SESSION"
( "EMPNO" NUMBER NOT NULL ENABLE,
"ENAME" VARCHAR2(10),
"JOB" VARCHAR2(9),
"MGR" NUMBER,
"HIREDATE" DATE,
"SAL" NUMBER,
"COMM" NUMBER,
"DEPTNO" NUMBER
) ON COMMIT PRESERVE ROWS
insert into emp_session( EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
select * from emp
select * from emp_session
-- sometimes I get 14 rows, sometimes 0 rows
Thanks.
TaiTai,
To say that Apex doesn't support GTT's is not quite correct. In order to understand why it is not working for you and how they may be of use in an Apex application, you have to understand the concept of a session in Apex as opposed to a conventional database session.
In a conventional database session, as when you are connected with sqlplus then you have what is known as a dedicated session, or a synchronous connection. Temporary objects such as GTTs and packaged variables can persist across calls to the database. A session in Apex however is asynchronous by nature and a connection to the database is done through some sort of a server such as the Oracle HTTP server or the Apex Listener, which in effect maintains a pool of connections to the database and calls by your application aren't guaranteed to get the same connection for each call.
To get over this, the guys who developed Apex came up with various methods to maintain session state and global objects that are persistent within the context of an Apex session. One of these is Apex collections, which are a device for maintaining collection like (array like) data that is persistent within an Apex session. These are Apex session specific objects in that they are local to the session that creates and maintains them.
With this knowledge, you can then see why the GTT is not working for you and also how a GTT may be of use in an Apex application, provided you don't expect the data to persist across a call, as in a PL/SQL procedure. You should note though, that unless you are dealing with very large datasets, then a regular Oracle collection is preferable.
I hope this explains your issue.
Regards
Andre -
Read a text file and populate table
My email addres is [email protected]
I am new to java. My project requires me to read a text file and pick some values from the text file and populate a table in MS Access. The main fields are from the TEXT. Some of the columns to be read are:
Transaction ref.
Amount
User ref.
Date
The text file is as follows:
Receiver =
FBNINGLAXXX LT : A
FST BANK OF NIGERIA PLC
LAGOS
LAGOS
NG
NIGERIA
Transaction ref. = SPLOUK01P0008888 Related ref. = 00077003
Amount = 16675750, NGN Value/Date =
Format & Validation
Version = 0205 Checked = Minimum
Netw. Appl. = FIN Passed = Minimum
Sender to Receiver Instructions
Banking Prior. = User ref. = SPLOUK01P0008888
Warning Status =
Possible Duplicate Emission
Appl/Serv = SWIFT Interface
RP & Ft = SIfrom_SWIFT
Date/Time = 01/04/03 18:53:19
Text =
:20:SPLOUK01P0008888
:28D:1/1
:30:030401
:21:00077003
:32B:NGN16675750,00
:50H:/4072010014877
SPDC FBN East Main A/C
:57D:WEMA BANK PLC
PLOT 22 TRANS-AMADI BRANCH P.H.
PORT HARCOURT.
RIVERS STATE.
:59:/0421002101818
PROJECT MASTERS NIGERIA LTD.
C101 ELIOGBOLO VILLAGE OFF
EAST-WEST ROAD RUMUOKORO PORT HAR
COURT
:70:PM PCE-TS 03 001030226
:71A:OUR
Block 5:
{MAC:9F664844}{CHK:60EF6513E579}
Message History =
*Original (Completed)See in this case as you are dealing with Files and database. you need read the File by using the I/O Streams. if you have to select some particular values you can go Random access file.Once you have retrived values. You can go for the second part that is make a jdbc connection to database, and use simple SQL statements to populate those values into the table.
How this will give you a better picture -
Newbie - XML File - How to load data and populate tables
Hi,
I'm newbie to XML data handling.
I have a file that is provided in XML format with data from an external system.
I need to load data from that file and populate some field in one or more tables.
I have two options:
1. Load the XML file directly from OS and populate the tables directly (I'm not sure if this is possible or not)
2. Load the entire XML file from OS into a CLOB or a BLOB(?) and the select the data form the CLOB and populate my tables.
I need some guidance about what is possible and how to do it.
My preferred approach if possible is to load the data directly from OS and populate the target tables without loading into the database previously.
Thanks for the help.
Tech Info:
OS : Unix / Windows
DB Version: 11.2 or 11.1
JFforum has many examples
use search
as example see
Re: Load xml data in Oracle table
Re: Load an XML file into table(s)
Re: load a file -
Better to have temp tables or create/drop
Greetings:
This is a question more for the DBA types out there. Generally speaking, if you need a place to store temp. data from a forms application, is it better to have a temp table sitting out there all the time and just truncate it, or create/drop the table as needed? I wondering from a performance standpoint but also, which is worse as far as fragmenting my tablespaces?
Thanks
[email protected]It's better to have it sitting there. Moreover, that table would better have a column (say sesssid) that would be populated with the return of userenv('sessionid') which corresponds to audsid from sys.v_$session.
So, you may periodically run a stored proc that deletes the rows having sessid values that does
delete from temp_table where sessid
not in (select audsid from sys.v_$session).
So, you won't be deleting the data needed by the currently running sessions.
Creating and dropping temp tables gives much fragmentation and degrades performance.
null -
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. -
Global Temp Table or PL/SQL Table
I am trying to determine if this can be done only using PL/SQL table. If not, will the usage of the global temp table affects the performance.
Here is the situation,
I have a data block that is based on a stored procedure. This stored procedure will return table of records from different database tables with join conditions. Some of the fields within the table of records will not have data returned from database tables. They will be the fields displayed on the form and the data will be entered by user.
For example:
Records will look like:
Id (will be populated by procedure)
Hist_avg (will be populated by procedure)
My_avg (will be used as field on the form so that user can enter their own avg)
Cheked (will be populated by procedure)
My questions are:
1. Is this doable in form using a data block based on PL/SQL table?
2. Will users be able to manipulate (update) the data that based on the PL/SQL table in the memory as they wish and invoke the procedure to update the underlying table when clicking on a button (Update Avg)?
3. What is the advantage of using PL/SQL table and global temp table from database and form point of views?
Any info is appreciated.Hi there...
Here is the Reference...
http://asktom.oracle.com/pls/ask/f?p=4950:8:2939484874961025998::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:604830985638
Best Regards...
Muhammad Waseem Haroon -
Usage of Temp tables in SSIS 2012
Hello,
We have many SSIS packages (2008 R2) which imports data to a temp table and process it from there.
We are upgrading to SQL server 2012 and facing the issue with temp table as working table and our ssis packages fail in 2012. While investigating found that SQL Server 2012 deprecates FMTONLY option
and instead uses
sp_describe_first_result_set , which does not support using of temp tables as import table. SSIS works fine in our workstations but not in the DEV box. With SQL 2012, I can execute from my workstation, which has (11.0.2100.60) where as DEV server
has SQL Server version 11.0.3000.0
Also when I ran profile with that of the DEV box, it gives two different statements
from workstation (11.0.2100.60)
CREATE TABLE #temp (
Id varchar(255) NULL,
Name varchar(255) NULL )
go
declare @p1 int
set @p1=NULL
declare @p3 int
set @p3=229378
declare @p4 int
set @p4=294916
declare @p5 int
set @p5=NULL
exec sp_cursoropen @p1 output,N'select * from #temp',@p3 output,@p4 output,@p5 output
select @p1, @p3, @p4, @p5
go
it works fine
But with the DEV server (version 11.0.3000.0), it executes the below sql and it fails to get the meta data
CREATE TABLE #temp (
Id varchar(255) NULL,
Name varchar(255) NULL )
exec [sys].sp_describe_first_result_set N'select * from [dbo].[#temp]'
On checking the assembly difference between the versions, I could only see Microsoft.SqlServer.ManagedDTS.dll being 11.0.3000.0, which I replace by 11.0.2100.60 version. but still getting the same result.
The other different I found is with ,Net framework libraries.
Could you advise whats the assembly causing this issue between our workstation and DEV server i.e 11.0.2100.60 and 11.0.3000.0
Many thanksScripts are taken from profiler.
The error message is
The metadata could not be determined because statement 'Select * from #branchscan' uses a temp table.
I could see the work around saying use of table variable and global temp tables. We are having around 100+ ssis packages which uses temp table for loading the data from a flat file and respective SP to process the data from the temp table. above
error is thrown during the pre-execute phase of the OLE db Destination, when trying to get the meta data of the table.
At this stage, it would be difficult for us to change the logic to global temp or TVP
Thanks -
Hi.
Where can i find information abount using temp tables in Oracle?
I usually work with SQL Server and use temp tables. I don't have any idea about temp tables in Oracle. Could you give me any information?
Thanks.
I'm sorry for may english, I'm spanish.There are two completely different things being discussed here temporary segments used by Oracle's internal processes and Oracle global temporary tables.
Or did I misunderstand?
We have used Oracle's global temporary tables as quick staging array while data is being integrated into finance apps. Testing showed the process performed faster with this design.
Both temporary segments and Oracle's global temporary tables are stored in the TEMP tablespace. -
How do i insert into more than one table from temp table?
Hi,
I have three tables such as temp,stck and stol
temp table contains data as below. It has 22 columns.
STOCK STOCKDESC ALIAS1 ALIAS2 ALIAS3 ALIAS4 ALIAS5 ALIAS6 ALIAS7 ALIAS8 ALIAS9 ALIAS10 ALIAS11 ALIAS12 ALIAS13 ALIAS14 ALIAS15 ALIAS16 ALIAS17 ALIAS18 ALIAS19 ALIAS20
bmg667691031 NOWE FINANSE LTD yy zz B282DV3 TESTICKER te te1 bmg667691031BM te 707943W ex IR-PRIME IR-ALTID IR-BLOOM NT-PRIME NT-ALTID NT-BLOOM AU-PRIME AU-ALTID AU-BLOOM mm
AA0098000181 UFACEX HOLDINGS VAR RT DUE 06-30-2010 kk yy mm TESTICKER aa ff AA0098000181GB bb 031969W cc IR-PRIME IR-ALTID IR-BLOOM NT-PRIME NT-ALTID NT-BLOOM AU-PRIME AU-ALTID AU-BLOOM ba
AC1350Z7M923 CDA GOVT TREAS BILLS CDS- 08-05-2010 ee ff gg TESTICKER hh ij AC1350Z7M923CA mn 1A1MTLU op IR-PRIME IR-ALTID IR-BLOOM NT-PRIME NT-ALTID NT-BLOOM AU-PRIME AU-ALTID AU-BLOOM op
stck table contains as below.It has six columns. But always first three columns will have values.
stock_id stock_code stock_description stock_type terriory_code preferred code
1185072 AED
1185073 ARA CURRENCY ARGENTINA PESO
1185074 ATS CURRENCY AUSTRIAN SCHS
stol table contains as below. It has 6 columns.Terriory_code is always empty.
stock_code territory_code stol_type stock_id stck_code_type sys_entry_date
AED 0 1185072 0 6/22/2007 3:59:13.000 PM
ARA 0 1185073 0 6/22/2007 3:59:13.000 PM
ATS 0 1185074 0 6/22/2007 3:59:13.000 PM
Now, i want to insert into stck and stol table based on temp table records. constraints to insert into stck and stol tables are as below
In temp table first column is called stock. This stock has to compare with stck table stock_code. If it is not present in stck table, then it has to insert into stck table with stock_id and stock_description. Here, I need to generate stock_id my self in the code.
In temp table, column 3 to column 22, i have alias. Each column has to check with stol table stock_code column. For instance, column3 check with stock_code column. Then column4 check with stock_code. If stock_code is not present in stol table, then i have to insert into stol table.
I need to generate stock,id in the code. How do i perform this insertion?
Edited by: user12852882 on Jun 12, 2010 2:37 AMIt can be done using SQL (no loops required)
insert into stock_table (stock_id,stock_code,stock_description)
select stock_id,get_stock_code,stockdesc /* get_stock_code is a function providing stock_code - usually a sequence value */
from (select t.stock stock_id,t.stockdesc,s.stock_id stock_stock_id
from temp_table t,stock_table s
where t.stock = s.stock_id(+)
where s.stock_id is null;
insert into stol_table (stock_code,sys_entry_date) /* not clear where other values to be inserted will come from */
select stock_code,sysdate
from (select t.stock_code,s.stock_code stol_stock_code
from (select distinct stock_code
from (select alias1 stock_code from temp_table union all
select alias2 from temp_table union all
select alias3 from temp_table union all
select alias4 from temp_table union all
select alias5 from temp_table union all
select alias6 from temp_table union all
select alias7 from temp_table union all
select alias8 from temp_table union all
select alias9 from temp_table union all
select alias10 from temp_table union all
select alias11 from temp_table union all
select alias12 from temp_table union all
select alias13 from temp_table union all
select alias14 from temp_table union all
select alias15 from temp_table union all
select alias16 from temp_table union all
select alias17 from temp_table union all
select alias18 from temp_table union all
select alias19 from temp_table union all
select alias20 from temp_table
) /* use unpivot instead if you are 11g */
where stock_code is not null
) t,stol_table s
where t.stock_code = s.stock_code(+)
where s.stock_code is null;
and think about damorgan's post, you'll never regret it (especially when you will not just think)
Regards
Etbin
Maybe you are looking for
-
Urgent help with simple BPEL process
Hello there, I need help with BPEL project. I'm new in JDeveloper&BPEL and i'd like to create process that we'll after sending employee ID return personal details of that employee. I did create application, BPEL project and connection to the database
-
Why does safari open a new window when a search is entered
so I open safari like normal , go yahoo bookmark. then do a search thru yahoo. select it then it opens a new safari window. How do I stop this , so the selected searched item stay on current tab, rather then opening a new window
-
My MacBook displays folder with a "?" at start up. How do I address this?
MY question is in the title.
-
Hey guys... I'm back. I am still working on this site, and have worked through numerous challanges and gotten through, but I have now hit a roadblock that I cant seem to conquer... Here is the situation....I have a "main" file.... I am using the tech
-
Everybody is complaining about the maps, maybe rightfuly so. But what I would like to know is, what can we, the users, do to help? I read that Apple would be using their retail employees for this purpose but why not us, the fans, the users. Is there