|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Database Insert Failures |
« View previous topic :: View next topic » |
Author |
Message
|
goldym |
Posted: Tue Nov 01, 2005 9:20 am Post subject: Database Insert Failures |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I am using a compute node to insert data into a database table, every now and then we get an incoming field that is too long, longer than the VARCHAR(100) that is specified.
We decided to increase the field lenght to 150 or so, but is there any setting that will allow a partial insert and not cause the insert to fail and throw an exception? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 01, 2005 9:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the incoming field is too big, then the problem is not in your flow, it's in the upstream application.
If your database field is too small, that's a different story.
The "setting" you want is the function "SUBSTRING".
But that causes data loss - as would any such setting. And the value of the data that will be lost needs to be considered - to determine if it is really useless.
If it is really useless, then the upstream app shouldn't be sending it.
If it's not really useless, then your field should be enlarged to hold it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Tue Nov 01, 2005 9:32 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="jefflowrey"]If the incoming field is too big, then the problem is not in your flow, it's in the upstream application.
If your database field is too small, that's a different story.
The "setting" you want is the function "SUBSTRING".
But that causes data loss - as would any such setting. And the value of the data that will be lost needs to be considered - to determine if it is really useless.
If it is really useless, then the upstream app shouldn't be sending it.
If it's not really useless, then your field should be enlarged to hold it.
[/quote]
Thanks for responding, I gues the problem is the field is too small they don't want to fail any messages if this happens which they aren't expecting to happen but want to prepared if it does. I didn't know if there was something I could set on the compute node to just insert whatever it could and then just truncate the remainder. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Nov 01, 2005 10:42 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Sounds dangerous to me. Jeff's answer (substring) is the best way to handle it. But I'd get in writing (and keep in a safe place) that is the behaviour that's wanted. Also, perhaps it would made sense to detect the fact that this is happening and report it somewhere (log, q, db ...etc).  _________________ -wayne |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|