Skip navigation
7897 Views 10 Replies Latest reply: Feb 23, 2012 2:45 AM by Saket Kale RSS
tayunyang New Enzee 59 posts since
Feb 2, 2011
Currently Being Moderated

Feb 17, 2011 12:23 PM

How to use Clobs in Netezza

Hi,

 

Is there clob in netezza? If so, where can I find documentations on this? I am trying to write a dynamic SQL to insert data into a table with 100 columns. I think I will need to use clob in order to make this work. I assume dynamic sql will not slow down the performance tremendouly.

 

In addition, is there anyway that I can check if there is any ddl change for any tables in netzza?

 

thanks for the help in advance!

  • Shawn Fox Enzee Exraordinaire 1,486 posts since
    Aug 15, 2006
    Currently Being Moderated
    1. Feb 17, 2011 1:29 PM (in response to tayunyang)
    Re: How to use Clobs in Netezza

    Netezza does not have CLOBs but a VARCHAR can hold up to 64KB.  What are you doing that makes you believe you need a CLOB?

  • Shawn Fox Enzee Exraordinaire 1,486 posts since
    Aug 15, 2006
    Currently Being Moderated
    3. Feb 17, 2011 3:27 PM (in response to tayunyang)
    Re: How to use Clobs in Netezza

    Assuming that your average column name is <= 20 characters, a 64000 byte varchar could hold 64000/20 = 3200 columns.  Even if you repeat them twice that still gives you 1600 columns.  I suspect that the 64000 byte varchar will easily hold the SQL that you want to generate for use with EXECUTE IMMEDIATE.

  • Saket Kale New Enzee 17 posts since
    Jan 12, 2012
    Currently Being Moderated
    5. Feb 21, 2012 2:43 AM (in response to Shawn Fox)
    Re: How to use Clobs in Netezza

    Hello,

     

    I want to use CLOB or something like CLOB to put the data which is there is a column into a different table since it is of huge size and my table is exceeding the max allowed size if I include it in the original one.

     

    What can I use if netezza does not suport clob, or do I need to do any pre processing? Also is there any alternate method.

     

    Please Advise, thanks.

     

    Saket Kale.

  • Kapil New Enzee 26 posts since
    May 24, 2010
    Currently Being Moderated
    6. Feb 21, 2012 6:38 AM (in response to Saket Kale)
    Re: How to use Clobs in Netezza

    One way is to keep the required file outside of NPS and only keep pointer/link of file location in the table.

     

    Kapil

  • Chris Rodgers Active Enzee 185 posts since
    Sep 19, 2006
    Currently Being Moderated
    7. Feb 21, 2012 5:18 PM (in response to tayunyang)
    Re: How to use Clobs in Netezza

    What kind of ddl changes are you looking to detect?  What is an example of how the ddl is being changed?  Quite often in Netezza, ddl is changed with a CTAS.  This is basically creating a new object (which later gets renamed to the original object's name).  That results in a whole new object ID and create timestamp.

  • Saket Kale New Enzee 17 posts since
    Jan 12, 2012
    Currently Being Moderated
    8. Feb 22, 2012 12:33 AM (in response to Chris Rodgers)
    Re: How to use Clobs in Netezza

    Hello Chris,

     

    I have a column in my table which has become too big to handle so I would like to use something like CLOB or similar to create a reference automatically(is what I understood what CLOB does after reading up on it in reference to DB2 etc).

     

    So I would like to have this column in a different table altogether and just have some reference here in my main table.

     

    Please Advise,

    Saket Kale.

  • nickg Active Enzee 250 posts since
    Mar 16, 2011
    Currently Being Moderated
    9. Feb 22, 2012 2:44 PM (in response to Saket Kale)
    Re: How to use Clobs in Netezza

    You can have either a VARCHAR(64000) or NVARCHAR(16000) column. Their is a total row width limit of 64K bytes.  You are on your own as far as assigning keys between the two tables (use a sequence).  What DB2 is doing (and Oracle has similar options) is a physical implementation for storing large objects that is not supported in Netezza (as they don't support large objects).  So you need to define your own table and manage relationships.

     

    As long as the CLOB data fits and only contains character data, you should be ok.  If you are trying to store binary data (pictures, audio, video, etc...), this will not work because character set encoding may corrupt the contents in the column.  Such BLOBs should be stored externally and referenced via a URL stored in the Netezza table.

  • Saket Kale New Enzee 17 posts since
    Jan 12, 2012
    Currently Being Moderated
    10. Feb 23, 2012 2:45 AM (in response to nickg)
    Re: How to use Clobs in Netezza

    Hello Nick,

     

    Thanks for he response.

     

    I was not able to use the whole size since I have got many other columns which are also relatively big.

     

    So, there is nothign as such which will internally manage large objects, maybe will have to separate these fields in the flat file itself and then load these differently.

     

    I will update this post once I complete this separation and loading.

     

    Lets us hope it happens.

     

    Thanks for the help.

    Saket Kale.

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points