Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQL equivalent to edit code Z

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

  • SQL equivalent to edit code Z

    I am creating a view and I want to create a right justified character field from a numeric field. I am currently using a case structure which is based on the length of the field and concatenates spaces with the trimmed character version of the field. I can do it in one statement with: space(length(char(FILE.FIELD))-length(trim(char(FILE.FIELD)))) concat trim(char(FILE.FIELD)) however older operating systems do not seem to like the space function. It's simple in RPGLE to just use eval CharField = %editc(DecField:'Z') Any ideas how I can do this in SQL?
    Code

  • #2
    SQL equivalent to edit code Z

    The SQL Built-in Functions and Stored Procedures book from MC Press includes a user-defined SQL function that will allow you to use RPG edit codes in an SQL statement.

    Comment

    Working...
    X