Stuck on what SHOULD be simple syntax...

PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
This code is one script of an update script I'm trying to push.
It's failing. I have to write the code so that it can be re-run multiple times and not cause the main job to fail.
I've been staring at this for hours and can NOT see why it's erroring.
Here is the error being thrown.
VALUES ('NRSA_APP_USER',11,'NONE','APPROVED','N','Y','10M','N','SPIREK, FRANK','Y',1)';
ERROR at line 3:
ORA-06550: line 3, column 10:
PLS-00103: Encountered the symbol "NRSA_APP_USER" when expecting one of the
following:
* & = - + ; < / > at in is mod remainder not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like like2 like4 likec between into using || multiset bulk
member submultisetHere is my pl/sql code. --I simplified the exception clause, to try and narrow down possibilities...But the commented out exception portion is the original.
BEGIN execute immediate
'create user NRSA_APP_USER
  identified by XXX
  default tablespace USERS
  temporary tablespace TEMP
  profile DEFAULT
  quota 10m on USERS';
EXCEPTION WHEN OTHERS THEN null;  --DBMS_OUTPUT.PUT_LINE('User already Exists');
END;
grant connect to NRSA_APP_USER;
grant create session to NRSA_APP_USER;
commit;
--  script to register the application user with UMA
BEGIN execute immediate
'INSERT INTO UMA.UMA_USERS(USER_NAME,AGENCY_CODE,HOME_ORG_ID,STATUS,ADMIN_IND,HIDDEN_IND,QUOTA_USERS,DIRECT_ACCESS,CONTACT,EMAIL_ENABLED,EID_LEVEL)
VALUES ('NRSA_APP_USER',11,'NONE','APPROVED','N','Y','10M','N','SPIREK, FRANK','Y',1)';
EXCEPTION WHEN OTHERS THEN null; --DBMS_OUTPUT.PUT_LINE('User NRSA_APP_USER already inserted');
END;
BEGIN execute immediate
'INSERT INTO UMA.UMA_CLIENT_APP_USERS (APP_NAME,USER_NAME,DISPLAY_ORDER)
VALUES ('NRISINFORMS','NRSA_APP_USER',1)';
EXCEPTION WHEN OTHERS THEN null; --DBMS_OUTPUT.PUT_LINE('User already inserted');
END;
BEGIN execute immediate
'UMA.UMA_BATCH_PROCESSOR.PROCESS_USERS';
EXCEPTION WHEN OTHERS THEN NULL;
END;
/The error indicates that it doesn't like the column NRISINFORMS...or something PRIOR to that in the code. I checked the table, and the column is spelled right, and it's a varchar2. And then I looked over all the code prior to that for punctuation and such. No luck. I even cut/paste the code into my formatter in TOAD. And it didn't find anything wrong.
Can ANYONE see what I am apparently oblivious to?
Thank you.
Edited by: Willy_B on Oct 18, 2012 9:29 AM - fixed code tag, and also put exact cut/paste of error report.

