You can tell SAP to not bother with SP08 - I’ve just tried it and there is no problem. So this must be Patch 1 specific, if this is actually a bug or changed behaviour.
I have tried to reproduce the same situation by using DS 4.2 SP08 in a Microsoft environment, using MS SQL Server 2014 Express and IPS 4.1 SP08.
I created a new EDW_TARGET datastore pointing to the SQL 2014 database in which I created an AUDIT schema, owned by dbo, with the TECH_JOB_CONFIG table, with only 1 column: DEFAULT_INT as Integer. In this I insert 1 record with value -1.
Now I’m assuming that AUDIT is the schema or the owner? I don’t think it matters anyway.
I run the following script (as the only object in the test job):
$G_DEFAULT_INT = sql( 'EDW_TARGET','SELECT DEFAULT_INT FROM AUDIT.TECH_JOB_CONFIG');
Print(' $G_DEFAULT_INT: ' || cast($G_DEFAULT_INT, 'varchar(10)'));
Do note that on validation it will still give a conversion warning because you are hard casting a VARCHAR output from SQL() into an Integer Global Variable. (You really need to change that using a proper test and conversion function with error handling.)
[Script:Test_SQL_Function]
Warning: Expression <sql('EDW_TARGET', 'SELECT DEFAULT_INT FROM AUDIT.TECH_JOB_CONFIG')> of type <VARCHAR> will be converted to type <INT>. (BODI-1110432)
Anyway, that aside, the return is this:
12736 2812 PRINTFN 5/05/2017 11:04:59 a.m. $G_DEFAULT_INT: -1
Have you tried this in your environment using a new job and a new script all together? I recently had this problem at a customer (still on DS 4.2 SP04 … yes I know, it’s out of mainstream support) where a Data Flow got corrupted so that it literally refused to evaluate A + B = C… because it kept thinking A was NULL even though that was not possible. When I recreated the logic in a new Data Flow, it worked perfectly fine so something obviously got porked along the way.
ErikR
(BOB member since 2007-01-10)