Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NULL in numeric field

Status
Not open for further replies.

PavelGur

Programmer
Sep 21, 2001
75
0
0
I'm getting data from brokerage company that's supposed to be numeric. But actually it is not. I try to put it in the table and getting MS exception:
Code:
try
{
  pPRC->AddNew();
  pPRC->m_Stock = szStock;
  pPRC->m_Date = CTime::GetCurrentTime();
  pPRC->m_DayNum = iDayTrades;
  pPRC->m_Price = fPrice;
  pPRC->m_iTradeSize = iTradeSize;
  pPRC->m_lVolume = lVolume;
  pPRC->Update();
}

catch(CDBException* e)
{
  TRACE("Error %s for stock %s\n", e->m_strError, szStock);
  HandleError(e->m_strError, 
              e-strStateNativeOrigin, 
              "UpdateTables pPRC->AddNew/Update", szStock);
		goto ClosePrice;
}
I am getting "Numeric value out of range (null)". I have no idea which field is NULL. I need to inform broker.
All fields are either float or integer. I know there are functions to check whether string or character data is numeric. I did not find so far the function that will tell me whether numeric field is numeric. Any ideas?
Thank you, Pavel.
 
PavelGur said:
I did not find so far the function that will tell me whether numeric field is numeric
I'm not sure what you mean? What is the actual data type of the thing you are trying to validate? Is it an int, float, char*, class...?
 
To me it looks like you're missing to set at least one field that by default has a value of null...

------------------
When you do it, do it right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top