Hi,
Willy_B wrote:
... Here is the error being thrown.
VALUES ('NRSA_APP_USER',11,'NONE','APPROVED','N','Y','10M','N','SPIREK, FRANK','Y',1)';
ERROR at line 3:
ORA-06550: line 3, column 10:
PLS-00103: Encountered the symbol "NRSA_APP_USER" when expecting one of the
following:
* & = - + ; < / > at in is mod remainder not rem return ...
Here is my pl/sql code ...
BEGIN execute immediate
'INSERT INTO UMA.UMA_USERS(USER_NAME,AGENCY_CODE,HOME_ORG_ID,STATUS,ADMIN_IND,HIDDEN_IND,QUOTA_USERS,DIRECT_ACCESS,CONTACT,EMAIL_ENABLED,EID_LEVEL)
VALUES ('NRSA_APP_USER',11,'NONE','APPROVED','N','Y','10M','N','SPIREK, FRANK','Y',1)';
EXCEPTION WHEN OTHERS THEN null; --DBMS_OUTPUT.PUT_LINE('User NRSA_APP_USER already inserted');
END;
You have to do somnething special to include a single-quote character in a string literal, such as repeat the single-quotes that are inside the literal:
BEGIN execute immediate
      'INSERT INTO UMA.UMA_USERS
      ( USER_NAME
      , AGENCY_CODE
      , HOME_ORG_ID
      , STATUS
      , ADMIN_IND
      , HIDDEN_IND
      , QUOTA_USERS
      , DIRECT_ACCESS
      , CONTACT
      , EMAIL_ENABLED
      , EID_LEVEL
VALUES ( ''NRSA_APP_USER''
       , 11
       , ''NONE''
       , ''APPROVED''
       , ''N''
       , ''Y''
       , ''10M''
       , ''N''
       , ''SPIREK, FRANK''
       , ''Y''
       , 1
       )';or use Q-notation:
BEGIN execute immediate
      Q'{INSERT INTO UMA.UMA_USERS     -- Note Q and { here
      ( USER_NAME
      , AGENCY_CODE
      , HOME_ORG_ID
      , STATUS
      , ADMIN_IND
      , HIDDEN_IND
      , QUOTA_USERS
      , DIRECT_ACCESS
      , CONTACT
      , EMAIL_ENABLED
      , EID_LEVEL
VALUES ( 'NRSA_APP_USER'
       , 11
       , 'NONE'
       , 'APPROVED'
       , 'N'
       , 'Y'
       , '10M'
       , 'N'
       , 'SPIREK, FRANK'
       , 'Y'
       , 1
       )}'                    -- Note } here
;Why are you using EXECUTE IMMEDIATE for this at all? PL/SQL has INSERT statements.
Also, why do you need to create uses on the fly, especially when all the details are hard-coded?

Similar Messages

  • Wifi lost during ios update and iphone is stuck. What should i do?

    Wifi lost during ios update and iphone is stuck. What should i do?

    where does your iphone stucked?

  • I started downloading ITunes Match last night.  The first 2 steps downloaded okay.  The 3rd step is stuck at the beginning 64 out of 2479.  It is still stuck.  What should I do?

    I started downloading ITunes Match last night.  The first 2 steps downloaded okay.  The 3rd step is stuck at the beginning 64 out of 2479.  It is still stuck.  What should I do?

    Are you using the charger and cable that came with the phone?
    Are you using an unauthorized third party charger?

  • My iPod is dead, and it will not charge. Also, my lock button is stuck. What should I do to fix it?

    Earlier today, my iPod touch lock button got stuck. That wasn't a problem. Now, it wont charge. I just tired to reset it, and it went off. But now, I can't even turn it back on. What should I do??!

    Try:
    - iOS: Not responding or does not turn on
    When it says place the iPod in recovery mode use one of these:
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    For MAC or PC
    The Firmware Umbrella - TinyUmbrella
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • If my CD stuck inside what should i do

    my disk stuck inside the mac what should i do ?

    Hello:
    Try restarting your computer while holding the mouse button (primary) down.
    Barry

  • What Should be Query Syntax ?

    table has a field 'A' containing numeric value...
    Want a field 'B' to display to cumulative data of row 'A'
    where ,
              B1=A1, B2=B1+A2 , B3=B2+A3 .....
    Here 'B' is not a table field..
    it is just for display purpous on Report..
    column 'A' has following values in desc order : 5,5,4,4,4,3,3,2,2,1
    So 'B' should have 5,10,14,18,22,25,28,30,32,33
    i m working on Ms SQL server 2005 reporting services ..

    I don't know how you can do it in MS SQL Server (you know this is an Oracle forum, right?)
    But in Oracle you can do it this way:
    create table t
    (a number)
    insert into t values (5);
    insert into t values (5);
    insert into t values (4);
    insert into t values (4);
    insert into t values (4);
    insert into t values (3);
    insert into t values (3);
    insert into t values (2);
    insert into t values (2);
    insert into t values (1);
    select a
         , Sum (a) over (order by rownum
                        ) b
      from t
             A          B
             5          5
             5         10
             4         14
             4         18
             4         22
             3         25
             3         28
             2         30
             2         32
             1         33
    10 rows selected.

  • My ipod nano's power button is stuck?! What should I do?1

    I got my ipod nano 6th generation for christmas. It's been working fine the past months I had it but then suddenly this morning, I found the power button stuck! :/ What should I do?!?!?!

    Schedule an appointment at your local Apple Store/Genius Bar and see if there is anything they can do to help. If they find that the problem is not the result of abuse, they should replace it under the 1 year warranty against manufacturing defects.
    B-rock

  • TS1538 my ipad can not continue to download ios 6.1.2 because of connection problem and it is stuck in connect to itunes image, i cant open it anymore..what should i do? help plz

    my ipad can not continue to download ios 6.1.2 because of connection problem and it is stuck in connect to itunes image, i cant open it anymore..what should i do? help plz

    Connect to iTunes on the computer you usually Sync with and “ Restore “...
    http://support.apple.com/kb/HT1414
    If necessary Place the Device into Recovery mode...
    http://support.apple.com/kb/ht4097
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    But... if the Device has been Modified... this will Not necessarily work.

  • My iphone5s was accidentally disconnected while updating OS8.2 in my MacBook Pro and now it's stuck with an apple logo on its screen and won't turn on or off. What should I do?

    My iphone5 was accidentally disconnected while updating OS8.2 in my MacBook Pro and now it's stuck with an apple logo on its screen and won't turn on or off. What should I do?

    Connect to iTunes and restore. If you have difficulty, you may have to put the device into Recovery Mode. See the instructions in this support document. If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support

  • I have updated to lion. Set up an iCloud so contacts and calendar are shared between iMac iPhone 4s and iPad 1. But iTunes is telling me to update the software on the iPad and iPhone, but it just gets stuck contacting the software server. What should I do

    I have updated my iMac to lion so I can use iCloud to share contacts and calendar between iPhone 4s and iPads 1.  Somehow it seems to have worked although still not sure how to move stuff in and out of iCloud.  iTunes is telling me to update the software on the phone and iPad. When I try to do this it just gets stuck with a box saying connecting to software update server. This has never happened before.  I cannot update or restore either the phone or the iPad in iTunes although I have synced the info.  What should I do?

    Something went wrong with the update, this can and does happen with every version of iOS.
    There is nothing wrong with the update.
    Simply restore the device via iTunes on the computer.
    If iTunes is stating it will take hours to update, that indicates an extremely slow Internet connection and is likely the reason the OTA update failed.

  • My ipod touch is stuck in the apple logo, what should I do?

    My ipod touch 4G, iOS 4.2.1, is stuck in the apple logo, and it turns on and off alone, but it is still in the logo, it doesn't proceed. This happened because I restored through the ipod not iTunes. Itunes doesn't find the Ipod, even though if I wait a long time. What should I do?

    Hi,
    Try resetting your iPod:  http://support.apple.com/kb/HT1430. 
    Hope this helps! 
    ---likeabird---

  • My iPod Touvh 4th Generation won't turn on. It will not charge even after I used a few chargers and will not connect to a computer. The Home button is broken and I don't know if the Lock/Sleep button is now broken or stuck as well. What should I do?

    My iPod Touvh 4th Generation won't turn on. It will not charge even after I used a few chargers and will not connect to a computer. The Home button is broken and I don't know if the Lock/Sleep button is now broken or stuck as well. I believe there may be a problem with the battery or the backlight. I've had my screen replaced once by some stooges. What should I do?

    Try:
    - iOS: Not responding or does not turn on
    When it  says place the iPod in recoverymode use one of these programs.
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                  
    RecBoot tip
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • My ipod 4 is stuck in recovery mode and i dont really want to restore it because i havent really backed it up. what should i do in this situation?

    my ipod 4 is stuck in recovery mode and i dont really want to restore it because i havent really backed it up. what should i do in this situation?

    If one of these programs will not kick the iPod out of recovery mode then you will have to restore and thus erase the iPod
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    or
    http://joshuabailey1997.wordpress.com/2010/09/02/recboot-v1-3/
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                           
    RecBoot tip
    RecBoot may have problems on 64X windows, then try:       
    Tenorshare ReiBoot – Enter & Exit iPhone, iPad, iPod Recovery Mode with a Single Click
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    In the future, frequently backup your device.

  • While updating my ipad to new software through itunes it got stuck and does not work anymore - it just displays the screen with symbols of itunes and the cable to connect to it - help - what should i do?

    while updating my ipad to new software through itunes it got stuck and does not work anymore - it just displays the screen with symbols of itunes and the cable to connect to it - help - what should i do?

    Disconnect the iPad, do a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. The screen will go blank and then power ON again in the normal way.] It is 'appsolutely' safe!, reconnect and follow the prompts.
    If that does not work then see here http://support.apple.com/kb/HT1808

  • What should I do when my iPhone is in recovery mode, I'm trying to restore, and it's stuck at the "Waiting For iPhone" stage??

    I dropped my iPhone on the ground, and as I went to pick it up, I started to swear under my breath as I realized my iPhone was in recovery mode. I'm like "how would an iPhone be this sensitive -_-," and so as my iPhone's docked unto my laptop, and with relentless attempts to restore my iPhone, I always find iTunes stuck at the "Waiting For iPhone" stage and I honestly have no clue what to do at this point. What should I do to bypass this or fix this problem? Or do I just wait? -_-

    Nothing except that when I turn it on, there's a USB cable and an iTunes logo above it, indicating that it's in recovery mode.

Maybe you are looking for