PowerBuilder Mask or ...?

Posted on 2006-04-12
Last Modified: 2013-12-26

I'm trying to display a string id w/out the last 4 chars if the last 3 are = '999'.  

Had put the logic in the DataSource query as:

 ,IF Right(tableName.StringId, 3) = '999'
     THEN SUBSTR(tableName.StringId, 1,
          LENGTH(tableName.StringId) - 4)
     ELSE tableName.StringId
  ENDIF                       AS StringId

which worked great except for orphaning the column name which caused problems with other code.

Any suggestions of how to keep the db column name qualified (tableName.StringId instead of StringId) while displaying the field without the last 4 chars?
Question by:ssebring
    LVL 18

    Accepted Solution


    well, did u try giving ur alias name as tableName.StringId  instead of StringId

    normally when we have such cases we tend to use views to reduce complications...

    did u try creating a view to make life easy...

    any particular reason why u want to retain the same db column name... coz u wont have any probs with creating DW with ur above query...


    Author Comment

    Hi Rosh,

    Yes, I tried an alias as tableName.StringId - pb didn't like that.  A view would be ideal except for the fact that a window references the dw field on an insert -- since aggregate field deltas are not allowed in views the action fails.  Also, forgot to mention that the query contains a join which is why the table qualification is needed.

    So, ended up writing a computed field definition in the dw while leaving the db field in tact.  Everyone is happy!

    I've accepted your answer since a view would have worked in some cases and you were the only reply!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now