# tablename length

**URL:** <https://forum.servoy.com/t/tablename-length/14800>\
**Category:** Classic Servoy\
**Created:** [October 4, 2011, 3:12am UTC](https://forum.servoy.com/t/tablename-length/14800 "2011-10-04T03:12:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [October 4, 2011, 3:12am UTC](https://forum.servoy.com/t/tablename-length/14800/1 "2011-10-04T03:12:58Z")

</div>

hi!

Is there a limitation as to the tablename length?  
When I used

```auto
var table = server.createNewTable("TEMP_assignment_has_customerperson");

```

it returned null.

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [October 7, 2011, 9:41am UTC](https://forum.servoy.com/t/tablename-length/14800/2 "2011-10-07T09:41:14Z")

</div>

rogel,

That should be ok, although some databases have short limits for table/column names.  
In server.createNewTable() the table is not created yet in the db, so this call does not return null unless some other error happened.

Check the logs, i expect an error saying that the table already exists.

Rob

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [October 10, 2011, 5:33am UTC](https://forum.servoy.com/t/tablename-length/14800/3 "2011-10-10T05:33:49Z")

</div>

> rgansevles:  
> rogel,
> 
> That should be ok, although some databases have short limits for table/column names.  
> In server.createNewTable() the table is not created yet in the db, so this call does not return null unless some other error happened.
> 
> Check the logs, i expect an error saying that the table already exists.
> 
> Rob

Hi Rob,

Sorry, the createNewTable() returned a JSTableObject. I tried the code below. using this parameter

```auto
	createTempTable(dbServerName,"assignment_has_customerperson",dbServerName,"T_assignment_has_customerperson")

```

We are using postgresql. The tempTableObject has the name “t\_assignment\_has\_customerperso”. Does servoy internally truncate the table name?

```auto
function createTempTable(sourceDB, tableName, destinationDB, tempTable) {
	
	var serverDestination = plugins.maintenance.getServer(destinationDB);		
	var tempTableObject = serverDestination.createNewTable(tempTable);
	var serverSource = plugins.maintenance.getServer(sourceDB);		
	var mainTable = serverSource.getTable(tableName);
	var mainTableColumns = mainTable.getColumnNames();
	
	for (var indexMainTableColumns = 0; indexMainTableColumns < mainTableColumns.length; indexMainTableColumns++) {
		var mainTableColumn = mainTable.getColumn(mainTableColumns[indexMainTableColumns])
		tempTableObject.createNewColumn(mainTableColumn.getSQLName(),mainTableColumn.getType(),mainTableColumn.getLength(),mainTableColumn.getAllowNull(),mainTableColumn.isRowIdentifier())
	}
	return serverDestination.synchronizeWithDB(tempTableObject)
}

```

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [October 10, 2011, 7:06am UTC](https://forum.servoy.com/t/tablename-length/14800/4 "2011-10-10T07:06:00Z")

</div>

Rogel,

It does indeed, the name is truncated to 30 characters.  
I have removed that for next (v6) release.

Rob

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [October 10, 2011, 5:05pm UTC](https://forum.servoy.com/t/tablename-length/14800/5 "2011-10-10T17:05:43Z")

</div>

> rgansevles:  
> Rogel,
> 
> It does indeed, the name is truncated to 30 characters.  
> I have removed that for next (v6) release.
> 
> Rob

Thanks! No pressure but may I know if there is a tentative date for the plan of the next release? =)

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [November 3, 2011, 12:38am UTC](https://forum.servoy.com/t/tablename-length/14800/6 "2011-11-03T00:38:17Z")

</div>

> rgansevles:  
> Rogel,
> 
> It does indeed, the name is truncated to 30 characters.  
> I have removed that for next (v6) release.
> 
> Rob

There is a release 6.0.2. Is this included? ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [November 8, 2011, 8:50am UTC](https://forum.servoy.com/t/tablename-length/14800/7 "2011-11-08T08:50:57Z")

</div>

Yes,

Rob

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [November 10, 2011, 4:42am UTC](https://forum.servoy.com/t/tablename-length/14800/8 "2011-11-10T04:42:00Z")

</div>

> rgansevles:  
> Yes,
> 
> Rob

Thanks Rob!
