Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
6 replies Latest Post - ‏2013-07-31T07:17:58Z by paoloc
paoloc
paoloc
521 Posts
ACCEPTED ANSWER

Pinned topic Error EGL0504E

‏2013-07-22T17:11:43Z |

Hi Mark how are you?

I get the error:

EGL0504E GET: "MESSAGGI.MECODORG" non è valido nel contesto in cui viene utilizzato.. SQLCODE=-206, SQLSTATE=42703, DRIVER=3.63.75[sqlstate:42703][sqlcode:-206]
EGL0002I L'errore si è verificato in quantiMessaggi durante l'elaborazione della funzione messUrgenti.

when I run the project on another server different from that of development.

The code into the function messUrgenti is autogenerated:

get messaggi with
#sql{
select
MESSAGGI.MECODORG, MESSAGGI.MEUTEINP, 
MESSAGGI.MEUTEOUT, MESSAGGI.MEDATE, MESSAGGI.MESPERIC, 
MESSAGGI.METESTO, MESSAGGI.METIPO, MESSAGGI.MESTATO, 
MESSAGGI.MEOGGETTO, MESSAGGI.MECOGNOME
from X.MESSAGGI
where MESSAGGI.MECODORG=:organizzazione
and MESSAGGI.MEUTEOUT=:questoutente
and MESSAGGI.METIPO=:tipoMessaggio
and MESSAGGI.MESTATO <>:cancellati
and MESSAGGI.MESTATO <>:cancMittente
order by
MESSAGGI.MECODORG, MESSAGGI.MEUTEINP, 
MESSAGGI.MEUTEOUT, MESSAGGI.MEDATE, MESSAGGI.MESPERIC asc
};

What is the problem?

