Hi All,
I would like to ask, how to read and write BLOB datatype in Datastage 8.1. Please let me know the procedure. I have one column in my source which contains BLOB datatype.
Regards,
Nitin.
How to read and write BLOB datatype in datastage 8.1
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 1
- Joined: Fri Nov 26, 2010 3:42 am
- Location: B-85,2ND FLOOR, NEHRU VIHAR, NEAR TIMARPUR, NEW DELHI-110054
How to read and write BLOB datatype in datastage 8.1
Regards,
DS User
DS User
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: How to read and write BLOB datatype in datastage 8.1
hey,nkk.nmanchanda246 wrote:Hi All,
I would like to ask, how to read and write BLOB datatype in Datastage 8.1. Please let me know the procedure. I have one column in my source which contains BLOB datatype.
Regards,
Nitin.
you can use rdbms stage.
Regards,
Y. BELMOKHTARE
We are loading and reading clob fields not blob fields, but can only assume they are the same thing. I'll tell you what we're doing; maybe it will help someone.
We load XML into a CLOB field. To load the xml into a clob field we read an xml file from the server. The entire xml file is read into a field within a sequential file stage defined as LongVarChar. Length will need to be big enough to hold your largest file. You can do some 'ls' commands in the directory where the files exist to see what the length should be or 'WC fielname'. We then send the data/xml down the pipeline into a table using a DB2 UDB connector. The field should remain LongVarChar in the datastage metadata.
On the DB2 table the field is defined as a CLOB field with datatype CLOB(1048576).
When reading the CLOB field from the table the field once again should be LongVarChar in your metadata.
We load XML into a CLOB field. To load the xml into a clob field we read an xml file from the server. The entire xml file is read into a field within a sequential file stage defined as LongVarChar. Length will need to be big enough to hold your largest file. You can do some 'ls' commands in the directory where the files exist to see what the length should be or 'WC fielname'. We then send the data/xml down the pipeline into a table using a DB2 UDB connector. The field should remain LongVarChar in the datastage metadata.
On the DB2 table the field is defined as a CLOB field with datatype CLOB(1048576).
When reading the CLOB field from the table the field once again should be LongVarChar in your metadata.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Another, rather old-fashioned, approach is to treat them as very long (perhaps even unbounded) VARCHAR and apply hex conversion (for example RAWTOHEX in Oracle, HEX in MySQL) while extracting, and use the reverse functions when loading.
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.