most of the get...Value() methods throw exception No signature of method

DbSchema SQL Editor
Post Reply
fxerkan
Posts: 11
Joined: Mon Nov 12, 2018 10:18 am

most of the get...Value() methods throw exception No signature of method

Post by fxerkan » Tue Jan 15, 2019 8:34 am

Hi
I'm try to list/change the table/column properties but faced problem most of the "get...()" type methods usage.

For Example :
I'm trying to get Default Value of a column and will be change it with another value but this simple script gives below error.

"java.lang.Exception: groovy.lang.MissingMethodException: No signature of method: com.wisecoders.dbs.schema.Column.getDefaultValue​() is applicable for argument types: () values: []
Possible solutions: getDefaultValue(), setDefaultValue(java.lang.String), hasDefaultValue(), getDefaultKey()"
what is the meaning of this exception? I'm already using the getDefaultValue() method what is the difference?

You can also find the sample script below and if you need you can download the DBS project file via https://www.dropbox.com/s/pw141ol6x1kfstr/Tester.dbs?dl=0

Code: Select all

import com.wisecoders.dbs.schema.*;

//Schemas 
for (sch in project.schemas)
{
	//Tables 
	for (tbl in sch.tables)
	{
		println "Table : " + tbl.getName();

		//Columns
		for (col in tbl.columns)
		{
			println "Column : " + col.getName();
			//println "Column getDataTypeString : " + col.getDataTypeString​()​;
			println "Column getDefaultValue​() : " + col.getDefaultValue​();
			//col.setDefaultValue( "-1" );
			
			if (col.getName() == "INSERT_TIME_WO_DEFAULT")
				col.setDefaultValue( "getdate()" );

		}


	}
}
Image



Can you please help about this issue?
And please add more relevant/explanatory descriptions for each method with Sample usage or script at your documentation.

Post Reply