paoloc

  • mohaIBMDK
    mohaIBMDK
    19 Posts
    ACCEPTED ANSWER

    Re: Error EGL0504E

    ‏2013-07-22T22:44:54Z  in response to paoloc

    Hi Paoloc

    I think you need to add the: INTO ..... and the FOR .............. some SQLrecord........... parts of the statement.

    Hope it helps

    Morten Hansen

    IBM Denmark

    • paoloc
      paoloc
      521 Posts
      ACCEPTED ANSWER

      Re: Error EGL0504E

      ‏2013-07-23T06:49:55Z  in response to mohaIBMDK

      Hej Morten,

      Jag svara dig på svenska därför att min engelska är väldig dolingt.

      Tack för tipsen du gav mig men om jag fattat rätt jag måste ändra för hand undratals "get" instruktioner jag har i min projekt. Detta skulle betyda att EGL är fullkomling oandvändbar.

      Detta är omöjligt ! 

      Den rätta lösningen måste finnas i DB2 eller i context.xml file (Jag använder Tomcat i utväckling av projekten).

      Kan du föreslå  någon annan lösnig?

      tack paoloc

  • Sune
    Sune
    10 Posts
    ACCEPTED ANSWER

    Re: Error EGL0504E

    ‏2013-07-24T13:29:33Z  in response to paoloc

    Hi Paoloc

    Have you checked the defiinition of the table MESSAGGI on the server you are connecting to?

    Does the table contain the column MECODORG?

    Best regards

    Sune

    • paoloc
      paoloc
      521 Posts
      ACCEPTED ANSWER

      Re: Error EGL0504E

      ‏2013-07-26T07:48:19Z  in response to Sune

      Sune!

      Here the record definition on EGL:

      record Messaggi type sqlRecord { 
              tablenames=[["X.MESSAGGI"]],
              keyItems=[MECODORG, MEUTEINP, MEUTEOUT, MEDATE, MESPERIC]
          }  
       
      MECODORG MECODORG {column="MESSAGGI.MECODORG", sqlVariableLen=yes, maxLen=10};
      MEUTEINP MEUTEINP {column="MESSAGGI.MEUTEINP", sqlVariableLen=yes, maxLen=10};
      MEUTEOUT MEUTEOUT {column="MESSAGGI.MEUTEOUT", sqlVariableLen=yes, maxLen=10};
      MEDATE MEDATE {column="MESSAGGI.MEDATE"};
      MESPERIC MESPERIC {column="MESSAGGI.MESPERIC", sqlVariableLen=yes, maxLen=2};
      METESTO METESTO {column="MESSAGGI.METESTO", sqlVariableLen=yes, maxLen=1000, isSqlNullable=yes};
      METIPO METIPO {column="MESSAGGI.METIPO", sqlVariableLen=yes, maxLen=2, isSqlNullable=yes};
      MESTATO MESTATO {column="MESSAGGI.MESTATO", sqlVariableLen=yes, maxLen=2, isSqlNullable=yes};
      MEoggetto MEoggetto {column="MESSAGGI.MEOGGETTO", sqlVariableLen=yes, maxLen=60, isSqlNullable=yes};
      MEcognome MEcognome {column="MESSAGGI.MECOGNOME", sqlVariableLen=yes, maxLen=30, isSqlNullable=yes};
      end
       
      record MessaggiSearch
      MECODORG MECODORG?;
      MEUTEINP MEUTEINP?;
      MEUTEOUT MEUTEOUT?;
      MEDATE MEDATE?;
      MESPERIC MESPERIC?;
      METESTO METESTO?;
      METIPO METIPO?;
      MESTATO MESTATO?;
      MEoggetto MEoggetto?;
      MEcognome MEcognome?;
      end 
      • markevans
        markevans
        2778 Posts
        ACCEPTED ANSWER

        Re: Error EGL0504E

        ‏2013-07-29T21:13:38Z  in response to paoloc

        As Sune suggested, I would double check on that the x.messagi table itself contains the column MECODORG.   I also found this as a reason in the IBM i docs.

         

        If the column was intended to be a correlated reference, qualify the column with the correct table designator.

         

        I am not sure what a correlated reference is, but in this case you are qualifying the reference with a table name.  Maybe the table is not setup the same way on the new system and it does not like the qualified names.

        • paoloc
          paoloc
          521 Posts
          ACCEPTED ANSWER

          Re: Error EGL0504E

          ‏2013-07-31T07:17:58Z  in response to markevans

          This is the DDL for the table:

           
           
          CREATE TABLE "X       "."MESSAGGI"  (
           
           "MECODORG" VARCHAR(10) NOT NULL , 
           
           "MEUTEINP" VARCHAR(10) NOT NULL , 
           
           "MEUTEOUT" VARCHAR(10) NOT NULL , 
           
           "MEDATE" TIMESTAMP NOT NULL , 
           
           "MESPERIC" VARCHAR(2) NOT NULL , 
           
           "METESTO" VARCHAR(1000) , 
           
           "METIPO" VARCHAR(2) , 
           
           "MESTATO" VARCHAR(2) , 
           
           "MEOGGETTO" VARCHAR(60) , 
           
           "MECOGNOME" VARCHAR(30) )   
           
          IN "USERSPACE1" ; 
           
           
           
          COMMENT ON TABLE "X       "."MESSAGGI" IS 'Archivio messaggi';
           
           
           
           
           
          -- Istruzioni DDL per le chiavi primarie su tabella "X       "."MESSAGGI"
           
           
           
          ALTER TABLE "X       "."MESSAGGI" 
           
          ADD CONSTRAINT "CC1265191676672" PRIMARY KEY
           
          ("MECODORG",
           
          "MEUTEINP",
           
          "MEUTEOUT",
           
          "MEDATE",
           
          "MESPERIC");

           

          All seems OK,

          The ONLY procedure to solve the problem is:

          - delete the project

          - restore the last working saved  Archive file (namely that of the night before exactly identical to that with error)

          Thanks all for your interest

          paoloc