Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Hmmm. Is this a bug?
Mon, Nov 11 2019 9:03 PMPermanent Link

Ian Branch

Avatar

Hi Team,
I modified a constraint, no problem, and the SQL generated under Explorer|SQL History was..
{sql}
ALTER TABLE "Albums"
ALTER CONSTRAINT "BarCodeNo_PriceCode" AS UNIQUE ("BarcodeNoPriceCode") ERROR CODE 20001 MESSAGE 'Duplicate Barcode # Price Code is not permitted.'
{sql}

When I put this into a script..

{sql}
Execute Immediate 'ALTER TABLE "Albums"
ALTER CONSTRAINT "BarCodeNo_PriceCode" AS UNIQUE ("BarcodeNoPriceCode") ERROR CODE 20001 MESSAGE 'Duplicate Barcode # Price Code is not permitted.'';
{sql}

It falls over.  Doesn't like the MESSAGE text. Frown
What do I do about the Message pls?

Regards & TIA,
Ian
Tue, Nov 12 2019 2:09 AMPermanent Link

Yusuf Zorlu

MicrotronX - Speditionssoftware vom Profi

Ian Branch wrote:

> {sql}
> Execute Immediate 'ALTER TABLE "Albums"
> ALTER CONSTRAINT "BarCodeNo_PriceCode" AS UNIQUE
> ("BarcodeNoPriceCode") ERROR CODE 20001 MESSAGE 'Duplicate Barcode #
> Price Code is not permitted.''; {sql}
>
Hi Ian,

check your MESSAGE ... only one ' written, but you have to "escape"
that ' and make '' like this:

Execute Immediate 'ALTER TABLE "Albums"
ALTER CONSTRAINT "BarCodeNo_PriceCode" AS UNIQUE
("BarcodeNoPriceCode") ERROR CODE 20001 MESSAGE ''Duplicate Barcode
Price Code is not permitted.'';

--
--
Yusuf Zorlu | MicrotronX
Tue, Nov 12 2019 4:51 PMPermanent Link

Ian Branch

Avatar

Tks Yusuf,
Double single quotes.  Duly noted.
Regards,
Ian
Image