

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set a value to a null in several fields
Hi,
I've a table with several fields, and all have in common that Null Values will set to 'N/A'.
I can do something like If(Isnull(FieldA),'N/A',FiedlA), but i dont want to do this to all fields, so there's a way to set all Null values in my table to N/A?
I saw something like Set NullAsValue 'N/A' but didn't work
Thank you
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry didn't read your post clearly
its not set NullAsValue
your variable should be NullValue
start of your script put
SET NullValue = 'N/A';
NullAsValue *;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Those variable will only work if NullAsValue is activated . Try starting with
NullAsValue *;
at the beginning of your script.
refer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry didn't read your post clearly
its not set NullAsValue
your variable should be NullValue
start of your script put
SET NullValue = 'N/A';
NullAsValue *;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I did a simple test.
SET NullValue = 'N/A'; NullAsValue *; LIB CONNECT TO 'MySQL'; [CONTATOS_USERS]: SQL SELECT `id` AS ID_CONTATO, `name` AS NOME_CONTATO FROM mzp1e_users; CONTATOS_INFOS: SQL SELECT `id` AS ID_CONTATO, `cliente_empresa` AS EMPRESA FROM mzp1e_cck_store_form_clientes; exit script;
But didn't work


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry my friend, you are right, my print is not a null but a missing value. Your code works to null values
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thats weird
i actually tested before i suggested it (gave nonsense null value deliberately)
SET NullValue = 'N/sdA'; NullAsValue *;
result

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
