mike
mike

Reputation: 47

Informatica to SQL Server

I have the following informatica coding, however, I am having difficulties transforming it into equivalent SQL coding. I hoped that someone may be able to provide some assistance.

The informatica coding is as follows:

'CLASS'||'|'||in_inputfile_name||'|'||REPLACECHR(0, in_cust_number, 'Z' , '' )||'|'||in_order_number

Upvotes: 0

Views: 249

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269953

SQL Server uses + for string concatenation. But, you have to cast numbers and dates to the right format. So, I am guessing something like:

'CLASS' + '|' + in_inputfile_name + '|' + REPLACE(in_cust_number, 'Z' , '' ) + '|' + CAST(in_order_number as varchar(255))

Just a note about case sensitivity. REPLACECHAR() with an argument of 0 is case sensitive. SQL Server doesn't have anything quite so easy. So, if you need case sensitivity, you can use COLLATE. Or, if that is important, then perhaps the database and tables already have a default case-sensitive collation collation.

Upvotes: 2

Related Questions