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?
ssebringAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.