CLR Integration And Complex Column Processing

Oct 18, 2007

Hi,

I have to implement a complex algorithm that processes each row and each column.I have bunch complex steps at the end of which a table gets populated with the processed columns.

My question is whether it is possible and feasible to do this kind of processing using CLR integration or should I stick to T-SQL ?

One of the steps of processing involved per column is as follows:-
1)For each column,find successive invalid values from the start of the column.Invalid value= any value <0
2)find the invalid value depth of each column(no of successive invalid values from start)
3)If after these invalid vlaues,there is a valid value and another invalid value,replace current invalid value with valid value.
ie replace invalid value only if it has a valid value above it.
4)find the column with maximum invalue value depth and delete that many rows from the table.

Here's an example:-
Suppose there are 2 columsn colA and ColB.The columns have different datatypes eg decimal,int,string etc.
For simplicity colA and colB are ints.
RowID is keeping track of the row number.

suppose colA has the following data

RowID ColA
-----------
1 0
2 -5
3 -3
4 1
5 4
6 -9
7 5
8 8

Step1)successive invalid values from start=0,-5,-3
Step2)Invalid value depth=3(because there are 3 rows from step 1)
Step3)0,-5,-3 do not have any valid value above them.But -9 has a valid value 4 above it.So replace -9 with 4.

so colA after the algo will look as follows
RowID ColA
------------
1 0
2 -5
3 -3
4 1
5 4
6 4(replaced -9 with 4)
7 5
8 8

Now do the next column colB
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 -5
8 -8

Step1)successive invalid values from start=-6,0,0,-7
Step2)depth of invalid values=4
Step3)Next invalid value -5 occurs at RowID 7
and has a valid value 8 above it.
Replace -5 with previous valid vlaue ie 8.

RowID 8 has invalid value -8 .Its previous invalid value(-5) got replaced by a valid value 8.So replace RowID8 also with value of RowID 7 ie 8

Output at the end of these steps
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 8(replaced -5 with 8)
8 8(replaced -8 with 8)

Step4:Get the maximum invalid value depth
In this case ColB had depth=4 which is greater than ColA which had dept=3.
So delete 4 rows from the beginning of the table
So the output will be

RowID colA colB
----------------------------------------
5 4 4
6 4(replaced -9 with 4) 8
7 5 8 (replaced -5 with 8)
8 8 8(replaced -8 with 8)

Thanks in advance for your help

coolaqua

View 1 Replies


ADVERTISEMENT

Complex Column Processing Question

Oct 19, 2007


Hi,

I have to implement a complex algorithm that processes each row and each column.I have bunch complex steps at the end of which a table gets populated with the processed columns.


How do I do this using CLR integration?

One of the steps of processing involved per column is as follows:-
1)For each column,find successive invalid values from the start of the column.Invalid value= any value <0
2)find the invalid value depth of each column(no of successive invalid values from start)
3)If after these invalid vlaues,there is a valid value and another invalid value,replace current invalid value with valid value.
ie replace invalid value only if it has a valid value above it.
4)find the column with maximum invalue value depth and delete that many rows from the table.

Here's am example:-
Suppose there are 2 columsn colA and ColB.The columns have different datatypes eg decimal,int,string etc.
For simplicity colA and colB are ints.
RowID is keeping track of the row number.

suppose colA has the following data

RowID ColA
-----------
1 0
2 -5
3 -3
4 1
5 4
6 -9
7 5
8 8

Step1)successive invalid values from start=0,-5,-3
Step2)Invalid value depth=3(because there are 3 rows from step 1)
Step3)0,-5,-3 do not have any valid value above them.But -9 has a valid value 4 above it.So replace -9 with 4.

so colA after the algo will look as follows
RowID ColA
------------
1 0
2 -5
3 -3
4 1
5 4
6 4(replaced -9 with 4)
7 5
8 8

Now do the next column colB
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 -5
8 -8

Step1)successive invalid values from start=-6,0,0,-7
Step2)depth of invalid values=4
Step3)Next invalid value -5 occurs at RowID 7
and has a valid value 8 above it.
Replace -5 with previous valid vlaue ie 8.

RowID 8 has invalid value -8 .Its previous invalid value(-5) got replaced by a valid value 8.So replace RowID8 also with value of RowID 7 ie 8

