Limit in MySQL insert node

Hello,
I wrote a dynamo script for exporting Revit data to a MySQL Database. The script retrieved only 1573 line, however the MySQL database is populated with only 183 line. Besides, the database is populated even if the the SQL command node output if false.
Have anyone encountered this king of problem ? Is it related to the model size ?


e

Do I have a timestamp that tells you the 183 rows are from this run? From the looks of it it shouldn’t be writing anything since it’s set to false. The Command node will show all 1582 because it works independent of the actual write node.

I delete all table content before running the script:

Then run my script (false command output)

Even though, I get this result :

Take a look at the 184 line of data and see if there is some different like a comma or other punctuation that may break the output. A lot of DB configurations won’t allow injection prone characters unless they are escaped.

Actually when I delete the highlighted node (Element type name ), the script works perfectly.


image

1 Like

Are there an null values passed in that node? Another thing may be the length of the value is longer than what the column was set up for? I have ran into that from time to time. I would check the DB settings and make sure you are good on length, then check the data from the type name for any weird elements. It may also be safer to use the Element.Name node in vs python.

1 Like

I think @SeanP is on the right track- it’s probably an invalid value of some kind, either specific characters, length, or a null so agree it is best to look at row 184 and work out what is different.

A trouble-shooting step would be to take the SQL node output from Dynamo (export to clipboard or a text file) and run that in Workbench- this will give you a meaningful error

Andrew

1 Like

The problem occurs because of the ’ character in the type name at row 183. I replaced ’ by space and it works perfectly !
Thank you for your help.
INSERT INTO schedule_data.t_element_model(id,revit_building_name,revit_level_name,revit_id_element,revit_code_repere_element,revit_category_element,revit_type_element) VALUES (‘183’,’’,‘RJ’,‘4317257’,‘PIR’,‘Equipement de génie climatique’,‘EQP_PIR_Pot**-d’in**troduction_12L’)