How to check sql if condition output is null

How to check sql if condition output is null.

If run sql output is null, alert message null.
other alert have data.

Please guide me about it.

@fairymemay

Use Execute query activity, write your query which will output to a datatable

Use a IF condition as DataTable.Rows.Count > 0

Then → Query outputs data
Else → Query didn’t output any data(Null)

Hope this helps you

Thanks

2 Likes

@Srini84 I can’t connect UIpath with database.
Now I use open program pl/sql and paste query and press run.

Please guide me about it.

@fairymemay

Can you share a null screenshot of the pl/sql?

Thanks

@Srini84

@fairymemay

As you are using the open program, you have to deal with UI elements

Use get text and choose the element which is showing Null

Place a IF condition as GetTextElementOutput = “Your Value of Null”

Then-> Null
Else-> Returned values

Hope this helps you

Thanks

@Srini84


image

From upper picture.
How to check output have value or not only
I just want to check . but i want reture value.

@fairymemay

You can use Get Text activity and scrape that element

In If condition you can give a condition as GetTextActivityVariable.StartsWith(“0 rows”)

Then-> Null
Else → Not Null

I hope this helps you

Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.