Output at the end of these steps
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 8(replaced -5 with 8)
8 8(replaced -8 with 8)

Step4:Get the maximum invalid value depth
In this case ColB had depth=4 which is greater than ColA which had dept=3.so delete 4 rows from the beginning of the table
So the table will be

RowID colA colB
----------------------------------------
5 4 4
6 4(replaced -9 with 4) 8
7 5 8 (replaced -5 with 8)
8 8 8(replaced -8 with 8)

Thanks in advance for your help

coolaqua


View 1 Replies View Related

Really Challenging Complex Column Level Processing Question

Oct 19, 2007

Hi,

I have to implement a complex algorithm that processes each row and each column.I have bunch complex steps at the end of which a table gets populated with the processed columns.


My question is as to what is the best way to do this?CLR integration or T-SQL?
Also I would appreciate any ideas as to how to go about using either approaches.

One of the steps of processing involved per column is as follows:-
1)For each column,find successive invalid values from the start of the column.Invalid value= any value <0
2)find the invalid value depth of each column(no of successive invalid values from start)
3)If after these invalid vlaues,there is a valid value and another invalid value,replace current invalid value with valid value.
ie replace invalid value only if it has a valid value above it.
4)find the column with maximum invalue value depth and delete that many rows from the table.

Here's am example:-
Suppose there are 2 columsn colA and ColB.The columns have different datatypes eg decimal,int,string etc.
For simplicity colA and colB are ints.
RowID is keeping track of the row number.

suppose colA has the following data

RowID ColA
-----------
1 0
2 -5
3 -3
4 1
5 4
6 -9
7 5
8 8

Step1)successive invalid values from start=0,-5,-3
Step2)Invalid value depth=3(because there are 3 rows from step 1)
Step3)0,-5,-3 do not have any valid value above them.But -9 has a valid value 4 above it.So replace -9 with 4.

so colA after the algo will look as follows
RowID ColA
------------
1 0
2 -5
3 -3
4 1
5 4
6 4(replaced -9 with 4)
7 5
8 8

Now do the next column colB
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 -5
8 -8

Step1)successive invalid values from start=-6,0,0,-7
Step2)depth of invalid values=4
Step3)Next invalid value -5 occurs at RowID 7
and has a valid value 8 above it.
Replace -5 with previous valid vlaue ie 8.

RowID 8 has invalid value -8 .Its previous invalid value(-5) got replaced by a valid value 8.So replace RowID8 also with value of RowID 7 ie 8

Output at the end of these steps
RowID ColA
------------
1 -6
2 0
3 0
4 -7
5 4
6 8
7 8(replaced -5 with 8)
8 8(replaced -8 with 8)

Step4:Get the maximum invalid value depth
In this case ColB had depth=4 which is greater than ColA which had dept=3.so delete 4 rows from the beginning of the table
So the table will be

RowID colA colB
----------------------------------------
5 4 4
6 4(replaced -9 with 4) 8
7 5 8 (replaced -5 with 8)
8 8 8(replaced -8 with 8)

Thanks in advance for your help

coolaqua


View 8 Replies View Related

Integration Services :: SSIS Flat File Processing And Creation

Nov 30, 2015

I am facing one process related issue.

I have one task in which i have to collect lots of .txt file having ## delimiter my requirement is to convert the delimiter from ## to comma and save the new file with .dat extension in different folder.

I have done all required process and run the application which should flow like collect source .txt file do Script component processing and create new .dat file with processed data in Data Flow task, but in my Task the Source and Destination start on same time and process start after words which cause empty file or some time a.txt file data stored in b.dat file where as a.dat file is completely empty.

The process should flow in sequence but behavior is totally against the process, i am using Foreach Loop Container for pick up each file.

View 6 Replies View Related

Integration Services :: Passing Complex Type As A Variable In Web Service Task

Oct 5, 2011

When you pass a complex type (the one represented by class) to a web service the BIDS UI allows you to enter values for every field of that type as constants. But what if you want to pass a variable? Once again the UI allows you to specify a variable for that complex type parameter. But how to make this variable in SSIS?I understand it should have the type of Object. But how to specify what the runtime type of this object is? And how to assign all fields to that object?

View 6 Replies View Related

