Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to get the ConvertJSONToSQL to work with a MySql table that has a space in the name?

avatar

I'm using the ConvertJSONToSQL processor, and the MySql table has a space in the name.  It appears to be the problem because when I remove the name from the table it works as expected.

 

I can successfully query the table from various tools and the mysql command line using back ticks "`" around the table name.

 

The table name:
personal information

 

I've tried the following:


`personal information`

"personal information"

'personal information'

\"personal information\"
[personal information]

 

Any suggestions?

1 ACCEPTED SOLUTION

avatar

I created a hack to solve this problem.

 

In the ConvertJSONtoSQL processor I put table name = personal information.  Notice the space.  This generated the sql like so:

insert into personal information <snipped>

 

Then using a ReplaceTextProcessor I did a find and replace so such that the sql inserts were converted to the following:

insert into `personal information` <snipped>

 

This works but is very hacky...would love to see the correct way to get the back ticks to work

View solution in original post

1 REPLY 1

avatar

I created a hack to solve this problem.

 

In the ConvertJSONtoSQL processor I put table name = personal information.  Notice the space.  This generated the sql like so:

insert into personal information <snipped>

 

Then using a ReplaceTextProcessor I did a find and replace so such that the sql inserts were converted to the following:

insert into `personal information` <snipped>

 

This works but is very hacky...would love to see the correct way to get the back ticks to work