Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

PowerBuilder Mask or ...?

Hi,

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?
0
ssebring
Asked:
ssebring
1 Solution
 
diasroshanCommented:
Hi,

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...

Cheers,
Rosh
0
 
ssebringAuthor Commented:
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!
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now