Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQL - Insert into with cast

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

  • SQL - Insert into with cast

    "INSERT INTO mylib.myPF ( flddec ) SELECT digits(fldChar) as numberbat FROM mylib.myPF2 "

  • #2
    SQL - Insert into with cast

    Same error: SQL0420 - Character in CAST argument not valid. Is this going to be one of those very simple things that I'm missing?? Thanks for the post. Diane

    Comment


    • #3
      SQL - Insert into with cast

      I would guess that you have bad data in the field. Try limiting your test to just a few records with values that you have verified.

      Comment


      • #4
        SQL - Insert into with cast

        Group, I'm testing a simple sql statement that needs to insert character data into a numeric field. Fields are defined as "fldChar - 3" & "flddec - 3,0". The sql statement reads "INSERT INTO mylib.myPF ( flddec ) SELECT cast(fldChar as decimal(3,0))) as numberbat FROM mylib.myPF2 " This returns the error SQL0420 - Character in Cast argument not valid. Can I "insert into" a file using the operation "cast"? If I test a simple select statement using the cast statement above, all works fine. Diane

        Comment


        • #5
          SQL - Insert into with cast

          Bad data - that was it! Thanks for your posts - I was almost convinced this couldn't be done. Thanks again!! Diane

          Comment

          Working...
          X