Skip to main content
Solved

I am using mysql executor to fetch pvoutput.org data into my mysql databases. The whole data is being fetched but its not going into my mysql databases

  • November 8, 2017
  • 7 replies
  • 21 views

Forum|alt.badge.img

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) )

Best answer by david_r

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.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • Best Answer
  • November 8, 2017

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.

Forum|alt.badge.img

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 :)

Forum|alt.badge.img

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


david_r
Celebrity
  • November 9, 2017

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


Forum|alt.badge.img

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

 

 


Forum|alt.badge.img

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 ..

 

 

 


david_r
Celebrity
  • November 9, 2017

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