Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I'm new here and, already asking questions!
I have a requirement to create an incremental load script from a table which has about 6,5kk entries, which I kind of succeeded at(I think), but another requirement is to alter all adjustment quantity made in a certain type of location zone to be zero.
The attached script works fine, but when I try to insert an if statement to do so, it fails.
The if statement I've tried to write was:
if("Zone Code"]='ADJUST', '0',Quantity) as Quantity
If this is inserted anywhere within the load statement, the load fails.
What am I doing wrong in here? 🙂
Thanks for all help!
Okey try this rename the result of your if statement to following:
if( Upper( "Zone Code" ) = 'ADJUST', '0',Quantity) as Quantity2
if( Upper( [Zone Code] ) = 'ADJUST', '0',Quantity) as Quantity2 //Remember no space in ''
It looks like u have 2 fields with the same name, that cant be done in same load.
ex. will fail.
Quantity,
if( Upper( "Zone Code" ) = 'ADJUST', '0',Quantity) as Quantity
/Teis
Hi Robert,
Just the syntax on your fieldname, try the below
if([Zone Code]='ADJUST', '0',Quantity) as Quantity
hope that helps
Joe
maybe
if([Zone Code]='ADJUST', 0, Quantity) as Quantity
I've inserted it as follows within the LOAD statement:
This is what I get when trying to reload or debug the script
I am pretty sure this is some dumb typo on my account, please could you help me?
Is there anything extra I could send your way to make it easier to pinpoint?
Thanks!
Same issue as in my reply to Joe above
Thanks!
Hi Robert
it does not look like your having problem with the if statement, but a problem with your OLEDB SQL.
Can u try post the full SQL string?
/Teis
This is embarrassing, but I need to ask, what exactly do you mean by full sql string [edit!]?
Please find the script in it's current state attached to this post!
Thanks,
in ur if statement their is a problem.
if("Zone Code"='ADJUST', '0',Quantity) as Quantity or
if([Zone Code]='ADJUST', '0',Quantity) as Quantity
This correction was suggested by Joe Simmons - the script still fails saying OLEDB read failed, there is a screenshot above
Thanks
might be case sensitive issue,
If([Zone Code]='Adjust','0','Siva') or
If([Zone Code]='adjust','0','Siva')
------------
If("Zone Code"='Adjust','0','Siva') or
If("Zone Code"='adjust','0','Siva')