• xxx-xxx-xxxx
  • xxx@gmail.com

Oracle - Varchar


Concatination

is performed with the || operator.

for example

1
2
3
4
select 
'[' || Cust_Sample_ID || ']' CustSampId
'[' || Name || ']' theName, FINAL, wims_seq, wims_slot , qa
from LIMS.V_WIMS_DATA_GOOD S

You can also use the concat function.

1
SELECT CONCAT('Hello', ' World') AS concatenated_string FROM dual;

For more than two strings:

1
SELECT CONCAT(CONCAT('Hello', ' '), 'World') AS concatenated_string FROM dual;

Oracle 19c and later introduced the Concat_WS function, which allows you to concatenate multiple strings with a specified separator:

1
SELECT CONCAT_WS(' ', 'Hello', 'World') AS concatenated_string FROM dual;

Dump Function

The dump function returns the internal representation of a value in the database.

The DUMP function output will look something like this:

Typ=12 Len=7: 120,125,4,14,15,30,0
Typ=12 indicates that the datatype is DATE.
Len=7 indicates that the length is 7 bytes.
The following numbers represent the internal storage of the date and time.

for example

1
2
3
4
     select 
      to_char(sampdate, 'YYYY-MM-DD HH:MI:SS AM') sampledate,
      dump(sampdate) dumpdate
from LIMS.WIMS_DATA S

Returns output like this
2024-08-21 01:01:00 PM  Typ=12 Len=7: 120,124,8,21,14,2,1
2024-08-21 01:01:00 PM  Typ=12 Len=7: 120,124,8,21,14,2,1