Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:19:24+00:00 2026-05-26T22:19:24+00:00

I am having trouble with a select statement and not sure what I am

  • 0

I am having trouble with a select statement and not sure what I am doing wrong. This is the structure of the source table:

Source Schema DATA1

Source Table FOLDERS

Source Columns FOLDERID, USERID

Destination Schema DATA1

Destination Table FOLDER_USER

Destination Columns FOLDER_ID, USER_ID

And here is the query ( I need to change the folder ID as it is being pulled out of the first query hence the case):

DECLARE
BEGIN
   FOR FOLDER_ROW IN (SELECT FOLDERID = CASE 
                                WHEN FOLDERID = '10' THEN '1'
                                WHEN FOLDERID = '565' THEN '2'
                                WHEN FOLDERID = '11' THEN '3'
                                WHEN FOLDERID = '81' THEN '4'
                                ELSE '0'
                            END, USERID FROM DATA1.FOLDERS WHERE UPPER(OWNER) = 'ADMIN')
      LOOP                       
          INSERT INTO DATA1.FOLDER_USER (FOLDER_ID, CORP_ID) VALUES (FOLDER_ROW.FOLDERID, FOLDER_ROW.CORPID);
     END LOOP;
    COMMIT;
END;

I get the following error when I execute and I’m stuck as to why I am getting it. I know it has something to do with the case inside the select:

ORA-06550: line 3, column 39:
PL/SQL: ORA-00923: FROM keyword not found where expected
ORA-06550: line 3, column 22:
PL/SQL: SQL Statement ignored
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:19:25+00:00Added an answer on May 26, 2026 at 10:19 pm

    SELECT FOLDERID = CASE is wrong. It should be SELECT CASE ….. END As FOLDERID

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble with Microsoft Access 2003, it's complaining about this statement: select cardnr
I'm having trouble converting the following SQL-statement to LINQ-to-entities: SELECT l.* FROM locations l
I'm having trouble finding the syntax for a statement (or whether or not it's
I'm having trouble trying to define the SQL query for this table: There's a
I'm having trouble with using an IF statement within this sql-server query. What I
I'm using a SELECT statement in T-SQL on a table similar to this: SELECT
I'm having some trouble with a MySQL Select Where statement that uses aliases and
I'm having trouble figuring out how to represent the following JPQL query: SELECT count(e)
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
Having trouble inserting new records into a table. Anybody care to help? <?php include('config.php');

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.