Child pages
  • rawSQL

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{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:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Server Property Summary{th}{tr}{tbody}{tr}{td}{td}{td}[#servoy.rawSQL.allowClientCacheFlushes]{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#executeSQL]\(serverName, tableName, sql) Execute any SQL, returns true if successful.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#executeSQL]\(serverName, tableName, sql, sql_args) Execute any SQL, returns true if successful.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSet]{td}{td}[#executeStoredProcedure]\(serverName, procedureDeclaration, arguments, inOutDirectionality, maxNumberOfRowsToRetrieve) Execute a stored procedure.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#flushAllClientsCache]\(serverName, tableName) Flush cached database data.{td}{tr}{tbody}{tbody}{tr}{td}[ServoyException]{td}{td}[#getException]\() If the result from a function was false, it will return the exception object.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#notifyDataChange]\(serverName, tableName, pksDataset, action) Notify clients about changes in records, based on pk(s).{td}{tr}{tbody}{table}\\ {table:id=serverProperty|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Server Property Details{th}{tr}{tbody:id=servoy.rawSQL.allowClientCacheFlushes|class=node}{tr:id=name}{td}h6.servoy.rawSQL.allowClientCacheFlushes{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:servoy.rawSQL.allowClientCacheFlushes_des|trigger=button|text=}{sub-section}{sub-section:servoy.rawSQL.allowClientCacheFlushes_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_snc|trigger=button|text=}{sub-section}{sub-section:servoy.rawSQL.allowClientCacheFlushes_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_prs|trigger=button|text=}{sub-section}{sub-section:servoy.rawSQL.allowClientCacheFlushes_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_ret|trigger=button|text=}{sub-section}{sub-section:servoy.rawSQL.allowClientCacheFlushes_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:servoy.rawSQL.allowClientCacheFlushes_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:servoy.rawSQL.allowClientCacheFlushes_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:servoy.rawSQL.allowClientCacheFlushes_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:servoy.rawSQL.allowClientCacheFlushes_sam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=executeSQL-String_String_String|class=node}{tr:id=name}{td}h6.executeSQL{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}executeSQL{span}{span:id=iets|style=float: left;}\(serverName, tableName, sql){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:executeSQL-String_String_String_des|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:executeSQL-String_String_String_snc|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:executeSQL-String_String_String_prs|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_prs|trigger=none|class=sIndent}\{[String]} serverName -- the name of the server \{[String]} tableName -- the name of the table \{[String]} sql -- the sql query to execute {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:executeSQL-String_String_String_ret|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:executeSQL-String_String_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:executeSQL-String_String_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:executeSQL-String_String_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var country = 'NL' var done = plugins.rawSQL.executeSQL("example_data","employees","update employees set country = ?", [country]) if (done) { //flush is required when changes are made in db plugins.rawSQL.flushAllClientsCache("example_data","employees") } else { var msg = plugins.rawSQL.getException().getMessage(); //see exception node for more info about the exception obj plugins.dialogs.showErrorDialog('Error', 'SQL exception: '+msg, 'Ok') } // Note that when this function is used to create a new table in the database, this table will only be seen by // the Servoy Application Server when the table name starts with 'temp_', otherwise a server restart is needed. {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=executeSQL-String_String_String_ObjectArray|class=node}{tr:id=name}{td}h6.executeSQL{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}executeSQL{span}{span:id=iets|style=float: left;}\(serverName, tableName, sql, sql_args){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:executeSQL-String_String_String_ObjectArray_des|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_ObjectArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:executeSQL-String_String_String_ObjectArray_snc|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_ObjectArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:executeSQL-String_String_String_ObjectArray_prs|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_ObjectArray_prs|trigger=none|class=sIndent}\{[String]} serverName -- the name of the server \{[String]} tableName -- the name of the table \{[String]} sql -- the sql query to execute \{[Object]\[]} sql_args -- the arguments for the query {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:executeSQL-String_String_String_ObjectArray_ret|trigger=button|text=}{sub-section}{sub-section:executeSQL-String_String_String_ObjectArray_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:executeSQL-String_String_String_ObjectArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_ObjectArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:executeSQL-String_String_String_ObjectArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_ObjectArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:executeSQL-String_String_String_ObjectArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeSQL-String_String_String_ObjectArray_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var country = 'NL' var done = plugins.rawSQL.executeSQL("example_data","employees","update employees set country = ?", [country]) if (done) { //flush is required when changes are made in db plugins.rawSQL.flushAllClientsCache("example_data","employees") } else { var msg = plugins.rawSQL.getException().getMessage(); //see exception node for more info about the exception obj plugins.dialogs.showErrorDialog('Error', 'SQL exception: '+msg, 'Ok') } // Note that when this function is used to create a new table in the database, this table will only be seen by // the Servoy Application Server when the table name starts with 'temp_', otherwise a server restart is needed. {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=executeStoredProcedure-String_String_ObjectArray_NumberArray_Number|class=node}{tr:id=name}{td}h6.executeStoredProcedure{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}executeStoredProcedure{span}{span:id=iets|style=float: left;}\(serverName, procedureDeclaration, arguments, inOutDirectionality, maxNumberOfRowsToRetrieve){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_des|trigger=button|text=}{sub-section}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_snc|trigger=button|text=}{sub-section}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_prs|trigger=button|text=}{sub-section}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_prs|trigger=none|class=sIndent}\{[String]} serverName \{[String]} procedureDeclaration \{[Object]\[]} arguments \{[Number]\[]} inOutDirectionality \{[Number]} maxNumberOfRowsToRetrieve {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_ret|trigger=button|text=}{sub-section}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_ret|trigger=none|class=sIndent}[JSDataSet]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:executeStoredProcedure-String_String_ObjectArray_NumberArray_Number_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var maxReturnedRows = 10; //useful to limit number of rows var procedure_declaration = '{?=calculate_interest_rate(?)}' // define the direction, a 0 for input data, a 1 for output data var typesArray = [1, 0]; // define the types and values, a value for input data, a sql-type for output data var args = [java.sql.Types.NUMERIC, 3000] // A dataset is returned, when no output-parameters defined, the last select-result in the procedure will be returned. // When one or more output-parameters are defined, the dataset will contain 1 row with the output data. var dataset = plugins.rawSQL.executeStoredProcedure(databaseManager.getDataSourceServerName(controller.getDataSource()), procedure_declaration, args, typesArray, maxReturnedRows); var interest_rate = dataset.getValue(1, 1); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=flushAllClientsCache-String_String|class=node}{tr:id=name}{td}h6.flushAllClientsCache{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}flushAllClientsCache{span}{span:id=iets|style=float: left;}\(serverName, tableName){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:flushAllClientsCache-String_String_des|trigger=button|text=}{sub-section}{sub-section:flushAllClientsCache-String_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:flushAllClientsCache-String_String_snc|trigger=button|text=}{sub-section}{sub-section:flushAllClientsCache-String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:flushAllClientsCache-String_String_prs|trigger=button|text=}{sub-section}{sub-section:flushAllClientsCache-String_String_prs|trigger=none|class=sIndent}\{[String]} serverName \{[String]} tableName {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:flushAllClientsCache-String_String_ret|trigger=button|text=}{sub-section}{sub-section:flushAllClientsCache-String_String_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:flushAllClientsCache-String_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:flushAllClientsCache-String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:flushAllClientsCache-String_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:flushAllClientsCache-String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:flushAllClientsCache-String_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:flushAllClientsCache-String_String_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var country = 'NL' var done = plugins.rawSQL.executeSQL("example_data","employees","update employees set country = ?", [country]) if (done) { //flush is required when changes are made in db plugins.rawSQL.flushAllClientsCache("example_data","employees") } else { var msg = plugins.rawSQL.getException().getMessage(); //see exception node for more info about the exception obj plugins.dialogs.showErrorDialog('Error', 'SQL exception: '+msg, 'Ok') } // Note that when this function is used to create a new table in the database, this table will only be seen by // the Servoy Application Server when the table name starts with 'temp_', otherwise a server restart is needed. {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getException|class=node}{tr:id=name}{td}h6.getException{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ServoyException]{span}{span:id=iets|style=float: left; font-weight: bold;}getException{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getException_des|trigger=button|text=}{sub-section}{sub-section:getException_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getException_snc|trigger=button|text=}{sub-section}{sub-section:getException_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getException_prs|trigger=button|text=}{sub-section}{sub-section:getException_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getException_ret|trigger=button|text=}{sub-section}{sub-section:getException_ret|trigger=none|class=sIndent}[ServoyException]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getException_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getException_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getException_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getException_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getException_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getException_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var country = 'NL' var done = plugins.rawSQL.executeSQL("example_data","employees","update employees set country = ?", [country]) if (done) { //flush is required when changes are made in db plugins.rawSQL.flushAllClientsCache("example_data","employees") } else { var msg = plugins.rawSQL.getException().getMessage(); //see exception node for more info about the exception obj plugins.dialogs.showErrorDialog('Error', 'SQL exception: '+msg, 'Ok') } // Note that when this function is used to create a new table in the database, this table will only be seen by // the Servoy Application Server when the table name starts with 'temp_', otherwise a server restart is needed. {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=notifyDataChange-String_String_JSDataSet_Number|class=node}{tr:id=name}{td}h6.notifyDataChange{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}notifyDataChange{span}{span:id=iets|style=float: left;}\(serverName, tableName, pksDataset, action){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:notifyDataChange-String_String_JSDataSet_Number_des|trigger=button|text=}{sub-section}{sub-section:notifyDataChange-String_String_JSDataSet_Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_snc|trigger=button|text=}{sub-section}{sub-section:notifyDataChange-String_String_JSDataSet_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_prs|trigger=button|text=}{sub-section}{sub-section:notifyDataChange-String_String_JSDataSet_Number_prs|trigger=none|class=sIndent}\{[String]} serverName \{[String]} tableName \{[JSDataSet]} pksDataset \{[Number]} action {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_ret|trigger=button|text=}{sub-section}{sub-section:notifyDataChange-String_String_JSDataSet_Number_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:notifyDataChange-String_String_JSDataSet_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:notifyDataChange-String_String_JSDataSet_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:notifyDataChange-String_String_JSDataSet_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:notifyDataChange-String_String_JSDataSet_Number_sam|trigger=none}{code:language=javascript} /**************************************************************************** WARNING! You can cause data loss or serious data integrity compromises! You should have a THOROUGH understanding of both SQL and your backend database (and other interfaces that may use that backend) BEFORE YOU USE ANY OF THESE COMMANDS. You should also READ THE DOCUMENTATION BEFORE USING ANY OF THESE COMMANDS Note that when server names have been switched (databasemanager.switchServer),the real server names must be used here, plugins.rawSQL is not transparent to switched servers. ****************************************************************************/ var action = SQL_ACTION_TYPES.DELETE_ACTION //pks deleted //var action = SQL_ACTION_TYPES.INSERT_ACTION //pks inserted //var action = SQL_ACTION_TYPES.UPDATE_ACTION //pks updates var pksdataset = databaseManager.convertToDataSet(new Array(12,15,16,21)) var ok = plugins.rawSQL.notifyDataChange(databaseManager.getDataSourceServerName(controller.getDataSource()), 'employees', pksdataset,action) {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryExecute any SQL, returns true if successful.Execute any SQL, returns true if successful.Execute a stored procedure, return all created result sets.Execute a stored procedure.Flush cached database data.If the result from a function was false, it will return the exception object.Notify clients about changes in records, based on pk(s).

functionservoy sDetail2100%height:30px2Methods DetailsexecuteSQLname

executeSQL(serverName, sql)

dessIndent
Execute any SQL, returns true if successful.
prs

Parameters

sIndentserverNamethe name of the serversqlthe sql query to execute
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowexecuteSQLname

executeSQL(serverName, sql, sql_args)

dessIndent
Execute any SQL, returns true if successful.
prs

Parameters

sIndentserverNamethe name of the serversqlthe sql query to executesql_argsthe arguments for the query
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeStoredProcedurename

executeStoredProcedure(serverName, procedureDeclaration, arguments, maxNumberOfRowsToRetrieve)

dessIndent
Execute a stored procedure, return all created result sets.
prs

Parameters

sIndentserverName ;procedureDeclaration ;arguments ;maxNumberOfRowsToRetrieve ;
ret

Returns

sIndent the result sets created by the procedure.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeStoredProcedurename

executeStoredProcedure(serverName, procedureDeclaration, arguments, inOutDirectionality, maxNumberOfRowsToRetrieve)

dessIndent
Execute a stored procedure.
prs

Parameters

sIndentserverName ;procedureDeclaration ;arguments ;inOutDirectionality ;maxNumberOfRowsToRetrieve ;
ret

Returns

sIndent a dataset with output (in case of output data) or the last result set executed by the procedure.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
flushAllClientsCachename

flushAllClientsCache(serverName, tableName)

dessIndent
Flush cached database data. Use with extreme care, its affecting the performance of clients!
prs

Parameters

sIndentserverName ;tableName ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getExceptionname

getException()

dessIndent
If the result from a function was false, it will return the exception object.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
notifyDataChangename

notifyDataChange(serverName, tableName, pksDataset, action)

dessIndent
Notify clients about changes in records, based on pk(s). Use with extreme care, its affecting the performance of clients!
prs

Parameters

sIndentserverName ;tableName ;pksDataset ;action ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow