Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql
Hello All,
I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
Table Name OracleRowsCount SqlRowCount Diff
Customer 150 150
0
Sales 2000 1998
2
Devisions 5 5
0
(I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
What the simplest way to do it ?
Thank you
Best Regards
Daniel
Hi Daniel,
According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
package by querying this table.
Regards,
Mike Yin
TechNet Community Support
Similar Messages
-
Urgent Need for creating 100 tables in Oracle.
Hello All,
I need to create 100 tables in oracle using a loop.
Please suggest . Advance thanks for your efforts.
ANtoI am getting the foll error at run time when executing the procedure ..
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "ORAUSER.CREATE_100_TABLE", line 9
ORA-06512: at line 1
The script goes here ...
create or replace procedure create_100_table
is
v_sql_string varchar2(200);
begin
for i in 1..100
loop
v_sql_string := 'create table ajames' || i || ' as select * from emp';
execute immediate v_sql_string;
end loop;
end;
------------------------ -
Create a table from another table
I have Windows XP with 10g 10.2.0.1.0
I need to create a table from another table to re-arrange the table column order and add the following statement at the end of creation.
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
Below iis my SQL statement, but it doesn't work. Please help.
create table my_table as (select t1, t5, t2, t3, t4 from orig_table
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
*);*Kee Kee wrote:
I have Windows XP with 10g 10.2.0.1.0
I need to create a table from another table to re-arrange the table column order Why? Column order has no meaning. The individual SELECT statement specifies the column order that particular statement wants, which may be different from the needs of some other SELECT statement.
and add the following statement at the end of creation.
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA"
Below iis my SQL statement, but it doesn't work. Please help.
create table my_table as (select t1, t5, t2, t3, t4 from orig_table
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "TAB_DATA" -
Create and insert into table from Oracle to MS SQL server.
Hello,
Oracle Database 11g and Red hat 5
I have a very different kind of issue. I am handling the ORACLE db(remote db with all the important data). On the other side their is a MS SQL server db(local db with some testing data in it). All the users will access the ORACLE db for the actual processing but for sometime they need to apply some of their own concepts. So they will transfer the data from ORACLE to MS sql server.
I want to create a code in ORACLE db like a procedure , which will create a table in MS sql server , insert data into it,Also create some metadata table to keep some of my table's info on MS SQL serve db,If the table is present it should append the data, .... like many things ...
Overall my question is , how can i write a code to make these operation on a remote db, that to these operations are DDL and on MS SQL Server(Non-Oracle) ???
Please guide me with some ideas or solutions ...
Also provide if you have some good links to study ...
thanks in advance.I'm not sure why you never visit http://tahiti.oracle.com prior to asking any question. Is it forbidden in your locale? Are you afraid of it? Will your salary be decreased when you visit the documentation?
http://www.oracle.com/pls/db111/search?word=sql+server&partno=
should provide sufficient information.
Your doc question must be considered a violation of Forum Etiquette and an abuse of this forum.
Sybrand Bakker
Senior Oracle DBA -
Moving table from oracle 10g to sql server 2005 plz help!!!
Hi All,
I have a table in oracle that i have to move to sql server.
I have exported the table and the dmp file is around 150 MB.
I do not know how to import this file into sql server.
Can some one kindly update me as to which is the best way to do this,
i know the best people to answer this would be the sql server techs but just wanted to try my luck on OTN.
regards,Hello,
you could use the Database Gateway for MS SQL Server, create a database link that uses the gateway, and then transfer the data from Oracle to SQL Server using in SQLPlus a command like the following:
copy from scott/tiger@ora102 -
insert TEST1@dg4msql -
using select * from test1@ora102 ;
Another solution is using a PL/SQL block, and how to do it is described in the following note in My Oracle Support:
"Insert Into Remote Table Select * From Local Table" Gives Error ORA-02025 Using DG4MSQL (Doc ID 790572.1)
I don't know whether it is the "best way to do it", but it is an alternative.
For inserting a flat file into SQL Server you really need to check with Microsoft. Or you can use 3rd party software: http://www.dbload.com/
Best regards
Wolfgang -
Replication of table from Oracle 10g to sql server 2000
Could i replicate table from Oracle 10g to sql server online. we have tables with same configuration and if any change happen in oracle 10g or sql server in that table we need to replicate that change to other database.
What is the solution for this two way replication between sql server and Oracle 10gBut the tutorial is saying that i will have to install Oracle database on the server already having sql server, is it client or whole database, if it is then it will acquire lot of resource.
I want to find out that for Heterogenous Service ODBC, we need third party software for ODBC Driver of SQL SERVER for Linux and secondly if we use Transparent Gateway then what are the steps for its configuration.
I could not find steps of configuration of Transoparent gateway, when i am trying to install Transparent gateway from Universal installer, it is not there. where do i find it , Do i need to purchase it too. -
SSMA for migrating table from oracle to Sql server
Hi All,
I wanted to replicate oracle huge table to sql server and i am using SSMA.its helpful and fast but can we replicate the table to different name using SSMA.for example i have a table TEST and i wanted to replicate it to SQL_TEST.Can it be possible
using SSMA.
Kindly help me outHi All,
I wanted to replicate oracle huge table to sql server and i am using SSMA.its helpful and fast but can we replicate the table to different name using SSMA.for example i have a table TEST and i wanted to replicate it to SQL_TEST.Can it be possible
using SSMA.
Kindly help me out
Hello,
Same question has already been asked by you in below thead. Why you created duplicate thread ? please avoid this practice or your thread will be marked ass Spam
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/abcdfb1b-c617-453f-828d-c8e4ec266c78/ssma-for-migrating-table-from-oracle-to-sql-server?forum=sqlintegrationservices
Moderators plz merge this thread.
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
hi
i need to create a table emp( eno, ename, salary, address, doj, dob(dd-mm-yyyy), phone, city)
which datatype suits for the dob column. as we need to enter in the format as 'dd-mm-yyyy'.
please help.Hi,
1009262 wrote:
hi
i need to create a table emp( eno, ename, salary, address, doj, dob(dd-mm-yyyy), phone, city)
which datatype suits for the dob column. as we need to enter in the format as 'dd-mm-yyyy'.The DATE datatype is best for anything that indicates a point in time. Which format you want has nothing to do with the data type; DATEs can be entered or displayed in virtually any format you wish. I've said it, and the 2 earlier replies said it, but this is important enough to repeat: Always use the DATE datatype for information about dates.
The only exception is when fractions of a second are significant, or when you need to capture time zone information along with the date. In that case, use the TIMESTAMP data type, but DATEs are a lot easier to use, and there are many more useful built-in functions for manipulating DATEs, so use DATEs whenever possible. For date-of-birth, you probably don't want to record hours, minutes or seconds, let alone fractions of a second, so there's no reason to use a TIMESTAMP, and there is never any reason to use any other datatype, such as VARCHAR2 or NUMBER. -
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 helpNO, 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; -
How to create a table from an existing table with new column
Hi !
Please help me.
I want to create a table from an existing table with data and add two new column to the new table.
What will be the syntax?craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
if you want to have VARCHAR2 instead of CHAR for example:
SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
Table created.
SQL> desc new_dept
Name Null? Type
DEPTNO NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
NEW_COL CHAR(8)
SQL> alter table new_dept modify (new_col varchar2(8));
Table altered.
SQL> desc new_dept
Name Null? Type
DEPTNO NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
NEW_COL VARCHAR2(8)Rgds.
Didn't see michael's post - it reflects the fix for this problem using CAST.
Message was edited by:
dnikiforov -
Using execute immediate creating a table from another
hi friend i wanted to create a table from a select statement in a pl sql procedure. i am using execute immediate but getting problems with it pls can anyone help me.
here is the query i am using
EXECUTE IMMEDIATE 'CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE '%some_string%');
i need to know if this can be done and if yes how. pls help me its bit urgent too. the schema name is same and the privileges are available to create tables too.Your syntax is wrong.
If you would use a syntax higlighted editor, it would show.
Yout try to execute a string where another string is embedded. Please use two times single quote or use the 'q' function:
This one is correct:
EXECUTE IMMEDIATE 'CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE ''%some_string%'')';
or this one:
EXECUTE IMMEDIATE q'|CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE '%some_string%')|';
good luck -
I am trying to create a table from the results of a query. With other products, I could issue the following SQL statement to achieve my goal but this doesn't work with Oracle.
select MyTable.* into NewTable from MyTable where MAPID < 1000
What am I missing?Try this way :
create table NewTable as
select * from MyTable where MAPID < 1000; -
How to create a table in Oracle Lite database?
Hi,
I have installed SOA 10.1.3 on my laptop. Now I am trying to create a table in the database to do some own examples. I have problem in installing oracle database. So I am trying to create a table in Oracle Lite database which comes with SOA suite. I am not able to do it, can some body suggest me please?
Regards
KhaleelHI James,
Thank you so much. I am able to create table and insert rows and able to select them too. However I am not able to use these tables in my BPEL process for my practice. The DB adapter is throwing some error, any idea?
--khaleel -
Error in creating partition table in oracle spatial by ankur
Hi,
Am working on Oracle 10.2.0.3
Am not able to create partition table in Oracle
i have all the required columns in node and edge table ......the moment i try to create partition table using exec sdo_router_partition.partion_router i get the following error:
ERROR at line 1:
ORA-00947: not enough values
ORA-06512: at "MDSYS.SDO_ROUTER_PARTITION", line 1510
ORA-06512: at "MDSYS.SDO_ROUTER_PARTITION", line 661
ORA-06512: at line 1
Can someone help ??hey i have found the solution myself :)
-
Create one tables from 2 different tables
Hi,
How I can create one table from 2 different tables. Source tables have data and I want to include it in new table.
I try this:
create table NEW_ONE
select * from OLD_ONE
union
select * from OLD_ONE2;
But it didn't work correctly :/I don't have any error. This syntax create table NEW_ONE, but this table have columns only from OLD_ONE table :/ There aren't any column from OLD_ONE2 :/ Any suggestions?
I don't forget about "as" in my query, only in this post.
Edited by: tutus on Sep 8, 2008 6:36 AM
Maybe you are looking for
-
Here is an install log: checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... ye
-
hey! it hasn't been a month since i got it, but i have a huge problem with my N79. when i type an SMS, it hangs after typing a few characters and all i could do is restart the phone. but once i do restart it and start typing another SMS, it hangs aga
-
Hi, What are all the tables from which the data would be taken to display in header and item data in process PO ? From where these data would be taken ? Thanks alot. Regards, Sunayana N
-
will not stay awake. as soon as it powers up it goes to sleep.
-
ABAP development in a non-unicode system
Does anyone have a "list of abap development considerations" when developing ABAP in a 4.6C system to also be sensitive to an upcoming UNICODE conversion project, that is, What do I need to be sensitive to concerning unicode when developing in a non-