Query Select result collection null

CamiCat

Member
Hello friends, (@sivagelli,@VJR )
I need to execute a query of type "Select from *..."
where the result is no rows selected because no rows match the criteria.
How to implement an action that performs an Sql querY?
How to perform the fact that the result of the query can be a null datatable with no rows?
Thank you so much,
Camilla.
 

Mani_Reddy86

New Member
Hi Camilla,
First you need to set a connection to oledb(oracle database engine) for this you need oracle database access engine in our system to run Sql queries.
To set the connection you can use below connection string
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&<Excel file name>&".xlsx;Extended Properties='Excel 12.0 Xml;HDR=NO;';"
Keep in mind you can use this connection string only for .xlsx format.
if you want results where no rows selected because no rows matches the criteria you should put the criteria which is not there in Excel sheet data.
all the above steps are enough to implement an action that performs sql query.
To perform Set that results with null data table with no rows you should apply the sql query which doesn't include any data of excel sheet following the criteria of Sql Query.

Thanks,
Mani.
 

VALMAN

New Member
Hello Camicat, once i built a process with a sql query involved. I used the "Data-SQL Server" VBO, available as a native BP one. You can import that. First of all, you'll set an action node with "Set Connection" property, which allows the communication between BP and your own sql database (you have to specify DB name, Server). Then, you have to set an action with "Get Collection" property, where the expression editor allows you to simply write your sql query, in double quotes 'cause system expects it as a text. The output, as a matter of facts, is a collection, generated by your sql query. Generally speaking, the "IS NULL" operator, in sql, is used to test for empty values. I hope this is useful.
 
Top