Solved Inserting a Long String variable into Mysql error

General discussion forum about all things older Team Developer versions.
Also version independent Q&A can be placed here.
monchotgu
Honduras
Posts: 10
Joined: 24 Apr 2017, 02:55
Location: Honduras

Inserting a Long String variable into Mysql error

Post by monchotgu » 08 Jul 2018, 20:01

Hi, I am using teamdeveloper 3.1, I have a small aplication that inserts images to an sql Server Database and it works fine. However my company is moving to MySql (version 5.7.14) database.
When I run the application I get and error: "Programming Error: Missing long bind before write long". I use the exact same code to do the insert :

If SqlPrepare(hSql1,"Insert into Docs (cod_empleado,clasificacion,archivo,imagen,obser,USER_CREO)
values (:nCodEmplCon,:cmb1,:df1,:sImagen,:ml1,:sUserNuevo)")
If SqlSetLongBindDatatype( 4, 23)
If SqlExecute(hSql1)
Call SqlPrepareAndExecute(hSql1,'COMMIT')
Call SalMessageBox('Documento Grabado','CONFIRMACION',MB_Ok)

the long sting cvariable is "sImagen".
This code works for SqlServer but not for Mysql. In the mySql database the column IMAGEN is defined as BLOB. As mentioned above I get error
"Programming Error: Missing long bind before write long",
Does anybody have an Idea of what is wrong?


Thanks in advance

ramon

clemdoc
Austria
Posts: 9
Joined: 08 Mar 2017, 09:51
Location: Austria

Re: Inserting a Long String variable into Mysql error

Post by clemdoc » 11 Jul 2018, 11:43

Is "IMAGEN" the only long column or are you maybe missing a second one?

clemdoc
Austria
Posts: 9
Joined: 08 Mar 2017, 09:51
Location: Austria

Re: Inserting a Long String variable into Mysql error

Post by clemdoc » 11 Jul 2018, 11:45

Other than that, we also had problems with very long texts. We needed to split them up into parts and update them (hacky stuff...). But that was years ago, so I don't remember all the details anymore.

monchotgu
Honduras
Posts: 10
Joined: 24 Apr 2017, 02:55
Location: Honduras

Re: Inserting a Long String variable into Mysql error

Post by monchotgu » 14 Jul 2018, 14:45

Thanks !! I have not realize the le ml1 was also a long string!! It works now

Return to “General Discussion”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests