Hi, on Lucee 6, trying to insert a record in the d...
# lucee
s
Hi, on Lucee 6, trying to insert a record in the database, works perfectly on Lucee 5. Get an error saying string or binary data will be truncated, but it does not say which data is at risk. Any ideas how to see the queryparam's in the insert query, using ORM? I get the insert query, but not the values, only ?,?,?,etc. in the error message. Thnx!
Using FW/1 latest version
Code and database is the same, only Lucee version has changed
s
that's a database error, not a Lucee error, no reason updating would have anything to do with that. one of the problems with CFORM is debugging it for exactly this reason. you'll have to dump out the parameters to your
ormexecutequery
or (if you're using EntitySave) maybe dump your ORM entity or a memento of it and compare it to your DB table with your mk1 eyeballs
but lucee is just passing along the error from the DB there
i.e. you are trying to save some string value of size 101 when your db column's size is 100
s
yeah, it figures, just unsure how to dump something from entitySave
s
reason 243 why we don't like to use CFORM. Mementifier can help if you use coldbox, makes dumping 'just the properties' a lot easier, but you can also hand-write a mementifier just by iterating through the properties in the metadata and dumping them
s
LOL, it seems so easy when you write it like that, but it more than not reads like Greek to me, so many strange words in your sentences 😄 . Will try and debug what you are saying and then take it from there.
No ColdBox here, just plain Lucee
s
so ideally, your db would tell you what column is about to be truncated, a little odd that it doesn't. or else the msg is just too long and Lucee is truncating your truncation msg next best thing is to dump out the entity properties and see which values might look very obviously long. But if you just cfdump an ORM entity it can break things because they have so much data you don't care about. that's why you need a memento - a snapshot struct of just the properties of your ORM entity you can get a list of properties from the getMetaData function and write some simple tools to iterate over your entity properties and dump them. that's what mementifier does for you in Coldbox.
s
OK, thnx, will take it from here, your explainer sort of dawns on me, ORM is fine as long as it works, and otherwise is sux 😉
OK, tried fiddling about a bit with the data types and the lengths, seems the length of our salt is different in Lucee 6 from Lucee 5. Very strange. It is now 19 characters long instead of 14 characters, really weird. Will have to dive into this trying to find an explanation. Changing the maxlength of the salt on the column in the DB solved my insert-issue at least. Users happy, me not so 🙂