Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Common Table Expression Error
Message
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01531659
Message ID:
01531665
Views:
43
>I am updating a CTE but cannot then select the rows:
>with MyCte as (Select * from MyTable)
>update MyCte set MyField = '111'
>...... works ok
>
>
>with MyCte as (Select * from MyTable)
>update MyCte set MyField = '111'
>Select * from MyCte
>......Gives Invalid Object name near cte
>
>Above is a simple example of what I am trying to do.
>I am hoping to use Common Table Expressions similar to Writable Cursors in VFP
>
>Tia
>Gerard

Gerard,

Common Table Expression can only be used immediatelly after its declaration. Your sample above doesn't make must sense, what exactly you're trying to do?

Also take a look at the OUTPUT clause of the UPDATE command.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform