Loading data from multiple tables to multiple sheets of excel using SSIS
I have a requirement in which I want to load data from 13 tables to 13 respective sheets of single excel file using SSIS.
Can anyone know SSIS logic for developing package for this?
see similar example here
http://visakhm.blogspot.in/2013/09/exporting-sqlserver-data-to-multiple.html
In your case you need to use loop to iterate through tables
First get list of tables in a object variable created in SSIS using INFORMATION_SCHEMA.TABLES view
Then add a for each loop based on ADO.NET variable enumerator to iterate through tables and inside loop follow method as in the above link to create the sheet first and populate it.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Similar Messages
-
Hi,
I have a situation where i have to load data from one server/database table to multiple servers/databases.
Example:
I need to load data from dbo.TABLE_A (on Server: Server_A & Database: Database_A) to the same table on the list of server databases like
Server: Server_B , Database: Database_B
Server: Server_C , Database: Database_C
Server: Server_D , Database: Database_D
Server: Server_E , Database: Database_E
Server: Server_F , Database: Database_F
Server: Server_G , Database: Database_G
Server: Server_H , Database: Database_H
so on and so forth on 250 such server database combinations.
The table structure is the same on all the servers.
If i make the source or destination dynamic, it throws an error while mapping ?
I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
Please suggest on how to load data from one source to multiple server/databases.
Thank you.I just need to transfer one table's data. its like i have to use a query to pick data for
the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
to append the new records. -
Select max date from a table with multiple records
I need help writing an SQL to select max date from a table with multiple records.
Here's the scenario. There are multiple SA_IDs repeated with various EFFDT (dates). I want to retrieve the most recent effective date so that the SA_ID is unique. Looks simple, but I can't figure this out. Please help.
SA_ID CHAR_TYPE_CD EFFDT CHAR_VAL
0000651005 BASE 15-AUG-07 YES
0000651005 BASE 13-NOV-09 NO
0010973671 BASE 20-MAR-08 YES
0010973671 BASE 18-JUN-10 NOHi,
Welcome to the forum!
Whenever you have a question, post a little sample data in a form that people can use to re-create the problem and test their ideas.
For example:
CREATE TABLE table_x
( sa_id NUMBER (10)
, char_type VARCHAR2 (10)
, effdt DATE
, char_val VARCHAR2 (10)
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('15-AUG-2007', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('13-NOV-2009', 'DD-MON-YYYY'), 'NO');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('20-MAR-2008', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('18-JUN-2010', 'DD-MON-YYYY'), 'NO');
COMMIT;Also, post the results that you want from that data. I'm not certain, but I think you want these results:
` SA_ID LAST_EFFD
651005 13-NOV-09
10973671 18-JUN-10That is, the latest effdt for each distinct sa_id.
Here's how to get those results:
SELECT sa_id
, MAX (effdt) AS last_effdt
FROM table_x
GROUP BY sa_id
; -
Using FDM to load data from oracle table (Integration Import Script)
Hi,
I am using Integration Import Script to load data from oracle table to worktables in FDM.
i am getting following error while running the script.
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
Attaching the full error report
ERROR:
Code............................................. -2147217887
Description...................................... Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
At line: 22
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 6260
IDENTIFICATION:
User............................................. ******
Computer Name.................................... *******
App Name......................................... FDMAPP
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... DBNAME
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... SCRTEST
Location ID...................................... 750
Location Seg..................................... 4
Category......................................... FDM ACTUAL
Category ID...................................... 13
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ True
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
I am using the following script
Function ImpScrTest(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM Integration Import Script:
'Created By: Dhananjay
'Date Created: 1/17/2012 10:29:53 AM
'Purpose:A test script to import data from Oracle EBS tables
Dim cnSS 'ADODB.Connection
Dim strSQL 'SQL string
Dim rs 'Recordset
Dim rsAppend 'tTB table append rs object
'Initialize objects
Set cnSS = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
'Connect to SQL Server database
cnss.open "Provider=OraOLEDB.Oracle.1;Data Source= +server+;Initial Catalog= +catalog+;User ID= +uid+;Password= +pass+"
'Create query string
strSQL = "Select AMOUNT,DESCRIPTION,ACCOUNT,ENTITY FROM +catalog+.TEST_TMP"
'Get data
rs.Open strSQL, cnSS
'Check for data
If rs.bof And rs.eof Then
RES.PlngActionType = 2
RES.PstrActionValue = "No Records to load!"
Exit Function
End If
'Loop through records and append to tTB table in location’s DB
If Not rs.bof And Not rs.eof Then
Do While Not rs.eof
rsAppend.AddNew
rsAppend.Fields("PartitionKey") = RES.PlngLocKey
rsAppend.Fields("CatKey") = RES.PlngCatKey
rsAppend.Fields("PeriodKey") = RES.PdtePerKey
rsAppend.Fields("DataView") = "YTD"
rsAppend.Fields("CalcAcctType") = 9
rsAppend.Fields("Amount") = rs.fields("Amount").Value
rsAppend.Fields("Desc1") = rs.fields("Description").Value
rsAppend.Fields("Account") = rs.fields("Account").Value
rsAppend.Fields("Entity") = rs.fields("Entity").Value
rsAppend.Update
rs.movenext
Loop
End If
'Records loaded
RES.PlngActionType = 6
RES.PstrActionValue = "Import successful!"
'Assign Return value
SQLIntegration = True
End Function
Please help me on this
Thanks,
Dhananjay
Edited by: DBS on Feb 9, 2012 10:21 PMHi,
I found the problem.It was because of the connection string.The format was different for oracle tables.
PFB the format
*cnss.open"Provider=OraOLEDB.Oracle.1;Data Source= servername:port/SID;Database= DB;User Id=aaaa;Password=aaaa;"*
And thanks *SH* for quick response.
So closing the thread......
Thanks,
Dhananjay -
How to Load data from a Table in BW to R3 Table .. any FM or Program if you
I want to load data from a Table in BW side to R3 side. Any FM or Program if you Know.
If it is one time activity ..Download the data into excel file on BW side..
Write an ABAP program to read the data from the excel file on local workstation and update table.. -
Loading data from Z table to an ODS in BW/BI
Hello Gurus,
Can some one guide me how do I load data from a Z table which exists in the same BI system into an ODS/DSO. I'm working on a 04S system.
Your help is highly appreciated.
Thanks & Regards,
Prashanthhi Prasanth
u r using generic extraction method to load data from R/3 to BW server
u can use
T.Code SBIW or RSO2 to create Generic DataSource.
step 1- logon to R/3 system
step2 - check data in table
for this use t.code se11.
Db table name --- ZXXXXX.
1. select " Display " button.
2. select " contents"(shftctrlf11).--->execute.
*step-3 *- create generic datasource for trasactiona data
 enter t.code- rso2
 select t.data -
zXXXXX.(specify ur datasource name to create a new one).
 select create icon.
 appl.. component --- (browse and choose ur application component)(EX- sd).
 Extration from DBView"
 table/view---zXXXXX(give ur ztable name).
 text----give sht .des, m.des, L .des.......... for u data source.
 Select generic delta option in toolbar.
 Give delta specific field
 Field name---- (ex- pid)
Select any radio button(ex-numeric pointer).
 Settings additive delta radio button( for delta loads from ods to i.cube).
 Select save save .
 Package -
some package name.
 Save
 Continiue
 Coustomize the datasource by seleting selection check boxes for fields.
 Save
 MSg:- datasource hve been created.
SAP BW side:
Step :1
Enter t.code rsa13.
 Identify R/3 source system icon.
 Double click on R/3 s . system.
 Expand BW datasource
 Expand sap Appl. Comp..
 Select ur application component( for Ex- SD).
 Context menu -- replicate datasource
 Refresh tree once the replication is complete.
 Find ur datasource.
 Double click on data source icon { this implies data source is not assigned).
 Context menu
 Assign infosource..
 i.source assignment:
o select others radio button
o and select optioncreate.
 Flexible update.-------XXXXX
 Des----XXXXXX
 Continue
 Create I.Obj w .r t r/3 s.s fields.
 Assign the I.Obj to the fields of r/3 respectively.
 Enter 0RECORDMODE in comm.. structure.
 Activate
 create ODS obj and create structure and activate
 create update rules for Ods object with reference to i.source. and activate.
 Create infopackage and schedule data .and monitor the data in psa and ods objects tables. -
Hi ,
How to load data from external table to transaction table using SQLLDR ?You use an external table to load the data it is described in the link to the manual I provided.
Here is an example.
Re: Using DML order to import a .xls file
You would not be using SQLLDR though as external tables replace that functionality. -
How can i extract data from oracle table to flat file or excel spread shee
Hello,
DB Version is 10.1.0.3.0
How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
Regards,
DHere what I did
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF
Sql> SPOOL bing
select * from -------;
SPOOL OFF;
I do not see file.
I also tried
Sql> SPOOL /tmp/bing
select * from -------;
SPOOL OFF;
But still not seeing the fie, -
Deleting data from another table with multiple conditions
Hi frnds
I need to delete some data from a table based on multiple condition I tried following sql but its deleteing some rows which is not meeting the criteria which is really dangerours. When i trying = operator it returns ORa- 01427 single -row subquery returns more than one row
delete from GL_TXNS
where TRN_DT in (Select trn_Dt from GL_MAT)
and BR in (select ac_branch from GL_MAT)
and CODE in (select CODE T from GL_MAT)
and (lcy_amt in (select lcy_amt from GL_MAT) or
fcy_amt in(select fcy_amt from GL_MAT)
rgds
ramyaMy answer is the same as Avinash's but I will explain a little bit more.
ORa- 01427 single -row subquery returns more than one rowmeans that you have a subquery that Oracle is expecting one value from that is returning multiple values. In your case you need one value for the equijoin ("=") and you are getting more than one value back. The error happens even if all the values are the same - multiple values being returned will cause the error.
The solution is to either allow multiple values to be returned (say, use the IN condition istead of "=") or only return one value if possible (say, forcing one value by using DISTINCT, GROUP BY, or a WHERE clause condition of ROWNUM=1) - but these workarounds must be checked carefully to make sure they work correctkly -
Loading data from one table to another table
I need to load the data (data conversion) from one table to 3 different table.
I have to load the data from Source table to following 3 target tables.
So Consumer table has email pk and it has relationship with CONSUMER_RCV table and CONSUMER_RCV
table has relationship with CONSUMER_ATTR table. I am doing right now with pl/sql but I am looking
to use MULTI INSERT or SQL*LOADER or another efficient way.
I tried with MultiInsert but it getting failed as it's violating Unique Constraints as source table might contains
Duplicate emails.
Could you please show me how I can load the data efficiently?
Also I need to load in CONSUMER_ATTR table from CONTACT table which has ATTR1, ATTR2 columns.
so My mapping will be ...
Contact.email, first_name, last_name will go into Consumer table
then in CONSUMER_RCV, I generate the id column value by sequence, load email and DATE_CREATEd from contact table
And rest of the value is hard coded
Then in CONSUMER_ATTR table I will generate the CONSUMER_ATTR_id through sequence, for ID, will use the same
id column value which I have generated by sequence in CONSUMER_RCV, then put the attr_type = 'ATTR1' and for
attr_value column I will insert the value from contact table's ATTR1 value,
Then generate another CONSUMER_ATTR_ID, will use the same id column value which I have generated by sequence
in CONSUMER_RCV, then put the attr_type = 'ATTR2' and for
attr_value column I will insert the value from contact table's ATTR2 value,
Please let me know if you need further explanation.
I am using Oracle 9i R2.
Please consider CONTACT is Source table, CONSUMER is a Target1, CONSUMER_RCV is a Target2 and CONSUMER_ATTR is a Target3
to simplify the problem.
Following is the Table structure
=========================
CREATE TABLE CONTACT (
ID VARCHAR2 (40) NOT NULL, -- will go into Target1
EMAIL VARCHAR2 (100) , -- might be duplicate and will go into Target1 and Target2
FIRST_NAME VARCHAR2 (100) NOT NULL, -- will go into Target1
LAST_NAME VARCHAR2 (100) NOT NULL, -- will go into Target1
COUNTRY VARCHAR2 (40) NOT NULL, -- will go into Target1
PHONE VARCHAR2 (100), -- will go into Target1
NOTIFY VARCHAR2 (3), -- will go into Target2 table's RECEIVE_EMAIL column
CREATE_DATE DATE , -- will go into Target1 and target2
ATTR1 VARCHAR2 (400), -- will go into Target3 as attr_type= ATTR1 and will load actual value in ATTR_VALUE
ATTR2 VARCHAR2(100), -- will go into Target3 as attr_type= ATTR2 and will load actual value in ATTR_VALUE
ATTR2 VARCHAR2(100), -- will go into Target3 as attr_type= ATTR1 and will load actual value in ATTR_VALUE
CONSTRAINT CONTACT_PK
PRIMARY KEY ( USER_ID ) ) ;
CREATE TABLE CONSUMER(
EMAIL VARCHAR2 (100) NOT NULL, -- PK
TITLE VARCHAR2 (40),
FIRST_NAME VARCHAR2 (40),
LAST_NAME VARCHAR2 (40),
ADDRESS1 VARCHAR2 (40),
ADDRESS2 VARCHAR2 (40),
CITY VARCHAR2 (30),
STATE VARCHAR2 (30),
ZIP VARCHAR2 (10),
COUNTRY VARCHAR2 (40),
PHONE VARCHAR2 (15),
DATE_CREATED DATE NOT NULL,
CONSTRAINT CONSUMER_PK
PRIMARY KEY ( EMAIL ) ) ;
CREATE TABLE CONSUMER_RCV (
ID VARCHAR2 (40) NOT NULL,-- PK
EMAIL VARCHAR2 (100) NOT NULL,-- FK reference to Consumer
SITE VARCHAR2 (100) NOT NULL, -- default website
RECEIVE_EMAIL VARCHAR2 (1),
CREATE_DATE DATE NOT NULL,
CONSTRAINT CONSUMER_RCV_PK
PRIMARY KEY (ID) ) ;
ALTER TABLE CONSUMER_RCV ADD CONSTRAINT CONSUMER_RCV_FK
FOREIGN KEY (EMAIL)
REFERENCES CONSUMER (EMAIL) ;
CREATE TABLE CONSUMER_ATTR (
CONSUMER_ATTR_ID VARCHAR2 (40) NOT NULL, -- PK
ID VARCHAR2 (40) NOT NULL, -- FK reference to COnsumer_RCV
ATTR_TYPE VARCHAR2 (100) NOT NULL,
ATTR_VALUE VARCHAR2 (4000) NOT NULL,
CONSTRAINT CONSUMER_ATTR_PK
PRIMARY KEY ( CONSUMER_ATTR_ID ) ) ;
ALTER TABLE CONSUMER_ATTR ADD CONSTRAINT CONSUMER_ATTR_FK
FOREIGN KEY (CONSUMER_ATTR_ID)
REFERENCES CONSUMER_RCV (ID) ;HI Hema,
How are the entries related.. is it like for one entry in y table there are more than one entry in x table then you have to use loop with in loop , here are the both the conditions.
1) For each entry in Y there are more than one entries in X
sort y by quota trpid.
sort x by quota trpid.
loop at y.
loop at x where quota eq y-quota
and trpid eq y-trpid.
z-value = x-value.
append z.
endloop.
endloop.
2) For each y there is one entry in x table.
sort y by quota trpid.
sort x by quota trpid.
loop at y.
read table x with key quota = y-quota
trpid = y-trpid binary search.
if sy-subrc eq 0.
z-value = x-value.
append z.
Endif.
endloop.
Mahesh -
Loading data from one table to another using cursor
Hi,
I have given the below command to load the data from 1 table to another using cursor.
declare
cursor mycursor IS
SELECT extract_name,from_date,to_date,BETA from temp_table where EXTRACT_NAME='GIFTCARD_DETAILS';
Begin
for mycursor_1 IN mycursor loop
insert into tmp_tab columns(col1,col2,col3,col5) values(mycursor_1.EXTRACT_NAME,mycursor_1.from_date,mycursor_1.to_date,mycursor_1.BETA);
End loop;
commit;
end;
It is working fine.
But I want to hard code some of the columns ( like flags ) which are not there in 1st table and load them into 2nd table.
In db2 we will give commands like
varSqlStatus=`db2 "declare mycurs cursor for select extract_name,from_date,to_date,BETA,'N','Y' from temp_table"`
varSqlStatus=`db2 "load from mycurs of cursor modified by identityignore insert into tmp_tab(col1,col2,col3,col5,col6,col7) nonrecoverable"`
But I want it in oracle 10g, Can any one help me in this.Have you tried either of the two options :
1. Modify the CURSOR itself :
cursor mycursor IS
SELECT extract_name,from_date,to_date,BETA,'N','Y' from temp_table where EXTRACT_NAME='GIFTCARD_DETAILS';2. Modify the INSERT statement itself :
insert into tmp_tab columns(col1,col2,col3,col5,col6,col7) values(mycursor_1.EXTRACT_NAME,mycursor_1.from_date,mycursor_1.to_date,mycursor_1.BETA,'N','Y'); -
How to load data from oracle table to XML using ODI ?
Hello Team
I am trying to load data from an oracle table to an xml file. I have configured the physical and the logical schemas for the same. I have used SQL to SQL as LKM and SQL to SQL Append as IKM with Sunopsis Memory Engine as staging area.
After this, when I am executing the interface, it is executed without any errors but to my surprise I am not finding the relevant data in the xml file. What could be the reason ?
Please look into this and lemme know how to solve it.
Thanks.908458 wrote:
Hello Phanikanth
Even IKM SQL Control Append is not solving the problem. There are many " order columns" in the target xml table. I have not mapped them or specified any order. Does the problem persist because of this ?
Thanks
Manoj
Ocle to XML file loading issue in ODI 10.1.3.5 -
how can i load data from a oracle table to a text file or CSV file using PL/SQL procedures where the pls/sql code will take the table name dynamically.........
soumenTry this thread..
Is it possible to export a pl/sql region as a csv file? -
How to load data from one Infocube to another request by request using DTP
Hi All,
I have a scenario where we are maintaining backup Infocube B for Infocube A. User loads data from a flat file many times a day in different requests. We need to maintain backup of the Infocube A on weekly basis. i.e data to be refreshed with delta update from cube A to cube B. There are some situations where user deletes some of the requests in Infocube A randomly after use. Will this change effect in back up cube B when performed data refresh from cube A to cube B. i.e. this functionality is similar to reconstruct in BW 3.5. Now we are running on BI 7.0 SP 9.
Can anyone answer this ASAP.
Many Thanks,
RaviYou cannot load request by request, " Get Data By Request " DTP loads request by request on " First In First Out " basis. You can run some Pseudo/Fake DTP's if you dont want to load data from a particular request.
If the user deletes a request from Cube A, it wont be loaded to Cube B but if it is already loaded in Cube B and later the user deletes the request from Cube A you have to delete the request frm Cube B. Inorder to monitor request by request run DTP with " Get Data By Request set. -
How to load data from PSA to CUBE & DSO at a time using DTP in BI 7 ?
HI all,
I am new to BI 7 . How to load the data at same time to DSO & INFO CUBE using DTP.
Please provide me steps to load & plz specify which update mode I have to use ( FULL OR DELTA ) which one is best.
Plz Suggest me.
Thanks & Regards,
Kiran m.
Message was edited by:
kiran manyamBelow are the basic steps which we follow in any BI 2004S system:
1)Create datasource. Here u can set/check the Soucre System fields.
2)Create Transformation for that datasource. (no more update rules/transfer rules)
2.1) While creating transformation for DS it will ask you for data target name, so just assign where u want to update ur data.
DataSource -> Transformation -> Data Target
Now if you want to load data into data target from Source System Datasource:
1) Create infopackage for that data source. If you are creating infopackage for new datasources, it will only allow you update upto PSA, all other options u can see as disabled.
2)Now Create DTP (Data Transfer Process) for that data source.
3) NOw schdule the Infopackage, once the data is loaded to PSA, you can execute your DTP which will load data to data target.
If you are loading data from one one data target to other, no need to use PSA, you can directly execute DTP in that case.
Data Source -> Transformation (IP/DTP) -> Data Target1 -> DTP ->Data Target 2
Use the below link for detailed example:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fc61e12d-0a01-0010-2883-e2fc63ef729b
Infosources are no more mandatory with BI 7.0, below is the link to scenarios where we use infosources:
http://help.sap.com/saphelp_nw04s/helpdata/en/44/0243dd8ae1603ae10000000a1553f6/content.htm
Full or delta depends on your requirement...
chk the below thread to know better
difference between the various loads
hope it helps
Message was edited by:
sriram viswanathan
Maybe you are looking for
-
Windows 7 Home Premium crashes at classpnp.sys when I try to boot in any of the safe mode options. The normal Windows boot stops at the windows logo screen, and just stays there permanently. I have tried booting using the Windows install disk to acce
-
File Paths on windows and unix
Hi I believe I read that when specifiying file paths in java, this is one aspect which is not platform independent. So if you develop something on windows which uses file paths if you wish to run it on unix you will need to change the syntax pertaini
-
Book printing - Unique Workflows? - Cross-Posted from Aperture forum
(Cross-posted. I think this post might be of interest to iPhoto users as well) I am exploring the book printing features in Aperture. My goal was to build the book in Aperture and get this into iPhoto so that I could use MyPublisher to print the book
-
SQL SERVER 2000 / 2005 ( Certificate Version )
How to find out version of certificate in sql server 2000/2005... I am working as a client plz provide me any solution like t'sql script ........... regards ravendraindia
-
Dear all I have a Query regarding Stock Posting MB1C when i am Trying To post the Stock With 561 movement type its asking for Reason For Movement How to remove this or Hide this With Out Asking Please help me with Regards Pushpalas