Integration Services :: Processing COBOL Copy Book And File With SSIS?

Nov 19, 2015

Is there a easier way to handle cobol book and file in SSIS ? 

I have a file that has records with in one line and they are recurring.  I am not sure how to explain but below is a sample format.

Header 
Account
Department

Header record1
Record 1 
record 2 
record 2 
Record 1 
record 2 
record 3

Header record2
Record 1 
record 2 
record 2 
Record 1 
record 2 
record 3

View 9 Replies View Related

Integration Services :: Add New Column Based On Existing Column Using Derived Column Task?

Jul 28, 2015

I have a excel file which has a column called "Code" and their values are A,B,C,D,E,F,G,H.  I want to create a new column called "status" based on the values of "Code".

Code:

A
B
C
D
E
F
G
H

If A,C,E,G then "status" = "Active" else if  B,D,F,H then "Status" = "Inactive". I like to do it using "Derived Column".

View 4 Replies View Related

Row Vs Column Processing Help!!

Jun 15, 2005

Hello friends,
I needed a suggestion, I am currently working on a reporting website that generates reports and i need to store all the reports in the database.

I usually go by row wise processing as it can be easily controlled but the problem is there will be a lot of reports, that is an estimation of 30,000 rows in a month and i m not sure if sql server can hold more than 2 billion rows per table.

Please Help!!

View 2 Replies View Related

It's A Computed Column Processing Bug?

Sep 25, 2007



Hello everybody!

I have question about indexed and not indexed Persisted columns on sql server 2005. It's a bug?

First?, my version of SQL Server is
Microsoft SQL Server 2005 - 9.00.3186.00 (Intel X86) Aug 11 2007 03:13:58 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)


Now I create two tables and try four select queries:


Code Snippet
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET NUMERIC_ROUNDABORT OFF
SET QUOTED_IDENTIFIER ON
GO
create table t1 (id int primary key, id_bigint as cast(id as bigint))
GO
create table t2 (id int primary key, id_bigint as cast(id as bigint) persisted)
GO
select * from t1 -- (1)
-- Clustered index scan with two times Compute Scalar
GO
select * from t2 -- (2)
-- Clustered index scan with one times Compute Scalar
GO
create index IX_t2 on t2 (id_bigint)
GO
select * from t2 -- (3)
-- Index Scan with one times Compute Scalar
GO
select * from t2 where id_bigint = 0 -- (4)
-- Index Seek with one times Compute Scalar
GO
drop table t1
GO
drop table t2
GO
SET ANSI_PADDING OFF



1. I don't understand why access to computed column raise scalar computation wto times?
2. I don't understand why access to persisted computed column raise any scalar computation?
3. I don't understand why access to persisted computed column over index required any scalar computations?

Can anyone from Microsoft SQL Server Team told me about this mistake?
It's a BUG or I incorrect understand value of the "PERSISTED" word?


--
Thanks with avanced.
WBR, Roman S. Golubin
grominc[at]gmail.com

View 3 Replies View Related

Derived Column Not Processing Any Records

Apr 11, 2007

Hi,



I have built a package in which i use a derived column to create a new set of columns and then pass the same to another target transformation.

The issue now what I am facing is, the re are certain number of records coming from source(16 rows) and gets processed before the Derived Column transformation, but after that, no records gets processed after the derived column transformation.

The package status shows as Success, but there is no records being written in the target table.



Any idea what could be the issue here?



Thanks,

Manish

View 7 Replies View Related

Getting Column Name When Processing Error Ouput

Nov 10, 2006

I am working on a SSIS package. I want error records to be redirected to a different table. Natively, the package passes the Error Code and Column Code (don't know what to call it, but it's a number). I found a script to get the error description, but can't find an equivalent to get the Column name.

Any ideas?



Row.ErrorDescription = _

Me.ComponentMetaData.GetErrorDescription(Row.ErrorCode)

View 3 Replies View Related

Analysis Services 2005 Database Processing Fails When Run From Integration Services

Oct 11, 2007

Hello, I have a problem when trying to fully process an SSAS database using Integration Services "Analysis Services Processing Task" task. I have 2 of these tasks which are responsible for processing the Dimensions then the Cubes. When I run the package either via the BIDS environment or on the local server from the Integration Services engine, I will get an error after about 20 minutes stating:

