Esempio n. 1
0
  /**
   * Adds the Values to this insertStatement. If also a SelectStatement is added, the Select has
   * precedence to the values. This function expects a vector of LValues. The size of the vector
   * must match the number of the columns defined.
   */
  public void addValues(Vector v) throws tinySQLException {
    if (v.size() != columns.size())
      throw new tinySQLException("Columns-Size does not match values-size");

    Vector sourceCols = new Vector();
    for (int i = 0; i < columns.size(); i++) {
      tsColumn target_col = (tsColumn) columns.elementAt(i);
      tsColumn source_col = new tsColumn(target_col.getPhysicalName(), (LValue) v.elementAt(i));
      source_col.setAll(target_col);
      sourceCols.addElement(source_col);
    }

    tsResultRow expressed = new tsResultRow(sourceCols);
    values.add(expressed);
  }