question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

Error while finding and replacing NULL Values?

Hi Team,

I am assigning label based on sql query. But since all token are not meeting criteria, there are null values for label. I want to assign null values by 0. There are some errors and if condition is not working to compare null values.

1658991110312.png

Can you help me to know what is going wrong here?

28.07.2022_Replacing_NULL_Values.fsm

Thank you!


FlexSim 21.0.10
flexscriptnull valuesreplacement
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered Ankur A3 commented

If the query doesn't find any rows that fit the condition, the result table is empty. So when attempting to read the first value, you get the error that there is no row 1 in the table.

Instead you should check if there are any rows in the table at all. If not, you can directly return the desired value.

1658999264077.png


1658999264077.png (10.1 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ankur A3 avatar image Ankur A3 commented ·
Thank you! @Felix Möhlmann

Understood well.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.