Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Apr 05, 2016 10:51 am Post subject: Re: EBCDIC, UNICODE Conversion Problem, SQL -873
bauer wrote:
Select for this view works, no problem.
Update, Insert doesn't work.
Solution for Update, Insert: Instead of Trigger like this, but it is not possible to create this Trigger.
Why ?
Any comments ?
How to provide the data of one table as EBCDIC data and UNICODE data ?
Functions EBCDIC_STR and UNICODE_STR instead of CAST doesn't work.
Remark: The Topic, that not all UNICODE chars (2 Byte) can be converted to EBCDIC (1 Byte) is of course well know, but not relevant for this question.
Thank you for all helpful comments.
bauer
Bauer,
Unless I am missing something why can't you do an INSERT on the base table itself instead of the View? View is merely snapshot of what you have in your base table. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Tue Apr 05, 2016 11:07 am Post subject:
kolusu,
thank you for your reply.
The base table is EBCDIC.
We have an environment which requires UNICODE (tables or views). The complete interface to the database should be UNICODE. So we created the UNICODE view.
If we would use the base table, the interface to the database wouldn't be UNICODE.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Apr 05, 2016 11:15 am Post subject:
bauer wrote:
We have an environment which requires UNICODE (tables or views). The complete interface to the database should be UNICODE. So we created the UNICODE view.
If we would use the base table, the interface to the database wouldn't be UNICODE.
Hope you understand, what I mean.
bauer
I understand your need about having unicode view but you would always insert the data into base table but for looking at the data you would use the View which would convert the ebcdic data to unicode.
If you want to insert the unicode data then you just do the conversion on the base table
Code:
INSERT INTO XXX .TBTEST (FIELD1)
VALUES (UNICODE_STR('MY DATA',UTF16))
;
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Tue Apr 05, 2016 1:33 pm Post subject:
Well, not exactly what I want.
I have one base table, EBCDIC.
I like to access this table in System A, which deals with UNICODE.
I like to access this table in System B, which deals with EBCDIC.
In both systems I like to use views, with the goal, what changes in the base table (data model) are possible, just by changing the view definition. But without changing the coding.
Background is an migration project. System B shall be replaced step by step with functions from System A.
And additional existing EBCDIC tables shall we migrated step by step to UNICODE tables.
The functional migration shall be done independent from the data migration.
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Fri Apr 15, 2016 8:17 am Post subject:
Just for information:
The answer from IBM is, that this is not possible. With DB2 you cann't do this. No Views are possible which deal with different CCSIDs.
Possible of course is:
- One UNICODE Table
- Access to this table from any UNICODE environment
- Access to this table from any EBCDIC Environment, data is transferred to EBCDIC, with correct CCSID, handled by DB2 (specification of correct CCSID during BIND PACKAGE process in case of PL/1, COBOL Destination of course is necessary)
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