insert into using a sub select apostrophe issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • everlong
    New Member
    • May 2007
    • 3

    insert into using a sub select apostrophe issue

    Insert into NotesTemp (workitemid, companycode, transactiontype , notetext , datedue, current_workste p, current_status, Userupdate_oper ator, QA_Operator, DateUpdated)

    select w1.workitemid,c c.companycode,t .transactiontyp e,n.notetext,w1.datedue,
    s.workstep as current_workste p,ss.status as current_status, wo.operatorname as Userupdate_oper ator,
    wh.updatedby as QA_Operator, wh.dateupdated from wi_workitemnote n
    (joins, where clause, order by left out to make it easier to read)

    n.notetext contains apostrophe's in some instances and maps to notetext in the notestemp table. How would I modify this so the insert will modify the apostrophes and work?

    Thanks in advance.
  • everlong
    New Member
    • May 2007
    • 3

    #2
    CAST(''+n.notet ext+ '' as varchar(255))

    I figured it out by putting the cast and quotes in like this.

    It would not work with just quotes which is what I had tried at the start.

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Thank you for posting the response. Sorry no one was able to answer you in a timely manner. Hopefully we will see you around the forums again.

      Comment

      • everlong
        New Member
        • May 2007
        • 3

        #4
        I posted the reply 36 minutes after my first post so I did didn't exactly give anybody a lot of time.

        I like the site I'll be around.

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          Originally posted by everlong
          I posted the reply 36 minutes after my first post so I did didn't exactly give anybody a lot of time.

          I like the site I'll be around.
          Glad to hear it. Come back anytime you have a question, or feel like answering other peoples questions!

          Comment

          Working...