Toad World® Forums

Removing Data from a column (Len Formula?) - Help Please


#1

Help Please…not sure if this is possible

This is an example of the script that we are using…I’m wondering if its possible to break out the description as per the screenshot. Basically any data in the NAM field that contains BDJ or DPJ we need to remove the Client Name from the DES field and everything else should remain as is (see screenshot for the Should Be Field).

Script being used:

select
j.period_name MTH,
substr(h.name,1,100) NAM,
substr(j.description,1,200) DES,
from gl.gl_code_combinations g,
and j.period_name = ‘001’


#2

You should be able to achieve this using a CASE expression.

Lots of examples of it on the internet, just google for it. Here’s a link to the docs.

https://docs.oracle.com/database/121/SQLRF/expressions004.htm#SQLRF2003


#3

I know this is more of an sql question than a Toad question and I don’t want to break any rules but…

I can help you with this even if we have to take it offline but first.

Explain to me

you are only selecting from one table (gl.gl_code_combinations g) alais g

and I am assuming "and j.period_name = ‘001’" should be "where j.period_name = ‘001’"

Why do you have j. period_name and h.name and there is no table(s) aliased as j or h?

If you wan to take this off line send me you email address.

Thanks

On Thu, May 3, 2018 at 8:56 AM, paul.sousa bounce-paulsousa@toadworld.com wrote:

Removing Data from a column (Len Formula?) - Help Please

Thread created by paul.sousa
Help Please…not sure if this is possible

This is an example of the script that we are using…I’m wondering if its possible to break out the description as per the screenshot. Basically any data in the NAM field that contains BDJ or DPJ we need to remove the Client Name from the DES field and everything else should remain as is (see screenshot for the Should Be Field).

Script being used:

select
j.period_name MTH,
substr(h.name,1,100) NAM,
substr(j.description,1,200) DES,
from gl.gl_code_combinations g,
and j.period_name = ‘001’

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for Oracle Forum notifications altogether.

Toad for Oracle - Discussion Forum

Flag this post as spam/abuse.


Gene L. Bradley Jr.

Systems Analyst

Office of Information Technology

Jackson State University

1400 J R Lynch Street

P.O. Box 17750

Jackson, MS 39217

ph 601.979.1042

fax 601.371.9146

email gbradley@jsums.edu

*In God we trust; all others bring data. * ~W.E. Deming

CONFIDENTIALITY STATEMENT

This electronic transmission is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone (601) 979-1042. Thank you.