tablename length

hi!

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

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

it returned null.

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

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

	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?

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)
}

Rogel,

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

Rob

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? =)

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? :)

Yes,

Rob

rgansevles:
Yes,

Rob

Thanks Rob!