95
Views
13
Comments
Working with null values from external database
Application Type
Reactive

Hi everyone,

I need to consume an external database in oracle, I did it with Integration Builder and since it's a read/write, I also selected to preserve the database nulls.

Now the problem that I have, is that the default value stays "<ib>NULL</ib>" in the case of null texts atleast.

When displaying a null value in an input, the input is displaying "<ib>NULL</ib>", in traditional there was a property called "Null Value" in the inputs so that we could work around this, from what I know, the input would not display whatever "Null Value" had on it, and when it was empty it would send that same "Null Value" into the database.


Is there a way to handle this in reactive? It would be better if there wasn't a need to validate every single input to check if text = "<ib>NULL</ib>"
Also there would need to be a way to keep the null in the database when saving a form for example.


Really struggling to find much information about this since Integration Builder is quite new (no idea how this worked with Integration Studio back in the day).


Thanks in advance for anyone that has suggestions/answers!


2019-04-09 00-57-55
carl ruhle

Hi @fabio ,

In Oracle on the select statement you can use the NVL function on the column that can have a null value. 

Select nvl(column, ' ') ... ,if the current value is null it will return (in this case) a space, it can return a value that you wish. 

Hope that I could help.

Regards

2021-09-09 22-42-33
Fábio Rodrigues

Hi Carl,

That's not what I am looking for at all unfortunately.

What I am looking for is a way to display an input as empty when there's the null value on the database.

2019-04-09 00-57-55
carl ruhle

Hi Fábio,

what do you mean "display an input as empty"?

I think you could work that on the front-end side, on the display value bind a function that receives the current value and checks if is null or not and returns the current value or an empty string.

I'm very sorry, but currently I cannot test-it on my side, just words.

Regards


2021-09-09 22-42-33
Fábio Rodrigues

Hi Carl, that definitely could work but I am trying to avoid that.

Looks like it would damage the maintenance step in the future doing it like that, I believe the platform should be able to support this use case without bulletproofing every single input with a function client action.

2019-04-09 00-57-55
carl ruhle

Hi Fábio,

select 

    case 

        when your_field is null then '' 

        else your_field 

    end as result_field

from your_table;

Another option, personally I would go with this option if it is possible.

alter table <table> modify <column> default ""

This way, no nulls on the table and the maintenance step is simpler.

Regards

2021-09-09 22-42-33
Fábio Rodrigues

Hi Carl,

Would like to avoid having to SQL everything.

Also I can’t alter the external tables

2024-04-02 13-23-43
Gonçalo Ferraria
Champion

Hi Fábio,

Although this topic doesn't directly relate, it might still be helpful. Check out this discussion:

https://www.outsystems.com/forums/discussion/41593/convert-to-from-null-value-in-database/

ty

2021-09-09 22-42-33
Fábio Rodrigues

Hi Gonçalo,

I believe I’ve looked into every post about nulls from external DBs but none of them really had a fix for not displaying the null values on inputs without having the need of a function to clean the null values on each input

2019-04-09 00-57-55
carl ruhle

Hi Fábio,

an option if possible would be the use o views.


2021-09-09 22-42-33
Fábio Rodrigues

Hi Carl,

Unfortunately views are not possible here

2019-04-09 00-57-55
carl ruhle

Hi Fábio,

sorry for that.

For now I'm out of options, I bet somebody over here will know a solution to this problem.

I'm very curious, would like to know a possible solution for this.

Regards

UserImage.jpg
Pauline Geldreich

Hello, have you found a solution since then? We are experiencing the same problem.

2019-04-09 00-57-55
carl ruhle

Hi,

I can only help you on thee DB side. If you wish (want) to keep the null values that are already on the DB, just make sure that when inserting/updating those fields (columns) don't have any value on there side.

Can't you work on the select statement in order to use the NVL function?

I'm sorry but this all I know (or think to know). The Oracle NVL function does work on the DB side.

Try to have a look on the configurations.

Best regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.