Home News DOC Class DL Others Rice
Class  >  connection  >  RenameTable(string,string)
connection class : RenameTable(string,string) method

Description

Changes the table name.

Syntax

instance.RenameTable(string oldname, string newname)

Arguments

ClassNameDescription
stringoldnameOld name.
stringnewnameNew name.

Return value

None.

Sample code

1:

connection cnn = new connection("Data Source=c:\somedirectory\somedatabase.sqlite3;Version=3;");

2:

cnn.Open();

3:

dictionary{string} ds;

4:

ds.Add("ids","integer");

5:

ds.Add("textdata","text");

6:

// create table example_tbl(ids integer, textdata text);

7:

cnn.CreateTable("example_tbl", ds);

8:

// alter table example_tbl rename to new_example_tbl;

9:

cnn.RenameTable("example_tbl", "new_example_tbl");

10:

cnn.Close();

11:

cnn.Release();

Notes

Creates and executes an ALTER TABLE statement. In the above sample code, the following SQL statement will be created.

alter table example_tbl rename to new_example_tbl;

Links for reference

None.

Copyright © Rice All rights reserved.