All Packages Class Hierarchy This Package Previous Next Index
Class Zql.ZInsert
java.lang.Object
|
+----Zql.ZInsert
- public class ZInsert
- extends Object
- implements ZStatement
ZInsert: an SQL INSERT statement
-
ZInsert(String)
- Create an INSERT statement on a given table
-
addColumns(Vector)
- Specify which columns to insert
-
addValueSpec(ZExp)
- Specify the VALUES part or SQL sub-query of the INSERT statement
-
getQuery()
- Get the sub-query (ex.
-
getValues()
- Get the VALUES part of the INSERT statement
-
toString()
-
ZInsert
public ZInsert(String tab)
- Create an INSERT statement on a given table
addColumns
public void addColumns(Vector c)
- Specify which columns to insert
- Parameters:
- c - A vector of column names (Strings)
addValueSpec
public void addValueSpec(ZExp e)
- Specify the VALUES part or SQL sub-query of the INSERT statement
- Parameters:
- e - An SQL expression or a SELECT statement.
If it is a list of SQL expressions, e should be represented by ONE
SQL expression with operator = "," and operands = the expressions in
the list.
If it is a SELECT statement, e should be a ZQuery object.
getValues
public Vector getValues()
- Get the VALUES part of the INSERT statement
- Returns:
- A vector of SQL Expressions (ZExp objects);
If there's no VALUES but a subquery, returns null (use getQuery() method).
getQuery
public ZQuery getQuery()
- Get the sub-query (ex. "INSERT INTO table1 SELECT * FROM table2;", the
sub-query is "SELECT * FROM table2;")
- Returns:
- A ZQuery object (A SELECT statement), or null if there's no
sub-query (in that case, use the getValues() method to get the VALUES
part).
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index