I am new to this so please excuse any errors but does anyone know why...

I have a function which is called and 3 arguments passed

identifychannel(centre_code, company_class, stock_type)

the function tests centre_code to return channel and where appropriate 'else' tests another argument.

problem is this...
If I want to retain original channel (when else does not yield result) using

else set channel=channel

the returned text for channel is messed-up! so the function is useless...

am I missing something?

any help greatly appreciated
thanks


martin

Use the ifnull function in your update clause:

update mytable set channel=ifnull(identifychannel(centre_code, company_class, stock_type),channel)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.