dbInputTable no records

Hi,
I’m needing to do do some action based on whether or not a query produces results. So if I have results, do A, otherwise do B. Problem is that if no results are returned, I can’t seem to capture that information on the next node to do my branching. How would I do this?

Hello dnrickner,
it can be hacked by adding a Reformat with following code after the DBInputTable:

//#CTL1
int counter = 0;
// Transforms input record into output record.
function transform() {
	counter++;
	$0.* := $0.*;
	return 0
}

function finished(){
	dict_put_str("rec_no",num2str(counter));
}

This Reformat just counts the input records and sends them to output port. After all records are processed it puts number of processed records to the dictionary. In the subsequent phase, you can get the value from dictionary and, depending on the value, do A or B, eg. in DataGenerator:

function generate() {
	int rec_no;
	rec_no = str2num(dict_get_str("rec_no"));
	$field := iif(rec_no == 0, "no records processed", "number of processed records: " + rec_no);
	return 0
}

Thank you. This is working.