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=91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7}{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:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_des|text=|trigger=button}{sub-section}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_des|trigger=none|class=sIndent}Returns a JSColumn for the named column.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_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:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_ret|text=|trigger=button}{sub-section}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_ret|trigger=none|class=sIndent}[JSColumn] -- JSColumn column.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_see|text=|trigger=button}{sub-section}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_see|text=|trigger=button}{sub-section}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_sam|text=|trigger=button}{sub-section}{sub-section:91A7F9AC15A2D394-04B4E82B-4A8D479E-82D18238-991B0AC7BEC5149B648067E7_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=25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711}{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:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_des|text=|trigger=button}{sub-section}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_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:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_ret|text=|trigger=button}{sub-section}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_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:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_see|text=|trigger=button}{sub-section}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_see|text=|trigger=button}{sub-section}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_sam|text=|trigger=button}{sub-section}{sub-section:25761A208560E9AF-6F606E7B-48FA4F16-B9639EE7-A0D6AEA700EC2F6ED80FB711_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=1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B}{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:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_des|text=|trigger=button}{sub-section}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_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:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_ret|text=|trigger=button}{sub-section}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_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:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_see|text=|trigger=button}{sub-section}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_see|text=|trigger=button}{sub-section}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_sam|text=|trigger=button}{sub-section}{sub-section:1951FDE1478BAC4A-64C4B23E-4175479C-A70AAD64-7F7E48D466B67338F8947A2B_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=93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787}{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:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_des|text=|trigger=button}{sub-section}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_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:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_ret|text=|trigger=button}{sub-section}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_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:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_see|text=|trigger=button}{sub-section}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_see|text=|trigger=button}{sub-section}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_sam|text=|trigger=button}{sub-section}{sub-section:93D21776D455C15A-CCEDC456-4E5A4DAB-9B6E9DA1-0EEF12605E8913E5F52E0787_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=F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02}{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:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_des|text=|trigger=button}{sub-section}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_des|trigger=none|class=sIndent}Returns the table name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_ret|text=|trigger=button}{sub-section}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_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:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_see|text=|trigger=button}{sub-section}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_see|text=|trigger=button}{sub-section}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_sam|text=|trigger=button}{sub-section}{sub-section:F7AE80ED36673A4E-638B1664-4AE64A14-AF48BE68-CF0DDBDD9F80D110E0896C02_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=EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963}{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:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_des|text=|trigger=button}{sub-section}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_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:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_ret|text=|trigger=button}{sub-section}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_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:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_see|text=|trigger=button}{sub-section}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_see|text=|trigger=button}{sub-section}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_sam|text=|trigger=button}{sub-section}{sub-section:EC93D5D063924F87-D76FFA3A-48AC46D2-A05FB1DC-8B45DA98ECA359ADF1789963_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}