"Error: Memory Error: Allocation failure. Not enough storage is available to process this command""Error: Errors in the metadata manager. An error occurred when loading the <cube name> cube from the file \?D:Program FilesMicrosoft SQL ServerMSSQL.2OLAPDataMyWarehouse<cube file>.xml"

The cube name is not specific, it will fail and any of my cubes could be in the error log

If I fully process the AS database using the AS engine (logon to local AS server, right-click AS database and click Process), I get no errors at all, it processes and completes fine. The processing options are identical when I run in AS or via the SSIS "Analysis Services Processing Task" task.

I've searched quite a lot online but no joy, the information I have gleaned from various sites does not directly link SSIS with SSAS processing problems.

When either the AS processing starts via SSAS or SSIS the memory usage of MSMDSRV.exe increases to around 1.4 / 1.5 GB but never goes to 2GB ever, even when the error appears.

I've done the following with no effect.

" Have run via AS and works fine
" No specific cube it fails on
" Have created a Dimension only package, same problem
" Changed the maxmemorylimit
" Changed the connections to localhost
" Memory DOES NOT max out on server

Server Specs:
Windows Server 2003 Standard + Service Pack 2
4GM ram, 2GB paging file

SQL Server 2005 + Service Pack 2


Can anyone help?

Andy

View 2 Replies View Related

Reusing A Generated Column To Avoid Over Processing

Oct 22, 2007

Hi,I'm constructing a query that will performs a lot o datetimecalculumns to generate columns.All that operations are dependent of a base calculum that is performedon the query and its result is stored in a columna returned.I wanna find a way of reusing this generated column, to avoidreprocessing that calculumn to perform the other operations, causethat query will be used in a critical application, and all saving isfew.Thanks a lot.

View 2 Replies View Related

Complex DB Search Forms (Store Proc Vs. Complex Where)

Nov 12, 2003

I have web forms with about 10-15 optional search parameters (fields) for a give table. Each item (textbox) in the form is treated as an AND condition.

Right now I build complex WHERE clauses based on wheather data is present in a textbox and AND each one in the clause. Also, if a particular field is "match any word", i get a ANDed set of OR's. As you can imagine, the WHERE clause gets quite large.

I build clauses like this (i.e., 4 fields shown):

SELECT * from tableName WHERE (aaa like '%data') AND (bbb = 'data') AND (ccc like 'data%') AND ( (xxx like '%data') OR (yyy like '%data%') )

My question is, are stored procedures better for building such dynamic SQL clauses? I may have one field or all fifteen. I've written generic code for building the clauses, but I don't know much about stored procedures and am wondering if I'm making this more difficult on myself.

View 7 Replies View Related

Integration Services :: SSIS Package - Replacing Null Values In One Column With Values From Another Column

Sep 3, 2015

I have an SSIS package that imports data from an Excel file, replaces any value in Excel that reads "NULL" to "", then writes the data to a couple of databases.

What I have discovered today, is I have two columns of dates, an admit date and discharge date column, and what I need to do is anywhere I have a null value in the discharge date column, I have to replace it with the value in the admit date column. 

I have searched around online and tried a few things using the Replace funtion in Derived columns but no dice so far. 

View 3 Replies View Related

Integration Services :: How To Declare Multiple Derived Column In SSIS Derived Column Task

Jul 22, 2015

how to declare multiple derived columns in SSIS Derived Column Task in one attempt.as i have around 150 columns coming from Flat file. I had created the required Expression in Excel and now i want add those in derived column task but its allowing only 1 expression at a time.

View 4 Replies View Related

Integration Services :: Cannot Get Current Row Value Of Column

Oct 10, 2013

I have successfully created a linked server between SQL Server 2008 R2 and a Postgres db, and all is working fine, except when I try to run a stored procedure that returns a TEXT column.The top lines of the stored procedure (function in postgres) that is called are:

CREATE OR REPLACE FUNCTION get_defects()
RETURNS TABLE(defectid bigint, featurevalues text) AS ...

The function obviously executes correctly in postgres, however when I try to execute the function in SQL Server via the linked server:

SELECT *
FROM OPENQUERY(POSTGRES, 'SELECT * FROM get_defects()')
I get the error:

