Left and right function in MSSQL

Is there a build function like "Left" or "Right" from MSSQL in Denodo? For example, a example string such as "ABCD". * left ('ABCD', 1) will return 'A' * right ('ABCD', 2) will return 'CD'
28-03-2017 22:44:09 -0400

4 Answers

In the "Denodo Xtrafuncs for VDP library" you have the functions leftpad and rightpad that can help on this. You need to download it from Denodo's support site and install it in your Denodo's server. The package includes the documentation. Alternatively, you can use the combination of the functions "substring" and "len" instead of left and right: For the **left** function: * substring ('ABCD' FROM 1 FOR 1) will return 'A' For the **right** function: * substring ('ABCD' FROM (len('ABCD') - 1) FOR 2) will return 'CD' * substring ('ABCD' FROM (len('ABCD') - 2) FOR 2) will return 'BC' * substring ('ABCD' FROM (len('ABCD') - 2) FOR 3) will return 'BCD' * . . . I hope this helps.
Denodo Team
29-03-2017 06:16:00 -0400
Is there a document to install Denodo Xtrafuncs jars? thanks
29-03-2017 15:30:49 -0400
Plese follow these steps: • Download de file from the support site • Decompress the downloaded zip file in a directory of your convenience • Open Virtual Data Port Admin Tool • Click in File -> Jar management -> Create • In the File name field, browse to and select: <directory _where _you _have _decompressed _the_file>/dist/denodo-xtrafuncs-vdp-string-6.0-20160823-jar-with-dependencies.jar • Click Ok and then Close. Now you are ready to use the new functions in Denodo. The documentation is located in: <directory _where _you _have _decompressed _the_file>/doc
Denodo Team
30-03-2017 03:34:33 -0400
I don't see left / right functions in the aforementioned jar file. I do see some useful functions like *leftpad* and *rightpad* but I was hoping to see a function similar to what the original poster described. dgg
05-09-2017 13:33:59 -0400
You must sign in to add an answer. If you do not have an account, you can register here