ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

PDM is not happy about all the Translate() in INSERT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDM is not happy about all the Translate() in INSERT

    PHP Code:
    C/EXEC SQL                         
    C
    INSERT INTO WorkFile
    C
    +         (Field1,
    C+          Translate(Translate(Field2,' ',',') ,' ','"'),       
    C+          Field3,
    C+          Field4,
    and 
    so on... 
    I want to strip commas and double quotes from Field2 on an insert.
    but PDM is not happy about all the Translate() here

    Suggestions welcome.

  • #2
    Re: PDM is not happy about all the Translate() in INSERT

    Hi,

    first do you want to replace the comma and double quotes through blanks or do you want to remove them?

    Translate will only replace one character through an other, but instead of using several TRANSLATES a single one will be enough. May be you'll get some problems with PDM, because the syntax checker cannot distinguish between the comma as separator and the comma to be converted. (Always insert a blank after the comma separator.)

    Try the following:
    PHP Code:
    C/EXEC SQL
    C
    Insert ...
    C+   (...
    C+     Translate(Field2'  '',"'),
    C+ ... 
    Birgitta

    Comment


    • #3
      Re: PDM is not happy about all the Translate() in INSERT

      Why you need several translates
      Cheers
      PKBUNU

      Comment

      Working...
      X