10-09-2003
not sure about progress databases but in Oracle, the truncate command is used to remove data from a table. Truncate is different from a delete in one important way, you cannot recover the data once the truncate command is submitted (you cannot rollback) but you can rollback your session after a delete (assuming you havent committed your changes).
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have AIX5.1
I have been trying to learn how to truncate the /var/adm/wtmp file.
I have seen several things on google actually but don't quite understand. I also searched your forums but couldn't find it.
one says this ">/var/adm/wtmp
Is that all I do?
I have a seperate question also. I was... (1 Reply)
Discussion started by: rocker40
1 Replies
2. Shell Programming and Scripting
Hello everybody it's me again.
I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence?
in the process are an... (1 Reply)
Discussion started by: Lestat
1 Replies
3. Shell Programming and Scripting
I have one file which first line is blank and second line has some data.
$cat filename
output:
30-MAY-07
I want to store 30-MAY-07 value in one variable.
for that I wrote
var="`head -2 filename`"
It will give that result but I want to truncate the first line which is blank.
plz help. (2 Replies)
Discussion started by: rinku
2 Replies
4. UNIX for Advanced & Expert Users
I have a file in which I need to truncate 15th field to have only one character
like Put --> P
and if i have no value in 15th field, it should be "O" (Other)
would really appreciate the reponses, thnx in advance:b: (2 Replies)
Discussion started by: sannmayaz
2 Replies
5. UNIX for Dummies Questions & Answers
I am using FC6 just in case it matters, though i hope it doesn't.
If i have a file or some files that i want to truncate the filename of, so that it is only a certain number of characters in length, how would i do that on the command line?
Also, just to make it more interesting, say i... (11 Replies)
Discussion started by: Calum
11 Replies
6. Shell Programming and Scripting
Hi
In unix able to connect to oracle database and create table ,when rerun ,if table exist ,truncate that table.Any idea how to do that
a.sh
----
sqlplus -s datadmin/password <<EOF
create table xx(col1 number,
col2...
);
exit;
EOF
I... (1 Reply)
Discussion started by: mohan705
1 Replies
7. Shell Programming and Scripting
Hello all.
I would like to make a script (or two shell scripts) that will do the following.
I need the maximum file name and directory name to be 38 characters long.
As well, if shortening the file name ends up making all of the files in that directory have the same name, then I would like... (9 Replies)
Discussion started by: marcozd
9 Replies
8. Shell Programming and Scripting
Hi,
I want to truncate a string variable, returned in the script. In perl I used the below and it worked.
BRNo=BR12345
$BR = substr($BRNo, 2, 7)
How can I do it in sh.
Thanks ! (8 Replies)
Discussion started by: script2010
8 Replies
9. UNIX for Advanced & Expert Users
Hello,
Given below are 2 sample paths from 2 different servers:
/opt/temp/PROD/Script/New/Letters
/opt/Share/temp/Share1/PROD/Script/Files/New/Letters
I would like to truncate the path till the folder "PROD". Please note that the field count of the folder "PROD" vaires from... (1 Reply)
Discussion started by: DawnNish
1 Replies
10. UNIX for Dummies Questions & Answers
hi All,
how to recover the truncate file in unix.
Thanks!:wall: (2 Replies)
Discussion started by: krbala1985
2 Replies
BEGIN(7) SQL Commands BEGIN(7)
NAME
BEGIN - start a transaction block
SYNOPSIS
BEGIN [ WORK | TRANSACTION ]
INPUTS
WORK
TRANSACTION
Optional keywords. They have no effect.
OUTPUTS
BEGIN This signifies that a new transaction has been started.
WARNING: BEGIN: already a transaction in progress
This indicates that a transaction was already in progress. The current transaction is not affected.
DESCRIPTION
By default, PostgreSQL executes transactions in unchained mode (also known as ``autocommit'' in other database systems). In other words,
each user statement is executed in its own transaction and a commit is implicitly performed at the end of the statement (if execution was
successful, otherwise a rollback is done). BEGIN initiates a user transaction in chained mode, i.e., all user statements after BEGIN com-
mand will be executed in a single transaction until an explicit COMMIT [commit(7)] or ROLLBACK [rollback(7)]. Statements are executed more
quickly in chained mode, because transaction start/commit requires significant CPU and disk activity. Execution of multiple statements
inside a transaction is also useful to ensure consistency when changing several related tables: other clients will be unable to see the
intermediate states wherein not all the related updates have been done.
The default transaction isolation level in PostgreSQL is READ COMMITTED, wherein each query inside the transaction sees changes committed
before that query begins execution. So, you have to use SET TRANSACTION ISOLATION LEVEL SERIALIZABLE just after BEGIN if you need more rig-
orous transaction isolation. (Alternatively, you can change the default transaction isolation level; see the PostgreSQL Administrator's
Guide for details.) In SERIALIZABLE mode queries will see only changes committed before the entire transaction began (actually, before
execution of the first DML statement in the transaction).
Transactions have the standard ACID (atomic, consistent, isolatable, and durable) properties.
NOTES
START TRANSACTION [start_transaction(7)] has the same functionality as BEGIN.
Use COMMIT [commit(7)] or ROLLBACK [rollback(7)] to terminate a transaction.
Refer to LOCK [lock(7)] for further information about locking tables inside a transaction.
If you turn autocommit mode off, then BEGIN is not required: any SQL command automatically starts a transaction.
USAGE
To begin a user transaction:
BEGIN WORK;
COMPATIBILITY
SQL92
BEGIN is a PostgreSQL language extension. There is no explicit BEGIN command in SQL92; transaction initiation is always implicit and it
terminates either with a COMMIT or ROLLBACK statement.
Note: Many relational database systems offer an autocommit feature as a convenience.
Incidentally, the BEGIN keyword is used for a different purpose in embedded SQL. You are advised to be careful about the transaction seman-
tics when porting database applications.
SQL92 also requires SERIALIZABLE to be the default transaction isolation level.
SQL - Language Statements 2002-11-22 BEGIN(7)