Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Procedure creation syntax
Wed, Jan 3 2007 4:08 AMPermanent Link

"Edhrx"
Hi,
In the EM I am trying to create this procedure

CREATE PROCEDURE SetLocalTableTime
(
  IN TableName VARCHAR(60)
)
BEGIN
 UPDATE LOCAL_TABLE_UPDATE_LIST  SET LAST_UPDATED = 'xxx' WHERE TABLE_NAME
= TableName;
END


I get an error message #700 'Expected ; but found WHERE


Wed, Jan 3 2007 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ed,

<< In the EM I am trying to create this procedure

CREATE PROCEDURE SetLocalTableTime
(
  IN TableName VARCHAR(60)
)
BEGIN
 UPDATE LOCAL_TABLE_UPDATE_LIST  SET LAST_UPDATED = 'xxx' WHERE TABLE_NAME
= TableName;
END

I get an error message #700 'Expected ; but found WHERE >>

DML statements must be run as dynamic statements in the EDB stored
procedures/functions like this:

CREATE PROCEDURE SetLocalTableTime
(
  IN TableName VARCHAR(60)
)
BEGIN
 EXECUTE IMMEDIATE 'UPDATE LOCAL_TABLE_UPDATE_LIST  SET LAST_UPDATED =
''xxx'' WHERE TABLE_NAME
= '''+TableName+''';
END

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jan 4 2007 2:23 AMPermanent Link

"Edhrx"
Tim
I pasted in from your syntax. The EM gave an AV.  There was no other message
but I think the problem is with the quoting.

Are those two single quotes around xxx ''xxx" or are they double "xxx"
Are those a single quoted followed by a double quote around the parameter
TableName

Best wishes Ed

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:5DF3B902-729B-4BEE-979E-5C8CDEBB9F76@news.elevatesoft.com...
> Ed,
>
> << In the EM I am trying to create this procedure
>
>  CREATE PROCEDURE SetLocalTableTime
>  (
>    IN TableName VARCHAR(60)
>  )
>  BEGIN
>   UPDATE LOCAL_TABLE_UPDATE_LIST  SET LAST_UPDATED = 'xxx' WHERE
TABLE_NAME
>  = TableName;
>  END
>
>  I get an error message #700 'Expected ; but found WHERE >>
>
> DML statements must be run as dynamic statements in the EDB stored
> procedures/functions like this:
>
>  CREATE PROCEDURE SetLocalTableTime
>  (
>    IN TableName VARCHAR(60)
>  )
>  BEGIN
>   EXECUTE IMMEDIATE 'UPDATE LOCAL_TABLE_UPDATE_LIST  SET LAST_UPDATED =
> ''xxx'' WHERE TABLE_NAME
>  = '''+TableName+''';
>  END
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Thu, Jan 4 2007 4:16 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ed,

<< I pasted in from your syntax. The EM gave an AV. >>

Got it.  It's now fixed.  It was a parsing error with the single-quotes.

<< Are those two single quotes around xxx ''xxx" or are they double "xxx"
Are those a single quoted followed by a double quote around the parameter
TableName >>

They're all single quotes, and the statement is missing a final single
quote.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image