Child pages
  • JSTable

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSColumn]{td}{td}[#getColumn]\(name)
Returns a JSColumn for the named column.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getColumnNames]\()
Returns an array containing the names of all table columns.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getQuotedSQLName]\()
Returns a quoted version of the table name, if necessary, as defined by the actual database used.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getRowIdentifierColumnNames]\()
Returns an array containing the names of the identifier (PK) column(s).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getSQLName]\()
Returns the table name.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getServerName]\()
Returns the Servoy server name.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458}{tr:id=name}{td}h6.getColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSColumn]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumn{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_des|text=|trigger=button}{sub-section}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_des|trigger=none|class=sIndent}Returns a JSColumn for the named column.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_prs|trigger=none}name -- The name of the column to return the value from.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_ret|text=|trigger=button}{sub-section}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_ret|trigger=none|class=sIndent}[JSColumn] -- JSColumn column.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_see|text=|trigger=button}{sub-section}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_see|text=|trigger=button}{sub-section}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_sam|text=|trigger=button}{sub-section}{sub-section:463884AB6CB92A47-974C1909-44A541B9-8959ABF0-D4A17F4A45B42A2F9A7E3458_sam|class=sIndent|trigger=none}{code:language=javascript}
var jsTable = databaseManager.getTable('udm', 'campaigns')
var jsColumn = jsTable.getColumn('campaign_name')
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612}{tr:id=name}{td}h6.getColumnNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnNames{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_des|text=|trigger=button}{sub-section}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_des|trigger=none|class=sIndent}Returns an array containing the names of all table columns.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_ret|text=|trigger=button}{sub-section}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_ret|trigger=none|class=sIndent}[String]\[] -- String array of column names.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_see|text=|trigger=button}{sub-section}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_see|text=|trigger=button}{sub-section}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_sam|text=|trigger=button}{sub-section}{sub-section:B81D62C5BC9C7F50-A4887EC8-42B84476-9ED1B706-38DB789555DC9CF551F6E612_sam|class=sIndent|trigger=none}{code:language=javascript}
var jsTable = databaseManager.getTable('udm', 'campaigns')
var columnNames = jsTable.getColumnNames()
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6}{tr:id=name}{td}h6.getQuotedSQLName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getQuotedSQLName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_des|text=|trigger=button}{sub-section}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_des|trigger=none|class=sIndent}Returns a quoted version of the table name, if necessary, as defined by the actual database used.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_ret|text=|trigger=button}{sub-section}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_ret|trigger=none|class=sIndent}[String] -- String table name, quoted if needed.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_see|text=|trigger=button}{sub-section}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_see|text=|trigger=button}{sub-section}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_sam|text=|trigger=button}{sub-section}{sub-section:2F062E3280636A9A-A52B514E-42BE4CF2-B9108C68-FF9E9626431FB9BB82E981F6_sam|class=sIndent|trigger=none}{code:language=javascript}
//use with the raw SQL plugin:
//if the table name contains characters that are illegal in sql, the table name will be quoted
var jsTable = databaseManager.getTable('udm', 'campaigns')
var quotedTableName = jsTable.getQuotedSQLName()
plugins.rawSQL.executeSQL('udm',  quotedTableName,  'select * from ' + quotedTableName + ' where is_active = ?', [1])
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293}{tr:id=name}{td}h6.getRowIdentifierColumnNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRowIdentifierColumnNames{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_des|text=|trigger=button}{sub-section}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_des|trigger=none|class=sIndent}Returns an array containing the names of the identifier (PK) column(s).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_ret|text=|trigger=button}{sub-section}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_ret|trigger=none|class=sIndent}[String]\[] -- String array of row identifier column names.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_see|text=|trigger=button}{sub-section}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_see|text=|trigger=button}{sub-section}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_sam|text=|trigger=button}{sub-section}{sub-section:6072D7980E81438D-117DD41F-4ADE43BD-8FDA8534-D37514077E0082E3A936F293_sam|class=sIndent|trigger=none}{code:language=javascript}
var jsTable = databaseManager.getTable('udm', 'campaigns')
var identifierColumnNames = jsTable.getRowIdentifierColumnNames()
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097}{tr:id=name}{td}h6.getSQLName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getSQLName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_des|text=|trigger=button}{sub-section}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_des|trigger=none|class=sIndent}Returns the table name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_ret|text=|trigger=button}{sub-section}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_ret|trigger=none|class=sIndent}[String] -- String table name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_see|text=|trigger=button}{sub-section}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_see|text=|trigger=button}{sub-section}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_sam|text=|trigger=button}{sub-section}{sub-section:A965A5AF339EF81F-4AFD4A28-43C54102-87A9BCB8-EB627A55AE5C27ECF17AD097_sam|class=sIndent|trigger=none}{code:language=javascript}
var jsTable = databaseManager.getTable('udm', 'campaigns')
var tableNameForDisplay = jsTable.getSQLName()
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A}{tr:id=name}{td}h6.getServerName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_des|text=|trigger=button}{sub-section}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_des|trigger=none|class=sIndent}Returns the Servoy server name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_ret|text=|trigger=button}{sub-section}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_ret|trigger=none|class=sIndent}[String] -- String server name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_see|text=|trigger=button}{sub-section}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_see|text=|trigger=button}{sub-section}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_sam|text=|trigger=button}{sub-section}{sub-section:996A2DB19CA5DBC2-DE56A6E8-4D704FE4-8E9C831E-C06FE9F1B7771212E599303A_sam|class=sIndent|trigger=none}{code:language=javascript}
var jsTable = databaseManager.getTable('udm', 'campaigns')
var serverName = jsTable.getServerName()
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}