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.
2 replies Latest Post - ‏2014-04-16T11:50:26Z by David.Durand
David.Durand
David.Durand
12 Posts
ACCEPTED ANSWER

Pinned topic Nullable DB2 Fields

‏2014-04-09T13:41:35Z |

When I define orientDt like this:

orienDt date?{column = "T1.ORIEN_DT", IsReadOnly = yes, IsSqlNullable = yes} =null ;

I get a syntax error on the calling service and the program.

Service Call

callDD0001PRG1(DD0001WS);

Program Start

program DD0001PRG1 typeBasicProgram(DD0001WS DD0001WS){}

Error Message

IWN.VAL.4904.e 9/47 DD0001PRG1 - The type DD0001WS for this program parameter or call argument is invalid. It
is either an invalid type, or a record which contains an item of an invalid type. Reference types that are not arrays,
and items of type any, blob, or clob are not allowed. At line 9 in file \DavidTemp\EGLSource\sf\temp\david
\programs\DD0001PRG1.egl

I've run the program in DeBug and it is able to move data to the field with no problem.  Without the ? it doesn't show a syntax error but I'll get an error going to a RUI if the field is null.

orienDt date{column = "T1.ORIEN_DT", IsReadOnly = yes, IsSqlNullable = yes};

 Is this just an error with the syntax checker or is there a problem with the way I'm defining this field?

 

 

 

record DD0001WS typeBasicRecord
 ...
scheduledOrien schedREC[]{};
end

 record schedRED type SQLRecord{tableNames = [["XX.SRT_ORIEN_STU_STAT", "T1"],["XX.SRT_CTL_TERMS", "T2"],["XX.SRT_CTL_ORIEN", "T3"], ["XX.PHT_FDB_SITE", "T4"]], fieldsMatchColumns = yes}
orienDt date?{column = "T1.ORIEN_DT", IsReadOnly = yes, IsSqlNullable = yes} =null ;
orienBeginTm time{column = "T1.ORIEN_BEGIN_TM", IsReadOnly = yes, IsSqlNullable = yes};
orienEndTm time{column = "T3.ORIEN_END_TM", IsReadOnly = yes, IsSqlNullable = yes};
siteNam string{column = "T4.SITE_NAM", IsReadOnly = yes, IsSqlNullable = yes};
bldgRoom string{column = "BLDG_ROOM", IsReadOnly = yes, IsSqlNullable = yes};
termNumCd string{column = "T1.TERM_NUM_CD", IsReadOnly = yes, IsSqlNullable = yes};
sessionCd string{column = "T1.SESSION_CD", IsReadOnly = yes, IsSqlNullable = yes};
termYr string{column = "T1.TERM_YR", IsReadOnly = yes, IsSqlNullable = yes};
end

 

 

Updated on 2014-04-09T13:42:03Z at 2014-04-09T13:42:03Z by David.Durand
  • Jeff.Douglas
    Jeff.Douglas
    198 Posts
    ACCEPTED ANSWER

    Re: Nullable DB2 Fields

    ‏2014-04-16T01:57:25Z  in response to David.Durand

    According to the validation logic, it is complaining that the record contains a nullable (defined by ?) field as part of the passed record. This is not allowed as a program parameter.

    I am wondering why you would define that field as nullable (with a ?) when it is already defined as sqlnullable.

    • David.Durand
      David.Durand
      12 Posts
      ACCEPTED ANSWER

      Re: Nullable DB2 Fields

      ‏2014-04-16T11:50:26Z  in response to Jeff.Douglas

      Jeff,

      The "?" allows me to use the record in a service & RUI.  Without the "?" several data types will error when passing Nulls to the RUI.  Without the "= Null" at the end the RUI some will show a default value.  Having both of those on nullable fields was the only constant method I found to pass Null values regardless of datatype to a RUI.