Unable to populate a char field
Moderators: chulett, rschirm, roy
Unable to populate a char field
My source data is a Longvarchar and I have to take a substring of that to populate a table in a DB2 database using an ODBC connection.
I can populate the table successfully by using the substrings of the Longvarchar but I have a problem with one single field which unless I set to null
(using SetNull()) my job aborts. If I try to populate this one field which is a nullable CHAR(1) I get the following message.
Fatal error:
APT_CombinedOperatorController,0: [DataDirect][ODBC DB2 Wire Protocol driver]Socket closed.
....,0: Failure during execution of operator logic.
The job runs fine is that field is set to null. I have tried many different things but nothing seems to work. What am I missing please?
I can populate the table successfully by using the substrings of the Longvarchar but I have a problem with one single field which unless I set to null
(using SetNull()) my job aborts. If I try to populate this one field which is a nullable CHAR(1) I get the following message.
Fatal error:
APT_CombinedOperatorController,0: [DataDirect][ODBC DB2 Wire Protocol driver]Socket closed.
....,0: Failure during execution of operator logic.
The job runs fine is that field is set to null. I have tried many different things but nothing seems to work. What am I missing please?
Re: Unable to populate a char field
[quote="Nic"]My source data is a Longvarchar and I have to take a substring of that to populate a table in a DB2 database using an ODBC connection.
I can populate the table successfully by using the substrings of the Longvarchar but I have a problem with one single field which unless I set to null
(using SetNull()) my job aborts. If I try to populate this one field which is a nullable CHAR(1) I get the following message.
quote]
Hi Nic
What is the derivation for this CHAR(1) field? Try doing the same after making it non-nullable. Have you done any kind of null-handling there?
Regards
Ashwin
I can populate the table successfully by using the substrings of the Longvarchar but I have a problem with one single field which unless I set to null
(using SetNull()) my job aborts. If I try to populate this one field which is a nullable CHAR(1) I get the following message.
quote]
Hi Nic
What is the derivation for this CHAR(1) field? Try doing the same after making it non-nullable. Have you done any kind of null-handling there?
Regards
Ashwin
Re: Unable to populate a char field
Ashvin
the only derivation is a Trim. I am not doing any null handling.
I tried changing the nullable setting, it didn't work
the only derivation is a Trim. I am not doing any null handling.
I tried changing the nullable setting, it didn't work
Unable to populate a char field
I think I won't be able to say much without having a look at your job. Because if you are doing everything right then it seems a strange problem
Regards
Ashwin
Regards
Ashwin
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is the Char(1) field really nullable in the target table?
Are you trying to specify an out of band null (in which case you should be using MakeNull() rather than SetNull())? Can you try NullToValue(field," ") to replace null with a space character, to see whether it's the null handling or something else that is giving the problem?
Are you trying to specify an out of band null (in which case you should be using MakeNull() rather than SetNull())? Can you try NullToValue(field," ") to replace null with a space character, to see whether it's the null handling or something else that is giving the problem?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I have tried updating the field directly in the database and that works fine. There is no problem if I use SetNull(), it works fine. The problem is not with not being able to null it, it is not being able to populate it. I thought maybe there is a problem with the data itself but hardcoding a character doesn't work either. It only seems to accept nulls and nothing else. The field in the database it set to Character(1) and there is nothing associated with this field.
Nic,
what is the column name you are using, and have you gone into the "edit row" attributes to ensure that you don't have some sort of a setting there that you aren't aware of?
what is the column name you are using, and have you gone into the "edit row" attributes to ensure that you don't have some sort of a setting there that you aren't aware of?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I have gone into edit Row and there is nothing oyt of the ordinary there. The details are just like every other field in the table I can populate. The table definitions were imported from the database and I haven't changed anything. The column name is Tank_Online_Ind and I have already reimported the table definitons just in case. I am populating the table via a view and there don't seem to be any problems there either. There are similar jobs doing the same thing and they work fine.
Would it be possible to do a quick server job to just load a couple of rows with some value in this column? This might produce a better error message or might work but will also serve to narrow down the error.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Unable to populate a char field
I could not use insert only (Write only) as there was 1 duplicate row in the data which shouldn't have been there and it was trying to update that row. Once I changed to Insert then update it worked fine.