Skip to main content

INSERT INTO `stations`.`observation` (`station_id`, `date`, `time`, `energy`, `power`, `average`, `temperature`, `voltage` )
VALUES ( 1, @Value(interval_start), @Value(_timeOutSubstring), @Value(_dataEnergyOutString), @Value(_dataPowerOutString), @Value(_dataPowerAvgString), @Value(_dataTempString), @Value(_dataVoltString) )

It seems there are some issues with how the quotation marks are used. Try something like this:

INSERT INTO stations.observation (station_id, 
                                  date, 
                                  time, 
                                  energy, 
                                  power, 
                                  average, 
                                  temperature, 
                                  voltage)
VALUES (1,
        @Value(interval_start), -- Numeric value, not quoted
        '@Value(_timeOutSubstring)', -- String value, must be quoted
        '@Value(_dataEnergyOutString)',
        '@Value(_dataPowerOutString)',
        '@Value(_dataPowerAvgString)',
        '@Value(_dataTempString)',
        '@Value(_dataVoltString)')

Notes:

  • In SQL, single quotes are necessary for string literals. Note that you'll need to use straight quotes such as 'string', slanted quotes such as `string` usually won't work. You should not quote numeric values, although some database implementations will silently ignore the quotes for you.

     

  • In FME, don't put a semicolon at the end of the SQL statement unless you also define FME_SQL_DELIMITER at the start of your SQL statement, see this article for more info.

It seems there are some issues with how the quotation marks are used. Try something like this:

INSERT INTO stations.observation (station_id, 
                                  date, 
                                  time, 
                                  energy, 
                                  power, 
                                  average, 
                                  temperature, 
                                  voltage)
VALUES (1,
        @Value(interval_start), -- Numeric value, not quoted
        '@Value(_timeOutSubstring)', -- String value, must be quoted
        '@Value(_dataEnergyOutString)',
        '@Value(_dataPowerOutString)',
        '@Value(_dataPowerAvgString)',
        '@Value(_dataTempString)',
        '@Value(_dataVoltString)')

Notes:

  • In SQL, single quotes are necessary for string literals. Note that you'll need to use straight quotes such as 'string', slanted quotes such as `string` usually won't work. You should not quote numeric values, although some database implementations will silently ignore the quotes for you.

     

  • In FME, don't put a semicolon at the end of the SQL statement unless you also define FME_SQL_DELIMITER at the start of your SQL statement, see this article for more info.

 

Thank You David, I will apply this :)

pvoutputurl-customloopingreader-sqltrial9.fmw@david_r I tried this but its still not getting the data into my observation table

 

 

Previously I tried a syntax which somehow fetched the data to mysql observation table but I forgot the exact syntax

 

 

Kindly guide how I can get the data to my tables


What kind of error message are you getting? It's difficult to be specific without knowing your data and your database schema.


What kind of error message are you getting? It's difficult to be specific without knowing your data and your database schema.

There are no errors for now but I dont know why the data is not being going to mysql though it is appearing in fme inspector.pvoutputurl-customloopingreader-sqltrial9.fmw

 

 

Thank You

 

 


What kind of error message are you getting? It's difficult to be specific without knowing your data and your database schema.

I am not getting any error but the fme should transfer the data fetched to observation table.

 

In my view the whole thing is fine but dnt know where the issue is ..

 

 

 


You may want to consider dropping the SQLExecutor altogether and use a FeatureWriter instead, it should be much easier.


Reply