Excute IQueryResult not work

2 posts, 0 answers
  1. Phạm Quang
    Phạm Quang avatar
    2 posts
    Member since:
    Aug 2012

    Posted 09 Aug 2012 Link to this post

    Hi all,
    I have proplem. This is my code:
    string strQuery = "SELECT mmsi,nvl(imo,0),nvl(name,''),nvl(callsign,''),country_id,nvl(type_id,0),nvl(length,0),nvl(width,0),nvl(draugth,0),cog,sog,rot, longitude,latitude,nvl(status_id,0),nvl(heading,0),eta,nvl(destination,''),last_received " +
                "FROM table(ais_vessel_pkg.get_vessels(P_FIRST=>?,P_LAST=>?,P_LONG_FIRST=>?, P_LONG_LAST=>?,P_MMSIS=>?,P_SOURCE=>?))";
            long lAgentID = 0;
    if (!string.IsNullOrEmpty(agentID)) {
    lAgentID = Convert.ToInt64(agentID);
    }

              IQuery query = scope.GetSqlQuery(strQuery, null, "DATE p_first,DATE p_last ,number p_long_first,number p_long_last,VARCHAR2 p_mmsis,number p_source");
            var queryResult = query.Execute(first, last, 0, 0, mmsis, lAgentID);
      
    foreach (object[] obj in queryResult)
                    {
                        ......
                    }


    But it is to stand forever line "foreach (object[] obj in queryResult) ". Please !, help me
    "
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 09 Aug 2012 Link to this post

    Could it be that the function get_vessels is not returning in time?
    Also, please verify if the SQL should not be :

    string strQuery = "SELECT mmsi,nvl(imo,0),nvl(name,''),nvl(callsign,''),country_id,nvl(type_id,0),nvl(length,0),nvl(width,0),nvl(draugth,0),cog,sog,rot, longitude,latitude,nvl(status_id,0),nvl(heading,0),eta,nvl(destination,''),last_received " +
    "FROM table(ais_vessel_pkg.get_vessels(P_FIRST=?,P_LAST=?,P_LONG_FIRST=?, P_LONG_LAST=?,P_MMSIS=?,P_SOURCE=?))";

    (> erased)


    Kind regards,
    Thomas
    the Telerik team
    OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
  3. DevCraft banner
Back to Top