# Sql insert

**URL:** <https://discuss.elastic.co/t/sql-insert/128270>\
**Category:** Logstash\
**Created:** [April 17, 2018, 2:02am UTC](https://discuss.elastic.co/t/sql-insert/128270 "2018-04-17T02:02:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seungtae](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seungtae/32/71413_2.png) [@seungtae](https://discuss.elastic.co/u/seungtae)\
**Post date:** [April 17, 2018, 2:02am UTC](https://discuss.elastic.co/t/sql-insert/128270/1 "2018-04-17T02:02:15Z")

</div>

> Anyone knows SQL INSERT ??

> my jdbc output config is this :

```
output {
    	if([parsedCon] and [parsedSr]){
    		elasticsearch{
    			index => "parse"					
    			hosts => "localhost:9200"
    		}		
    	}
    	stdout {	
    		codec => rubydebug
    	}	

	jdbc {
		connection_string => "jdbc:mysql://182.162.136.33:3306/Jecheon"
		driver_jar_path => "C:\logstash-6.2.3\logstash-6.2.3\lib\mysql-connector-java-5.1.46\mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar"
		connection_test => false
		username => " ****"
		password => " ****"
		statement => "INSERT INTO TB_REN016_020 INPT_VOTG_FIGR VALUES([standard_result][inpt_votg_figr]);"

	}

```

> And.. somepart of my Error :

{:exception=\>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INPT\_VOTG\_FIGR VALUES([standard\_result][inpt\_votg\_figr])' at line 1}

> And

JDBC - Statement has no parameters. No events will be inserted into SQL as you're not passing any event data. Likely configuration error.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 19, 2018, 6:16am UTC](https://discuss.elastic.co/t/sql-insert/128270/2 "2018-04-19T06:16:17Z")

</div>

It looks like the plugin should be configured like this:

```nohighlight
statement => [
  "INSERT INTO TB_REN016_020 INPT_VOTG_FIGR VALUES (?, ?)",
  "%{standard_result}",
  "%{inpt_votg_figr}"
]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 17, 2018, 6:16am UTC](https://discuss.elastic.co/t/sql-insert/128270/3 "2018-05-17T06:16:23Z")

</div>

Closed on May 17, 2018, 6:16am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
