How to trim values in sybase ase?


 
Thread Tools Search this Thread
Top Forums Programming How to trim values in sybase ase?
# 1  
Old 09-26-2016
How to trim values in sybase ase?

HI Team
I am using Sybase ASE15.7 version.
Below is the sample column values .
Would like to know how to
  1. Trim http:// and https:// from above list of example
  2. Remove characters after first /
  3. Include only the abc and xyzbre from above two entries .

Code:
 
 abc
 xyzbre

Thanks


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!
Don't overuse FONT/COLOR etc. tags!

Last edited by rbatte1; 09-26-2016 at 09:07 AM.. Reason: Converted to formatted number-list
# 2  
Old 09-26-2016
Hello Perlbaby,

Following may help you in same, I have tested it in BASH only.
Code:
awk -F'[/.]' '{print $3}'   Input_file

Thanks,
R. Singh
# 3  
Old 09-26-2016
Thanks Ravinder

But I wanna run in Sybase SQL server using queries .
Can you help on this ?
# 4  
Old 09-26-2016
Dear Perlbaby,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What are your preferred tools? (C, shell, perl, awk, etc.) You now are suggesting SQL, which would have been nice to know earlier
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Sybase ASE - Query Tuning - Need Suggestion

Dear Team Please provide suggestion on below query which is used in Sybase Adaptive Server Enterprise/15.7 (ASE). Query takes more time > 30 Mins to 1 Hr All required indexes are built Can we have any efficient approach to get the data retrieval faster for below query.Any help... (0 Replies)
Discussion started by: Perlbaby
0 Replies

2. Programming

Sybase ASE Soundex Function Issue -Need Suggestion

Dear Team I am using Sybase Adaptive Server Enterprise/15.7 (ASE). Trying my luck on SOUNDEX function to get unique records Though the command works for characters and provides unique code for similar outputs. But when i try with Starting numbers ( Followed with Street address ) , soundex... (1 Reply)
Discussion started by: Perlbaby
1 Replies

3. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

4. Programming

Sybase ASE - AVG Function Error

Hi Team - I am using Sybase ASE 15.7 version. Below query is throwing an error stating Error : incorrect syntax near the keyword 'OVER' SELECT EMPLOYEE_ID , EMPLOYEE , Department, CAST( Salary as DECIMAL( 10, 2 ) ) AS Salary CAST(AVG( Salary) OVER ( PARTITION... (3 Replies)
Discussion started by: Perlbaby
3 Replies

5. Emergency UNIX and Linux Support

Help with Sybase DB

Hi, I'm facing an emergency situation, wherein I have to provide limited support to a Sybase DB temporarily as the DBA was fired. There is an urgent need of adding to users to the database. After some time on google, I was able to gather the below information on the database setup ... (1 Reply)
Discussion started by: maverick_here
1 Replies

6. UNIX and Linux Applications

sybase ase installer

i'm looking for an installer of Sybase ASE 11.9.2.6 for HP-UX. tried buying from the local distributor but he can only give me the latest version. can anyone point me to where i could possibly get it? (0 Replies)
Discussion started by: sam_salazar
0 Replies

7. Shell Programming and Scripting

Need help in shell script to trim numeric values

Hello I am currently working on a shell script which actually needs to pull some file from a server , The filenames will have the extension with date/time stamp , i need to trim that and name it to proper format Example : xyz_20091108_22142365.gzip i need to remove the... (5 Replies)
Discussion started by: ranga27
5 Replies

8. Shell Programming and Scripting

Trim

Hello, I am passing a filename to a script to draw parameters from it. However, I want to use part of the filename as a parameter. The filename is transfer_ccf_3731_10.sh but I only need the 3731_10 part of it. Is this possible? Any help or suggestions would be appreciated! Regards, J. (4 Replies)
Discussion started by: JWilliams
4 Replies
Login or Register to Ask a Question