When I run it in my Server Explorer window it errors:
ORA-00923: FROM keyword not found where expected.
Is this something I can run from a ExecuteNonQuery? I don't have to create a stored procedure?
thanks.
I want to reorder the listOrder value from a query (not stored procedure), and have written this query to reorder all the columns in the table. Ultimately, I'll be replacing the "1" value with a parameter value, but for now I'm hard-coding it to the ID #1.
Update(TBL_QUESTIONVALUE)
Set ListOrder = ListOrderTable.newListOrde
FROM(TBL_QUESTIONVALUE)
INNER JOIN
(SELECT questionValueId,
row_number() over (order by ListOrder, 1) newListOrder
from(TBL_QUESTIONVALUE)
where questionSetId = 1 or (questionSetId is Null and 1 is Null))) ListOrderTable
ON TBL_QUESTIONVALUE.question
TBL_QUESTIONVALUE.listOrde
It sets the listorder of all the records based on the values stored in a new table created, ListOrderTable.
Oracle errors there is a missing Select KEYWORD.
I am really unsure what to do next. Please help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>Is this something I can run from a ExecuteNonQuery? I don't have to create a stored procedure?
ah, I see that now..
possibly yes. I have seen with both OleDbconnection/command as well as over linked server, this is problematic.
a stored procedure (or function with autonomous transaction) will help there.
You cannot use WITH ... UPDATE like that.
Also, some parts of the SQL do not make sense.
>> where questionSetId = 1 or (questionSetId is Null and 1 is Null)
'1' will never be null, so the part inside parentheses is useless.
Lastly, you are ordering by listOrder, so it seems you want to order a subset of questions, for example, questionSetId 2, by a sequential value. So if they were (10, 11, 12) you'd reorder them to (1, 2, 3) independent of orders for other sets.
If so, try this:
I tested it on this test table prior to posting the code snippet.
SQL> desc tbl_questionvalue
Name Null? Type
--------------------------
QUESTIONVALUEID NOT NULL NUMBER(38)
QUESTIONSETID NUMBER(38)
LISTORDER NUMBER(38)
Post your table structure so we can all be on the same page.
Business Accounts
Answer for Membership
by: angelIIIPosted on 2009-08-24 at 12:11:36ID: 25171400
in oracle , you cannot "JOIN" for update.
this should do th ejob:
Select allOpen in new window