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


Constructor Index

 o ZInsert(String)
Create an INSERT statement on a given table

Method Index

 o addColumns(Vector)
Specify which columns to insert
 o addValueSpec(ZExp)
Specify the VALUES part or SQL sub-query of the INSERT statement
 o getQuery()
Get the sub-query (ex.
 o getValues()
Get the VALUES part of the INSERT statement
 o toString()

Constructors

 o ZInsert
 public ZInsert(String tab)
Create an INSERT statement on a given table

Methods

 o addColumns
 public void addColumns(Vector c)
Specify which columns to insert

Parameters:
c - A vector of column names (Strings)
 o 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.
 o 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).
 o 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).
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index