how this works?

pls explain me how this works....

DECODE (SUBSTR (field, 1, 1),'''', '''''' || field || '''','''' || field || '''')

here field is a column in an oracle table....

Actually, I'm not into Oracle SQL so I might be wrong.
But I would simply interpret it as a string formatting of some result set.
The substr stuff should take the 1st character from filed, and the rest just looks like simple string concatenation with Oracle's weird concat operator || if I recall correctly.

But what is the significance of those four single quotes , six single quotes etc..?im just struck over these single quotes!

Sorry, I was completely wrong.
I shouldn't have replied at all.
Actually, DECODE seems to be similar to a ternary operator in many programming languages (like ? : ).
So I would read if expression (i.e. 1st arg) is true return 1st value (i.e. 2nd arg), else return 2nd value (i.e. 3rd arg).
But please, look up in an Oracle SQL reference.

Even my 2nd attempt was wrong:o
Just look up a SQL reference e.g.
decode [Oracle SQL]
http://download.oracle.com/docs/cd/B14117_01/olap.101/b10339/x_decimal004.htm#sthref1650

it means if substr of field column that is from 1st char to 2nd char is " a double quote it will be decoded as two double quotes ""concated with field then again a double quote and a single quote or else "' concated with field and "'
decode works as nested if or switch case..
for more info on decode just search in google...

Have You copy/pated this from a terminal? Because I can't see any double quotes in it...

/Lakris

There is no double quotes here.....everythin here is single quote