summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/file/FStatement.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/file/FStatement.cxx')
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx74
1 files changed, 23 insertions, 51 deletions
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 0d504a71d2be..c470b1b2c927 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -430,28 +430,18 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
aColumnName = pColumnRef->getChild(0)->getTokenValue();
else if (pColumnRef->count() == 3)
{
- // Nur die Table Range-Variable darf hier vorkommen:
-// if (!(pColumnRef->getChild(0)->getTokenValue() == aTableRange))
-// {
-// aStatus.Set(SQL_STAT_ERROR,
-// String::CreateFromAscii("S1000"),
-// aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_INVALID_RANGE_VAR))),
-// 0, String() );
- // return;
- // }
pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False );
}
else
{
- // aStatus.SetStatementTooComplex();
throw SQLException();
}
Reference<XColumnLocate> xColLocate(m_xColNames,UNO_QUERY);
if(!xColLocate.is())
return;
- // Alles geprueft und wir haben den Namen der Column.
- // Die wievielte Column ist das?
+ // Everything tested and we have the name of the Column.
+ // What number is the Column?
try
{
m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName));
@@ -579,7 +569,7 @@ void OStatement_Base::initializeResultSet(OResultSet* _pResult)
_pResult->setSelectRow(m_aSelectRow);
m_pSQLAnalyzer->bindSelectRow(m_aRow);
- m_pEvaluationKeySet = m_pSQLAnalyzer->bindEvaluationRow(m_aEvaluateRow); // Werte im Code des Compilers setzen
+ m_pEvaluationKeySet = m_pSQLAnalyzer->bindEvaluationRow(m_aEvaluateRow); // Set values in the code of the Compiler
_pResult->setEvaluationKeySet(m_pEvaluationKeySet);
}
// -----------------------------------------------------------------------------
@@ -593,11 +583,11 @@ void OStatement_Base::GetAssignValues()
}
if (SQL_ISRULE(m_pParseTree,select_statement))
- // Keine zu setzenden Werte bei SELECT
+ // no values have to be set for SELECT
return;
else if (SQL_ISRULE(m_pParseTree,insert_statement))
{
- // Row fuer die zu setzenden Werte anlegen (Referenz durch new)
+ // Create Row for the values to be set (Reference trough new)
if(m_aAssignValues.is())
m_aAssignValues->get().clear();
sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount();
@@ -607,7 +597,7 @@ void OStatement_Base::GetAssignValues()
m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER);
- // Liste der Columns-Namen, die in der column_commalist vorkommen (mit ; getrennt):
+ // List of Column-Names, that exist in the column_commalist (seperated by ;):
::std::vector<String> aColumnNameList;
OSL_ENSURE(m_pParseTree->count() >= 4,"OResultSet: Fehler im Parse Tree");
@@ -632,7 +622,7 @@ void OStatement_Base::GetAssignValues()
OSL_ENSURE(SQL_ISRULE(pColumnCommalist,column_commalist),"OResultSet: Fehler im Parse Tree");
OSL_ENSURE(pColumnCommalist->count() > 0,"OResultSet: Fehler im Parse Tree");
- // Alle Columns in der column_commalist ...
+ // All Columns in the column_commalist ...
for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++)
{
OSQLParseNode * pCol = pColumnCommalist->getChild(i);
@@ -643,19 +633,19 @@ void OStatement_Base::GetAssignValues()
if ( aColumnNameList.empty() )
throwFunctionSequenceException(*this);
- // Werte ...
+ // Values ...
OSQLParseNode * pValuesOrQuerySpec = m_pParseTree->getChild(4);
OSL_ENSURE(pValuesOrQuerySpec != NULL,"OResultSet: pValuesOrQuerySpec darf nicht NULL sein!");
OSL_ENSURE(SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec),"OResultSet: ! SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec)");
OSL_ENSURE(pValuesOrQuerySpec->count() > 0,"OResultSet: pValuesOrQuerySpec->count() <= 0");
- // nur "VALUES" ist erlaubt ...
+ // just "VALUES" is allowed ...
if (! SQL_ISTOKEN(pValuesOrQuerySpec->getChild(0),VALUES))
throwFunctionSequenceException(*this);
OSL_ENSURE(pValuesOrQuerySpec->count() == 4,"OResultSet: pValuesOrQuerySpec->count() != 4");
- // Liste von Werten
+ // List of values
OSQLParseNode * pInsertAtomCommalist = pValuesOrQuerySpec->getChild(2);
OSL_ENSURE(pInsertAtomCommalist != NULL,"OResultSet: pInsertAtomCommalist darf nicht NULL sein!");
OSL_ENSURE(pInsertAtomCommalist->count() > 0,"OResultSet: pInsertAtomCommalist <= 0");
@@ -669,7 +659,7 @@ void OStatement_Base::GetAssignValues()
OSL_ENSURE(pRow_Value_Const != NULL,"OResultSet: pRow_Value_Const darf nicht NULL sein!");
if(SQL_ISRULE(pRow_Value_Const,parameter))
{
- ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // kann nur ein Columnname vorhanden sein pro Schleife
+ ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // only one Columnname allowed per loop
}
else if(pRow_Value_Const->isToken())
ParseAssignValues(aColumnNameList,pRow_Value_Const,static_cast<xub_StrLen>(i));
@@ -703,7 +693,7 @@ void OStatement_Base::GetAssignValues()
OSL_ENSURE(SQL_ISRULE(pAssignmentCommalist,assignment_commalist),"OResultSet: Fehler im Parse Tree");
OSL_ENSURE(pAssignmentCommalist->count() > 0,"OResultSet: pAssignmentCommalist->count() <= 0");
- // Alle Zuweisungen (Kommaliste) bearbeiten ...
+ // work on all assignments (commalist) ...
::std::vector< String> aList(1);
for (sal_uInt32 i = 0; i < pAssignmentCommalist->count(); i++)
{
@@ -720,7 +710,6 @@ void OStatement_Base::GetAssignValues()
OSL_ENSURE(pComp->getNodeType() == SQL_NODE_EQUAL,"OResultSet: pComp->getNodeType() != SQL_NODE_COMPARISON");
if (pComp->getTokenValue().toChar() != '=')
{
- // aStatus.SetInvalidStatement();
throwFunctionSequenceException(*this);
}
@@ -745,19 +734,18 @@ void OStatement_Base::ParseAssignValues(const ::std::vector< String>& aColumnNam
pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_INTNUM ||
pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_APPROXNUM)
{
- // Wert setzen:
+ // set value:
SetAssignValue(aColumnName, pRow_Value_Constructor_Elem->getTokenValue());
}
else if (SQL_ISTOKEN(pRow_Value_Constructor_Elem,NULL))
{
- // NULL setzen
+ // set NULL
SetAssignValue(aColumnName, String(), TRUE);
}
else if (SQL_ISRULE(pRow_Value_Constructor_Elem,parameter))
parseParamterElem(aColumnName,pRow_Value_Constructor_Elem);
else
{
- // aStatus.SetStatementTooComplex();
throwFunctionSequenceException(*this);
}
}
@@ -771,35 +759,29 @@ void OStatement_Base::SetAssignValue(const String& aColumnName,
Reference<XPropertySet> xCol;
m_xColNames->getByName(aColumnName) >>= xCol;
sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY)->findColumn(aColumnName);
- // Kommt diese Column ueberhaupt in der Datei vor?
+ // does this column actually exist in the file?
if (!xCol.is())
{
- // Diese Column gibt es nicht!
-// aStatus.Set(SQL_STAT_ERROR,
-// String::CreateFromAscii("S0022"),
-// aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_COLUMN_NOT_FOUND))),
-// 0, String() );
+ // This Column doesn't exist!
throwFunctionSequenceException(*this);
}
- // Value an die Row mit den zuzuweisenden Werten binden:
- // const ODbVariantRef& xValue = (*aAssignValues)[pFileColumn->GetId()];
- // Alles geprueft und wir haben den Namen der Column.
- // Jetzt eine Value allozieren, den Wert setzen und die Value an die Row binden.
+ // Everything tested and we have the names of the Column.
+ // Now allocate one Value, set the value and tie the value to the Row.
if (bSetNull)
(m_aAssignValues->get())[nId]->setNull();
else
{
switch (::comphelper::getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
{
- // Kriterium je nach Typ als String oder double in die Variable packen ...
+ // put criteria depending on the Type as String or double in the variable
case DataType::CHAR:
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
*(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
- // Zeichensatz ist bereits konvertiert, da ja das gesamte Statement konvertiert wurde
+ //Characterset is already converted, since the entire statement was converted
break;
case DataType::BIT:
@@ -810,7 +792,6 @@ void OStatement_Base::SetAssignValue(const String& aColumnName,
*(m_aAssignValues->get())[nId] = sal_False;
else
{
- // aStatus.Set(SQL_STAT_ERROR); // nyi: genauer!
throwFunctionSequenceException(*this);
}
}
@@ -826,24 +807,15 @@ void OStatement_Base::SetAssignValue(const String& aColumnName,
case DataType::TIME:
case DataType::TIMESTAMP:
{
- *(m_aAssignValues->get())[nId] = ORowSetValue(aValue); // .ToDouble
-// try
-// {
-// double n = xValue->toDouble();
-// xValue->setDouble(n);
-// }
-// catch ( ... )
-// {
-// aStatus.SetDriverNotCapableError();
-// }
+ *(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
} break;
default:
throwFunctionSequenceException(*this);
}
}
- // Parameter-Nr. merken (als User Data)
- // SQL_NO_PARAMETER = kein Parameter.
+ // save Parameter-No. (as User Data)
+ // SQL_NO_PARAMETER = no Parameter.
m_aAssignValues->setParameterIndex(nId,nParameter);
if(nParameter != SQL_NO_PARAMETER)
m_aParameterIndexes[nParameter] = nId;