6 Replies Latest reply: Sep 10, 2012 8:45 AM by Sergey Barskiy RSS

    PLS-00103: Encountered the symbol “” when expecting one of the following:

    950274
      PLS-00103: Encountered the symbol “” when expecting one of the following: error in LightSwitch after validation of ForeignKey entity

      Again i've got a problem with visual studio lightswitch in combination with oracle.
      Now its about custom validation. I've got an entity which has a foreign key referring to another entity:

      http://i.stack.imgur.com/2tYZ3.png

      RouteItem contains a foreign key to the FacilityItem which looks like this:

      http://i.stack.imgur.com/v2Jyz.png

      What i now want to do is to validate the ROUTENAME in the RouteItem. I have to make sure that the routname does not already exists in the selected Facility.

      My validation code looks like this:

      IEnumerable<RouteItem> items = this.DataWorkspace.dsMESOracle.dtRoutes.GetQuery().Execute();

      if (this.Details.EntityState == EntityState.Added)
      {
      items = items.Where(e => e.ROUTENAME == ROUTENAME && e.MES_FACILITY == MES_FACILITY);
      if (items.Count() > 0)
      {
      results.AddPropertyError(ValidationMsgRes.ROUTES_ROUTENAME_ALREADY_EXISTS);

      }
      }
      else if (this.Details.EntityState == EntityState.Modified)
      {
      //Ignore the current entity if its modified otherwise it will always get count > 0
      items = items.Where(e => e.ROUTENAME == ROUTENAME && e.MES_FACILITY == MES_FACILITY && e != this);
      if (items.Count() > 0)
      {
      results.AddPropertyError(ValidationMsgRes.ROUTES_ROUTENAME_ALREADY_EXISTS);

      }
      }

      So far the validation logic works perfect - it does what it should.
      The main problem is that accessing the this.MES_FACILITY leads to the following error if lightswitch tries to save / update the changes:

      http://i.stack.imgur.com/aCVbt.png

      the error also occurs if i ONLY write acilityItem temp = this.MES_FACILITY; in the validation implementation.
      If i remove the all references / accesses what ever to this.MES_FACILITY in the validation implementation everything works perfect.
      It also doesn't matter if validation is true or false. The problem always occurs!

      PS: The Problem also occurs with other entities and foreign keys its not a problem of the RouteItem - FacilityItem combination
        • 1. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
          gdarling - oracle
          I know nothing about lightswitch, but for generic pls-103, I'd start by enabling odp.net tracing and/or sqlnet tracing to find out what the exact sql statement sent to the database is that results in the failure.

          It's possible, even likely I suppose, that you're running into bug 13652493, which is fixed in 11203 patch 5 and higher.
          Bug 13652493: EF: INCORRECT PL/SQL ANONYMOUS BLOCK IS GENERATED FOR UPDATE

          Greg
          • 2. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
            950274
            gdarling wrote:
            I know nothing about lightswitch, but for generic pls-103, I'd start by enabling odp.net tracing and/or sqlnet tracing to find out what the exact sql statement sent to the database is that results in the failure.

            It's possible, even likely I suppose, that you're running into bug 13652493, which is fixed in 11203 patch 5 and higher.
            Bug 13652493: EF: INCORRECT PL/SQL ANONYMOUS BLOCK IS GENERATED FOR UPDATE

            Greg
            Hello and thanks for your reply.

            I activated the trace functionality and found the following

            TIME:2012/07/19-08:44:29:451 TID:16c0 OpsSqlPrepare2(): SQL: declare :p int
            update "MES_ADMIN"."MES_FACILITY"
            set :p = 0
            where ((("FACILITYID" = :p0) and ("FACILITYNAME" = :p1)) and ("LOTDEFCHAR" = :p2))

            TIME:2012/07/19-08:44:29:451 TID:16c0 (EXIT) OpsSqlPrepare2(): RetCode=0 Line=547
            TIME:2012/07/19-08:44:29:451 TID:16c0 (ENTRY) OpsSqlExecuteNonQuery(): (6cc70f0)=114061552
            TIME:2012/07/19-08:44:29:451 TID:16c0 (ENTRY) OpsDecGetValCtxFromInteger()
            TIME:2012/07/19-08:44:29:451 TID:16c0 (EXIT) OpsDecGetValCtxFromInteger(): RetCode=0 Line=847
            TIME:2012/07/19-08:44:29:458 TID:16c0 (ENTRY) OpsSqlFreeCtx()
            TIME:2012/07/19-08:44:29:458 TID:16c0 (EXIT) OpsSqlFreeCtx(): RetCode=0 Line=163
            TIME:2012/07/19-08:44:29:458 TID:16c0 (EXIT) OpsSqlExecuteNonQuery(): RetCode=-1 Line=873
            TIME:2012/07/19-08:44:29:458 TID:16c0 (ENTRY) OpsErrGetOpoCtx()
            TIME:2012/07/19-08:44:29:458 TID:16c0 (ERROR) Oracle error code=6550; Oracle msg=ORA-06550: line 1, column 9:
            PLS-00103: Encountered the symbol "" when expecting one of the following:

            begin function pragma procedure subtype type <an identifier>
            <a double-quoted delimited-identifier> current cursor delete
            exists prior

            TIME:2012/07/19-08:44:29:458 TID:16c0 (EXIT) OpsErrGetOpoCtx(): RetCode=0 Line=137
            TIME:2012/07/19-08:44:29:607 TID:16c0 (ENTRY) OracleConnection::Close()
            TIME:2012/07/19-08:44:29:608 TID:16c0 (EXIT) OracleConnection::Close()
            TIME:2012/07/19-08:44:29:608 TID:16c0 (ENTRY) OracleConnection::Dispose()
            TIME:2012/07/19-08:44:29:608 TID:16c0 (ENTRY) OpsConFreeValCtx()
            TIME:2012/07/19-08:44:29:608 TID:16c0 (EXIT) OpsConFreeValCtx(): RetCode=0 Line=1329
            TIME:2012/07/19-08:44:29:608 TID:16c0 (EXIT) OracleConnection::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsSqlFreeValCtx()
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsSqlFreeValCtx(): RetCode=0 Line=247
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsErrFreeCtx()
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsErrFreeCtx(): RetCode=0 Line=224
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsConRelRef(): (6cc70f0)=114061552
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsConRelRef(): RefCount=7 RetCode=0 Line=3507 (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsConRelRef(): (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (WARN) OpsConRelRef(): Null ptr: (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsConRelRef(): RetCode=1 Line=3376 (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsConRelRef(): (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (WARN) OpsConRelRef(): Null ptr: (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsConRelRef(): RetCode=1 Line=3376 (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID:12e0 (ENTRY) OpsGetAvailPhysMemory()
            TIME:2012/07/19-08:44:32:974 TID:12e0 (EXIT) OpsGetAvailPhysMemory(): returnValue=0 Line=1068
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OracleDataReader::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OracleDataReader::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OracleCommand::Dispose()
            TIME:2012/07/19-08:44:32:974 TID: 94c (ENTRY) OpsConRelRef(): (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (WARN) OpsConRelRef(): Null ptr: (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OpsConRelRef(): RetCode=1 Line=3376 (0)=0
            TIME:2012/07/19-08:44:32:974 TID: 94c (EXIT) OracleCommand::Dispose()

            I don't know why he is trying to update the facility when im trying to a add a route?1
            • 3. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
              950274
              Thanks very much!
              Your tip dit it!

              Here is my workaround for that without installing the patch:


              http://msdn.microsoft.com/en-us/library/bb738618.aspx
              http://knowledgebase.progress.com/articles/Article/000028868

              Workaround
              1. Clean whole solution
              2. Search the whole solution / project folder (in Explorer not in VisualStudio or by using Notepad++) for ConcurrencyMode="Fixed" and remove it
              3. Rebuild solution
              4. Be happy!

              It worked for me :)
              • 4. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
                Sergey Barskiy
                How can I see the bug details and download the patch?
                Thanks.
                • 5. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
                  Alex.Keh .Product.Manager-Oracle
                  You will need a My Oracle Support login, which your DBA should be able to provide.

                  1) Go to http://support.oracle.com
                  2) Log in with your My Oracle Support info
                  3) Click on the Patches and updates tab
                  4) Search for patch 14313388 (32-bit) or patch 14313389 (x64)

                  That patch is the ninth patch for 11.2.0.3, which should have the same fix as Patch 5, but with more fixes.

                  If you are applying this fix on an ODAC install from OTN, there's some additional instructions for applying either Patch 9 or Patch 5, which you can read here:
                  https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?id=1452585.1&type=DOCUMENT&displayIndex=2
                  • 6. Re: PLS-00103: Encountered the symbol “” when expecting one of the following:
                    Sergey Barskiy
                    This indeed solved the problem. The only DLLs that needed to be patched the patch 9 were oraociei11.dll and Oracle.DataAccess.dll. The second one had to be GAC'ed

                    Thanks.