Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 4 of 4 total |
Procedure creation syntax |
Wed, Jan 3 2007 4:08 AM | Permanent 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 AM | Permanent 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |