Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Clearing a database.

3 posts in General Discussion Last posting was on 2009-10-22 19:25:17.0Z
A. Posted on 2009-10-20 19:28:27.0Z
Sender: 4de8.4ade0eaf.1804289383@sybase.com
From: A.
Newsgroups: ianywhere.public.general
Subject: Clearing a database.
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4ade0f5b.4e16.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 20 Oct 2009 12:28:27 -0700
X-Trace: forums-1-dub 1256066907 10.22.241.41 (20 Oct 2009 12:28:27 -0700)
X-Original-Trace: 20 Oct 2009 12:28:27 -0700, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7769
Article PK: 6808

I have a database that has a lot of data in it, can i
somehow clear all the data through sybase central or so? I
do not have much programming skills, but good IT skills.

Thanks
A


Josh Savill [Sybase] Posted on 2009-10-22 18:54:49.0Z
From: "Josh Savill [Sybase]" <no_spam_jsavill_no_spam@sybase.com>
Organization: Sybase iAnywhere
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Clearing a database.
References: <4ade0f5b.4e16.1681692777@sybase.com>
In-Reply-To: <4ade0f5b.4e16.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4ae0aa79$1@forums-1-dub>
Date: 22 Oct 2009 11:54:49 -0700
X-Trace: forums-1-dub 1256237689 10.22.241.152 (22 Oct 2009 11:54:49 -0700)
X-Original-Trace: 22 Oct 2009 11:54:49 -0700, vip152.sybase.com
Lines: 18
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7774
Article PK: 6810

Can I ask what you're attempting to accomplish?

You can use the TRUNCATE statement to delete all the rows from a table without deleting the table
definition:
http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1101en%2Fdbreference_en11%2Ftruncate-statement.html

--
Joshua Savill
Sybase Inc. - Product Manager

A. wrote:
> I have a database that has a lot of data in it, can i
> somehow clear all the data through sybase central or so? I
> do not have much programming skills, but good IT skills.
>
> Thanks
> A


Breck Carter [TeamSybase] Posted on 2009-10-22 19:25:17.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__breck.carter@gmail.com>
Newsgroups: ianywhere.public.general
Subject: Re: Clearing a database.
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__breck.carter@gmail.com
Message-ID: <dib1e51iu6ountp24l0ooi0lqdt096ecqg@4ax.com>
References: <4ade0f5b.4e16.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 22 Oct 2009 12:25:17 -0700
X-Trace: forums-1-dub 1256239517 10.22.241.152 (22 Oct 2009 12:25:17 -0700)
X-Original-Trace: 22 Oct 2009 12:25:17 -0700, vip152.sybase.com
Lines: 41
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7775
Article PK: 6811

The fastest way would be to create a new database with exactly the
same schema but no data.

Here are Windows commands for doing this via SQL Anywhere 11 dbunload
-n to create a schema definition file with no data, dbinit to create a
new database file, dbeng11 to start the new database and dbisql to run
the schema file created by dbunload:

"%SQLANY11%\bin32\dbunload.exe"^
-c "ENG=mem;DBN=mem;UID=dba;PWD=sql"^
-n^
-r reload_schema.sql

"%SQLANY11%\bin32\dbinit.exe"^
mem2.db

"%SQLANY11%\bin32\dbspawn.exe"^
-f^
"%SQLANY11%\bin32\dbeng11.exe"^
mem2.db

"%SQLANY11%\bin32\dbunload.exe"^
-c "ENG=mem2;DBN=mem2;UID=dba;PWD=sql"^
READ reload_schema.sql

On 20 Oct 2009 12:28:27 -0700, A. wrote:

>I have a database that has a lot of data in it, can i
>somehow clear all the data through sybase central or so? I
>do not have much programming skills, but good IT skills.
>
>Thanks
>A

--
Breck Carter http://sqlanywhere.blogspot.com/

RisingRoad SQL Anywhere and MobiLink Professional Services
breck.carter@risingroad.com