Re: passing text value with single quote to stored procedure

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Prabhjot Sheena <prabhjot(dot)sheena(at)rivalwatch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: passing text value with single quote to stored procedure
Date: 2013-07-13 09:46:20
Message-ID: AA0ED26E-D8C4-4F9D-88DD-C81384394AA3@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jul 13, 2013, at 24:05, Prabhjot Sheena <prabhjot(dot)sheena(at)rivalwatch(dot)com> wrote:

> when this value is passed to the function
>
> select load_stage_start_v1('QA_SUMMER'2013_(EU/US)');
>
> This gives an error. Is there a way to fix this issue.

Your issue has nothing to do with stored procedures. You need to escape the string properly for SQL.

select load_stage_start_v1('QA_SUMMER''2013_(EU/US)');

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dmitriy Igrishin 2013-07-13 12:46:18 Re: [HACKERS] Frontend/backend protocol improvements proposal (request).
Previous Message shankar.kotamarthy@gmail.com 2013-07-13 06:25:04 Re: pg_upgrade could not create catalog dump while upgrading from 9.0 to 9.2