OLE DB provider "MSDASQL" for linked server "POSTGRES" returned message "Requested conversion is not supported.".
Msg 7341, Level 16, State 2, Line 1

Cannot get the current row value of column "[MSDASQL].featurevalues" from OLE DB provider "MSDASQL" for linked server "POSTGRES".The problem seems to be when trying to return the TEXT column featurevalues, as the following query executes as expected:

SELECT defectid
FROM OPENQUERY(POSTGRES, 'SELECT * FROM get_defects()')

View 3 Replies View Related

Integration Services :: Export XML Column In SSIS?

Apr 19, 2015

 we have a table with xml column. This column has a large xml data . I am trying to use ssis to import xml from sql column (table a) to destination (another table).

steps which i did in ssis:

1.  execute sql task:

    fetch the xml column by query and store "full result set" into an object variable.

2. foreach loop:

select Ado enumerator option and select variable which has reset set of execute sql task. In variable mapping selected a new variable of type string.

when I run package I get below error:

"Error: ForEach Variable Mapping number 1 to variable "User::variable" cannot be applied".

View 14 Replies View Related

Integration Services :: Excel Column More Than 255 Characters

Dec 28, 2010

How to import data into SQL table from Excel column which has more than 255 characters?

View 7 Replies View Related

Integration Services :: Derived Column In SSIS

Jul 15, 2015

How to use derived columns in SSIS

string to datetime

Input value : (string)

14/03/2014

NULL

15/04/2015

Note : Having null or blank value

View 4 Replies View Related

Integration Services :: Column Metadata In Table

Apr 10, 2015

I am having one store procedure which use to load data from flat file to staging table dynamically.everything is working fine. staging_temp table have single column.all the data stored in that single column below is the sample row.

AB¯ALBERTA ¯93¯AI
AI¯ALBERTA INDIRECT ¯94¯AI
AL¯ALABAMA ¯30¯ 

after the staging_temp data gets inserted into main table.my probelm is to handle such a file where number of columns are more than the actual table.if you see the sample rows there are 4 column separated by "¯".but actual I am having only 3 columns in my main table.so how can I get only first 3 column from the satging_temp table.output should be like below.

AB¯ALBERTA ¯93
AI¯ALBERTA INDIRECT ¯94
AL¯ALABAMA ¯30

View 45 Replies View Related

Integration Services :: Column Names Using Lineage ID

Nov 17, 2015

I am working on a custom component to implement some rules based on the column name. I am looking for ways to identify the column name using lineage id. Is there anyway we can derive column name using the lineage id?

View 3 Replies View Related

Integration Services :: SSIS Derived Column Expression

Nov 23, 2015

I am trying to figure out my expression here with derived column 

source

Unavailable/Planned

output

