You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Hi,
It will be very nice if someone could help us. ![]()
We are currently using TIS 3.2.3.r35442 to migrate Sunopsis Designer projects.
Since Sunopsis uses sql syntax, we have to convert (in tMaps columns) expressions like :
concat( lpad(row1.NAME,6,'0'), concat( lpad(row1.NAME,20,' ')...
{sql lpad examples} :
* case1 : lpad( 'abcdefg', 0, '12345') => ''
* case2 : lpad( 'abcdefg', 4, '12345') => 'abcd'
* case3 : lpad( 'abcdefg', 7, '12345') => 'abcdefg'
* case4 : lpad( 'abcdefg', 14, '12345') => '1234512abcdefg'
Confines :
- We are using multi BD sources and the output is a positional file.
- We don't have the permission to write a routine for a project of this low complexity. ![]()
A simple inline padding would be easy to do with StringHandling.LEFT/RIGHT/STR() or just with String.format() for some cases.
However in the sql lpad/rpad case it's impossible to do in an acceptable number of characters if we don't know beforehand if the stringToPad.length() is lower or greater than the wantedPadedStringFinalLenght (compare case2 and case4).
An other problem is the filler string modular cut (case4).
Furthermore, a sql querry modification will be heavy given that one column can contain many different lpads of the same sql column.
And an ELT solution seems to not be suited to a multibase sources + positional output file project...
So my question is :
It is possible to reproduce the sql LPAD/RPAD behaviour in a tMap column without writing a routine and without modifying the sql querry ?
Is there a known solution or a componant to do that without using a wasteful temporary positional file (something like an hypothetical tPositionalRow component would be perfect -except the case of multichars fillers-) ?
Thank you for your time.
++
Last edited by dinozore (2010-03-04 15:13:22)
Offline
Pages: 1