From 517ad9d4b6eae320b708d03a9340a22893b0cab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 29 Jan 2023 15:45:51 +0100 Subject: New upstream version 4.0.3 --- src/sql/xbinsert.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/sql/xbinsert.cpp') diff --git a/src/sql/xbinsert.cpp b/src/sql/xbinsert.cpp index 1095202..835f9e6 100755 --- a/src/sql/xbinsert.cpp +++ b/src/sql/xbinsert.cpp @@ -52,13 +52,13 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ if( !dbf ){ if(( iRc = xbase->OpenHighestVersion( sTableName, "", &dbf )) != XB_NO_ERROR ){ - iErrorStop = 10; + iErrorStop = 100; throw iRc; } } - + if( !dbf ){ - iErrorStop = 20; + iErrorStop = 110; iRc = XB_FILE_NOT_FOUND; throw iRc; } @@ -78,7 +78,7 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ // verify there are the same count in the field list and values list if( iFldCnt != iDataCnt ){ - iErrorStop = 30; + iErrorStop = 120; iRc = XB_SYNTAX_ERROR; throw iRc; } @@ -90,11 +90,11 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ sFieldName.ExtractElement( sFieldList, ',', i, 0 ); sFieldName.Trim(); if(( iRc = dbf->GetFieldNo( sFieldName, iFldNo )) != XB_NO_ERROR ){ - iErrorStop = 40; + iErrorStop = 130; throw iRc; } if(( iRc = dbf->GetFieldType( iFldNo, cFldType )) != XB_NO_ERROR ){ - iErrorStop = 50; + iErrorStop = 140; throw iRc; } @@ -113,7 +113,7 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ case 'N': case 'L': if(( iRc = dbf->PutField( iFldNo, sFieldData )) != XB_NO_ERROR ){ - iErrorStop = 100; + iErrorStop = 150; throw iRc; } break; @@ -121,7 +121,7 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ case 'D': // assumes input date format of yyyy-mm-dd if( sFieldData.Len() != 10 || sFieldData[5] != '-' || sFieldData[8] != '-' ){ - iErrorStop = 110; + iErrorStop = 160; iRc = XB_INVALID_DATA; throw iRc; } @@ -129,7 +129,7 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ sWork1.Remove( 8, 1 ); sWork1.Remove( 5, 1 ); if(( iRc = dbf->PutField( iFldNo, sWork1 )) != XB_NO_ERROR ){ - iErrorStop = 120; + iErrorStop = 170; throw iRc; } break; @@ -140,14 +140,14 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ break; default: - iErrorStop= 150; + iErrorStop= 180; iRc = XB_INVALID_FIELD_TYPE; throw iRc; } } if(( iRc = dbf->AppendRecord()) != XB_NO_ERROR ){ - iErrorStop = 300; + iErrorStop = 190; throw iRc; } @@ -159,17 +159,17 @@ xbInt16 xbSql::SqlInsert( const xbString &sCmdLine ){ iFldNo = llN->GetKey(); sFieldData = llD->GetKey(); if(( iRc = dbf->UpdateMemoField( iFldNo, sFieldData )) != XB_NO_ERROR ){ - iErrorStop = 400; + iErrorStop = 200; throw iRc; } llN = llN->GetNextNode(); llD = llD->GetNextNode(); } - if(( iRc == dbf->Commit()) != XB_NO_ERROR ){ - iErrorStop = 500; - throw iRc; - } + if(( iRc = dbf->Commit()) != XB_NO_ERROR ){ + iErrorStop = 210; + throw iRc; + } } catch (xbInt16 iRc ){ xbString sMsg; -- cgit v1.2.3