Executes a series of SQL statements on a database using Creole.
Statements can either be read in from a text file using the src attribute or from between the enclosing SQL tags.
Multiple statements can be provided, separated by semicolons (or the defined delimiter). Individual lines within the statements can be commented using either --, // or REM at the start of the line.
The autocommit attribute specifies whether auto-commit should be turned on or off whilst executing the statements. If auto-commit is turned on each statement will be executed and committed. If it is turned off the statements will all be executed as one transaction.
The onerror attribute specifies how to proceed when an error occurs during the execution of one of the statements. The possible values are: continue execution, only show the error; stop execution and commit transaction; and abort execution and transaction and fail task.
| author |
Hans Lellelid hans@xmpl.org (Phing) |
|---|---|
| author |
Jeff Martin jeff@custommonkey.org (Ant) |
| author |
Michael McCallum gholam@xtra.co.nz (Ant) |
| author |
Tim Stephenson tim.stephenson@sybase.com (Ant) |
| package |
phing.tasks.ext.creole |
| version |
$Id: f8f62d67a784faced2621d2ffc3b1c92e8703b05 $ |
setSrc(\PhingFile $srcFile)
addText($sql)
NB: Properties are not expanded in this text.
createFilterChain() : object
| access |
public |
|---|
objectThe created filterchain object
createTransaction()
setEncoding($encoding)
setDelimiter($delimiter)
For example, set this to "go" and delimitertype to "ROW" for Sybase ASE or MS SQL Server.
setDelimiterType(string $delimiterType)
string
setPrint(boolean $print)
boolean
setShowheaders(boolean $showheaders)
boolean
setOutput(\PhingFile $output)
setAppend(mixed $append)
mixed
setOnerror($action)
main()
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
runStatements(\Reader $reader, $out = null)
execSQL($sql, $out = null)
| throws | |
|---|---|
printResults($out = null)
| throws | |
|---|---|
init()
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
| throws |
|---|
setCaching(mixed $enable)
mixed
setUrl($url)
setDriver(string $driver)
stringdriver class name
setPassword($password)
setAutocommit($autocommit)
setVersion($version)
getLoaderMap()
getConnection() : \Connection
The calling method is responsible for closing the connection.
| throws |
if the UserId/Password/Url is not set or there is no suitable driver or the driver fails to load. |
|---|
\Connectionthe newly created connection.
isCaching($value)
isAutocommit() : \Returns
\Returnsa boolean
getUrl() : \Returns
\Returnsa String
getUserId() : \Returns
\Returnsa String
setUserid($userId)
getPassword() : \Returns
\Returnsa String
setOwningTarget(\Target $target)
getOwningTarget() : \Target
getTaskName() : string
stringName of this task
setTaskName(string $name) : string
string
stringA string representing the name of this task for log
getTaskType() : string
stringThe type of this task (XML Tag)
setTaskType($name)
getRegisterSlot(string $slotName)
string
log(string $msg, integer $level = \Project::MSG_INFO)
stringThe message to be logged.
integerThe message's priority at this message should have
setDescription(string $desc)
stringThe text describing the task
getDescription() : string
stringThe text description of the task
getLocation() : \Location
setLocation(\Location $location)
getRuntimeConfigurableWrapper() : \RuntimeConfigurable
setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)
maybeConfigure()
perform()
setProject(\Project $project)
getProject() : \Project
DELIM_ROW
DELIM_NORMAL
goodSql :
totalSql :
conn :
filesets :
filterChains :
statement :
srcFile :
sqlCommand :
transactions :
delimiter :
delimiterType :
print :
showheaders :
output :
onError :
encoding :
append :
loaderMap :
NOT IMPLEMENTED YET
caching :
autocommit :
driver :
| param | |
|---|---|
url :
userId :
password :
rdbms :
description : string
| var |
|---|
string
taskType : string
| var |
|---|
string
taskName : string
| var |
|---|
string
project : \Project