locked
line return to 72 characters in DB2 RRS feed

  • Question

  • hi,

    I'm  migrating data from SQL Server to DB2. I'm trying an insert statement where a field accepts 72 characters in a single line and there has to be a carrage return after 72 characters. how to acheive this in DB2???

    appreciate your help.

    thanks

    vishal.

    Wednesday, August 8, 2012 1:23 PM

Answers

  • Hi Vishal,

    It is a SQL Server forum. I believe you got better answer at DB2 forums or the manufacturer website.

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

    • Proposed as answer by Naomi N Wednesday, August 8, 2012 1:33 PM
    • Marked as answer by Kalman Toth Tuesday, August 14, 2012 7:39 AM
    Wednesday, August 8, 2012 1:31 PM

All replies

  • Hi Vishal,

    It is a SQL Server forum. I believe you got better answer at DB2 forums or the manufacturer website.

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

    • Proposed as answer by Naomi N Wednesday, August 8, 2012 1:33 PM
    • Marked as answer by Kalman Toth Tuesday, August 14, 2012 7:39 AM
    Wednesday, August 8, 2012 1:31 PM
  • I know it's a SQL forum, I was just wondering if any one faced similar issue here. yup I'm trying to find it out and will reply back with issue if I can find it.

    thanks 

    Wednesday, August 8, 2012 1:36 PM
  • The design of SQL Server is quite different from DB2, the SQL part is common.

    In SQL Server you can include CHAR(13) CR or CHAR(10) NL in the string itself if necessary. Note though, each takes up one character, there is no extra "padding" left for them in a string definition.

    SELECT CONCAT('New York City', CHAR(10), 'Moscow', CHAR(10), 'Sidney');
    /*
    ---------------------------
    New York City
    Moscow
    Sidney
    
    (1 row(s) affected)
    */


    Kalman Toth SQL SERVER 2012 & BI TRAINING

    Tuesday, August 14, 2012 7:55 AM