Planned(which is after "/".

I achieved this in sql but not finding solution in SSIS Derived column transformation.

View 3 Replies View Related

Integration Services :: How To Change Sequence Of Source Column

Nov 3, 2015

I am working on 1 POC project.I have 2 customer having source file in txt format, but the column sequence of both customer are diffrent.Number of columns in all files are like below.

CustA

ID   NAME   AGE
1     VIPIN    29

CustB

ID   AGE   NAME
2     29      jayesh

As per source file you can see that CustA have column sequence ID,NAME,AGE and CustB Have ID,AGE,NAME sequence .I have target table #Temp with ID,NAME,AGE sequence.Like that I have many files from both customer, I have to load in ID,NAME,AGE sequence from all source file to target table.How can we change the sequence of source column before loading to target table.

View 5 Replies View Related

Integration Services :: Deleting Column From CSV File Using SSIS

Aug 18, 2015

How can we delete the column from SSIS file using ssis?

View 3 Replies View Related

Integration Services :: ISNULL Not Working In Derived Column?

May 7, 2015

i have a derived column which contains the days of a month from 1 to 31

I have this expression for column 1:

(DT_R4)([1] == 4 ? 0.5 : ISNULL([1]) ? 0.0 : 1.0)

But the ISNULL function will not work. I am sure, there are some NULL Values in Column [1] but i get all the Time the value 1.0 back.

I need the Value 0 instead of NULL to calculate the days in an extra Column.

So that i have in the end a result column which have values for example: 4,5 or 5,5 .why ISNULL is not working?

View 7 Replies View Related

Integration Services :: Derived Column Expression - Display Only Name?

Jun 16, 2015

How can i write expression for below input?

1858;# 1234;#Chun  Yang

I want to display only name.

View 2 Replies View Related

Integration Services :: Derived Column Date Conversion

Jul 8, 2015

So I am trying to change my date type which is in the 1/1/2015 12:30:10 PM to a 2015-1-1 00:00:00

So I am using Derived Columns to do the trnasformation in Visual Studio but I am getting the following error:

An error occurred while attempting to perform a typecast

So this is what I did

Step 1:
Load date into OLE DB Source

Step 2:
Replace function
REPLACE(ATL,"1/1/2015 12:30:10", "1900-01-01 00:00:00)

Step 3:
Replace Function
REPLACE(ATL,"/","-"0

Step 4:
Replace funtion
REPLACE(REPLACE(ATL, "AM",":00"),"PM",":00"

Step 5: this is where the error occurs
(DT_DBTIMESTAMP)ATL

Step 6:
Load into OLE DB Destination File

View 2 Replies View Related

Integration Services :: Conditional Concatenation In Derived Column?

Aug 3, 2015

I have 10 columns i.e from Segment1 to Segment10. I need to concatenate it with ".". All 10 segments can be null. If any of the segment is null i do not want to show ".". This is the expression I am using

 (DT_STR,100,1252)((ISNULL(SEGMENT1) ? "" : "." + SEGMENT1) + (ISNULL(SEGMENT2) ? "" : "." + SEGMENT2) + (ISNULL(SEGMENT3) ? "" : "." + SEGMENT3) + (ISNULL(SEGMENT4)
? "" : "." + SEGMENT4) + (ISNULL(SEGMENT5) ? "" : "." + SEGMENT5) + (ISNULL(SEGMENT6) ? "" : "." + SEGMENT6) + (ISNULL(SEGMENT7) ? "" : "." + SEGMENT7)
+ (ISNULL(SEGMENT8) ? "" : "." + SEGMENT8) + (ISNULL(SEGMENT9) ? "" : "." + SEGMENT9) + (ISNULL(SEGMENT10) ? "" : SEGMENT10))

But if any of the column contains Null or Blank I get ...... I do not want to show these .... if any segment is null.

What mistake am I doing in the above expression?

View 4 Replies View Related

Integration Services :: No Column Information Was Returned By Command

Nov 13, 2015

I can preview the SQL command in the OLE DB Source Editor and bring back all columns and results just fine but when I click on the Columns I get

TITLE: Microsoft Visual Studio
------------------------------
The component reported the following warnings:
Error at Data Flow Task [OLE DB Source [1]]: No column information was returned by the SQL command.

The columns are there in the preview - why can't SSIS get the column information?

View 6 Replies View Related

Integration Services :: Conditional Split Column Less Than Today

Oct 29, 2015

I'm trying to write a conditional split where I want to bring in only records where the date is less than today, but my problem is that I can't simply do this Column < GetDate() because if something comes in today, it takes the time into account and it will bring that record for today.  You can do this in SQL, but I'm not sure how to do that in SSIS

SELECTCAST(CONVERT(char(8),GetDate(),112)ASdatetime)

View 2 Replies View Related

Integration Services :: Handling Variable Column Inputs

May 18, 2015

I receive a data feed from a third party in a pipe delimited file.  From time to time, they add a column at the end.  I would like my ssis package to continue to process the data even if they add a column with out it breaking. How best do I handle this situation?

View 6 Replies View Related

Integration Services :: CASE Statement In Derived Column

Oct 6, 2015

I have an SSIS package in which I need to include a derived column. I've done derived columns a ton when there is just one condition being "tested". In this case there are two. I have the following update statement for a table I'm inserting data into:

UPDATE STAGING_DIM_AR_INVOICE
SET SC_CODE =
(
CASE
 WHEN REC_TYPE = 'P' AND SC_CODE IS NULL THEN  'ag'
 WHEN REC_TYPE = 'I' AND SC_CODE IS NULL THEN  'OL'

[Code] ....

I'd like to be able to address this case on the load itself. I've used CONDITIONAL before, but not sure how that would work in this case. I'm trying to keep it as "simple" as possible.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved