ValerieMT
ValerieMT

Reputation: 5

quote delimiter in substr oracle

I would like to know how to mix up the function substr and quotes delimiter in sql query. such query send me the error invalid query

SQL>Insert into employee (name) 
values(substr(q'<ALEXANDRE SA'A DONJUAN LA FAMILLE ANDREA>',1,20));

I expect this query to insert the name as ALEXANDRE SA'A DONJU thank you to help me

Upvotes: 0

Views: 169

Answers (3)

Amran Hossain
Amran Hossain

Reputation: 152

Its Working You can run This

Insert into employee (name) 
 values(substr(q'[ALEXANDRE SA'A DONJUAN LA FAMILLE ANDREA']',1,20));

Upvotes: 0

rtbf
rtbf

Reputation: 1587

after changing to propera usage of quote operator:

Insert into employee (name) 
 values(substr(q'>ALEXANDRE SA'A DONJUAN LA FAMILLE ANDREA>',1,20));

Upvotes: 0

Frank Schmitt
Frank Schmitt

Reputation: 30815

Your usage of the quote operator q and substr is fine - you're just missing a closing ):

Insert into employee (name) 
  values(substr(q'<ALEXANDRE SA'A DONJUAN LA FAMILLE ANDREA>',1,20));

Upvotes: 2

Related Questions