REPLACE() function

Creating tables and queries
Post Reply
briglia23
Posts: 155
Joined: Tue Jun 24, 2008 10:09 am

REPLACE() function

Post by briglia23 »

I want to replace the character

Code: Select all

'
with the empty, not a blank space, but the empty.

i try to do this but it doesn' works

REPLACE(CONCAT("Dati_utenti"."Cognome" ,SUBSTRING("Dati_utenti"."Nome",0,1)),''','')

can you help me?


thanks
OOo 2.3.X on openSuse 10
Safway
Volunteer
Posts: 347
Joined: Thu Apr 24, 2008 4:35 pm

Re: REPLACE() function

Post by Safway »

First, is your syntax incorrect? I see three single quote marks together (''')

Second, what do you get when you break down the functions?
SUBSTRING("Dati_utenti"."Nome",0,1)
CONCAT("Dati_utenti"."Cognome" ,SUBSTRING("Dati_utenti"."Nome",0,1))
REPLACE(CONCAT("Dati_utenti"."Cognome" ,SUBSTRING("Dati_utenti"."Nome",0,1)),''','')

Third, are you following the correct syntax of each function ( http://hsqldb.org/doc/guide/ch09.html )?
SUBSTRING(s,start[,len])
returns the substring starting at start (1=left) with length len
CONCAT(str1,str2)
returns str1 + str2
REPLACE(s,replace,s2)
replaces all occurrences of replace in s with s2

Fourth, what do you get when you replace the third function with the output of the first two functions? For example
REPLACE(CONCAT("Dati_utenti"."Cognome" ,SUBSTRING("Dati_utenti"."Nome",0,1)),''','') would be
REPLACE(CONCAT("Dati_utenti"."Cognome" ,'A'),''','')
REPLACE('BA'),''','')
If someone posts a fix for your question, then please post a quick thank you and then go to your first post, use the edit button to add [Solved] as the first word of the title so other people can rely on the fix as well.
LibreOffice 3.3.3 on Fedora
Post Reply