9

I am trying to convert SQL Server procedure to PostgreSQL.

In the SQL Server procedure There are statements like below

SET @val = '(' + @someval + ')'

So in postgresql I wrote as below

SET val = '(' || someval || ')';

But the above statement giving error at ||

Any body can please tell me where am I making mistake

2
  • Can you share the whole procedure with us? It might not be the concatenation itself, but rather the where that statement is being interpreted. Commented Oct 17, 2013 at 5:57
  • 1
    Please read the manual: postgresql.org/docs/current/static/… Commented Oct 17, 2013 at 6:12

1 Answer 1

14

AFAIK, SET statement in PostgreSQL used for changing configutation parameters, for variable assignment just use :=:

val := '(' || someval || ')';

sql fiddle demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.