cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Skip lines of script if the table is empty.

wjalford
Level III

I am quering a database that currently does not yet have the information that I am quering but will in the near future.  So right now I get an empty table.  I would like to add the functionality to skip certain lines in my code that pertain to the empty table and move on with the remaining part of my code that deals with other data sources.  Can someone give me a way to check if the table is empty?

 

Thank you,

 

Wayne

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: Skip lines of script if the table is empty.

@uday_guntupalli  provided a good link, to determine if no data table was created, however, the data table may be created, but no rows are populated.  To check for this, you need to check to see if N Rows() are greater than 0.  So look in the Scripting Index for    N Rows()  too

Jim

View solution in original post

3 REPLIES 3
uday_guntupalli
Level VIII


Re: Skip lines of script if the table is empty.

Help > Scripting Index > Is Empty

Best
Uday
txnelson
Super User


Re: Skip lines of script if the table is empty.

@uday_guntupalli  provided a good link, to determine if no data table was created, however, the data table may be created, but no rows are populated.  To check for this, you need to check to see if N Rows() are greater than 0.  So look in the Scripting Index for    N Rows()  too

Jim
wjalford
Level III


Re: Skip lines of script if the table is empty.

Jim,

 

Thank you.  I used N rows(dt) >0.  Worked perfectly.

 

Wayne