Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FieldDescription
DetailsThe main details required for Database Exporter configuration.
href="#queryString">Query Query StringThe query string used to write Stream data into the Datasource.
href="#advanced">AdvancedAdvancedDetails for advanced Database Exporter configuration - in many cases, you do not need to enter anything in this tab.
href="#inputMultiplier">Input Input MultiplierAn input multiplier expression.
DescriptionA free text field for you to enter a description of the Database Exporter.

...

Note that when exporting a stream attribute field of Type 'TrueFalse', this attribute must be mapped correctly to the corresponding underlying database column it is being exported into. An 'if' style expression should be used in the query string to transform the TrueFalse value into the appropriate database column. Mapping to a single character database column - {if(aTrueFalseStreamAttribute,'T','F')}
Mapping to a single numeric database column - {if(aTrueFalseStreamAttribute,1,0)}

...

As for a plain SQL query, you can write PL/SQL just as you would to run against the database directly - but putting any PhixFlow expressions in curly braces i.e. starting with a '{' and ending with '}'.

 


declare

	v_count number;

begin

	select count (1) into v_count from INTL_CODES where operator = {Operator} and code = {Code};
	
	if (v_count = 0)
	then
		insert into INTL_CODES values(
			{Operator},
			{Code},
			{toDate(StartDate)}
		);
	else
		update INTL_CODES set START_DATE = {toDate(StartDate)}
			where operator = {Operator} and code = {Code};
	end if;

end;
				

 

In this example we are loading international codes into a database, as in the plain SQL examples. Here, we want to insert a new value if no value already exists in the table for the Operator/Code combination; otherwise we will edit the existing record with the START_DATE of the current value that we have read from the input stream.

...