troubleshooting Question

how to trim value in Long datatype

Avatar of chalie001
chalie001 asked on
DatabasesOracle Database
4 Comments2 Solutions153 ViewsLast Modified:
hi i have the following query

select -- substr(msg_name,1,8),
         fld_seq_no,
          substr(fld_name,1,40) fld_name, fld_type, fld_length,
          fld_precision
     from message_dict
    where msg_name like ('&msg')
    order by fld_seq_nO
;
 which retun following values
  FLD_SEQ_NO FLD_NAME   FLD_TYPE      FLD_LENGTH  FLD_PRECISION
--------------------------------------- ---------------------------------------- -------- --------------------------------------- ---------------------------------------
  10 IDMSTYPE_100                  CH                   1
  20 SASTIME_100                     DF                14
                                     
               
                        
                  i have another query which got this
SQL> SELECT MSG_TEXT FROM msg_in WHERE stream = 'TESTBASIC'
 
MSG_TEXT
--------------------------------------------------------------------------------
U201605170000001122334455667788990065465465465033024tONYTEST

i what the value to display as

I what to trim the msg_text based on the FLD_LENGTH AND POPULATE in extra column

FLD_SEQ_NO FLD_NAME         FLD_TYPE    FLD_LENGTH        FLD_PRECISION          Value
--------------------------------------- ---------------------------------------- -------- --------------------------------------- -----------------------------------------------------------
   10                IDMSTYPE_100      CH                1                                                                 U
   20     SASTIME_100                    DF               1                                                                 20160517000000
                                     
                                                      

desc msg_in
Name          Type        Nullable Default Comments
------------- ----------- -------- ------- --------                            
MSG_TEXT      LONG
ASKER CERTIFIED SOLUTION
chalie001

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros