Search

Module: Editor

Version: 2.2.1 +

User: Developer

Object Type: Data Object

 

Description

A DatabaseView is used to make a connection to a database in order to retrieve its data.

Properties

DebugLogMode (from version 4.1)

Indicates the level of detail of debug information that is logged when running a Futurama application (website, webservice, console application) to the trace, a logfile, a database etc. The possible values are:

  • None: no debug information is logged
  • Simple: only basic information is given
  • Extended: in addition to the information in the Simple mode the values of all the properties of the object are shown

IsPublic

Possible values are 'True' or 'False'. If the value is 'False', then the object can only be used within the document where it is created. If the value is 'True', then also from other Futurama documents can be referred to this object. This means that changes in the object also affect the document in which is referred to this object. If the value is 'True' and you attempt to move or delete the object, a warning will be given. To limit these warnings to a minimum it is recommended to set IsPublic to 'True' only when necessary.

SingleRow

Possible values are 'True' or 'False'. If the data which will be retrieved by the DatabaseView will only contain scalars then the value is to be set to 'True'. Any DatabaseField that will be defined in the DatabaseView will then only have scalars as its value. If the data which will be retrieved by the DatabaseView will be a table then the value is to be set to 'False'. Any DatabaseField in the DatabaseView will then have a table as its value.

XmlName

The name of the object as it is shown in the source of the website. By default the XmlName is equal to the name given in the property (Name) with spaces replaced by underscores, but you are free to change it.

ConnectString

This property has to contain the connectstring to the database. A connectstring specifies information about a data source and the means of connecting to it. It typically includes the name of the database, the server on which it is located, the username and password needed to login. For example:

server=localhost;database=My_database;UID=Login;password=123456

DatabaseType

In this property the type of the database that is to be accessed has to be set. The posible values are 'ODBC', 'Oracle' and 'SQLServer'. ODBC (Open Database Connectivity) is used when the database is not an Oracle or SQLServer database but any other database. Any database typically has an ODBC driver through which the database can be connected to.

QueryString

This property contains the QueryString which is used to retrieve data from the Database. The exact syntax of a querystring depends on the type of the database that is used. An example of a SQL query is:

SELECT * FROM Book WHERE price >100.00 ORDER BY title

SelectType

This property is only available when DatabaseType 'SQLServer' is selected. The possible values are 'Query' and 'StoredProcedure'. If 'Query' is chosen then the data will be retrieved from the database by means of a Query. This query has to be set at the property QueryString (see above). If 'StoredProcedure' is chosen then the data will be retrieved from the database by means of a stored procedure which is defined in the database. The name of the stored procedure has to be set in the property SPName (see below). In the property InputParameters (see below) any parameters can be set which are required by the stored procedure.

The advantage of a stored procedure is that it has far more possibilities than a query and is therefore better capable of retrieving the desired information. Because the stored procedure is defined in the database it is also easier to adjust, for instance in case of changes in the database. As long as the name and the inputparameters don't change, no changes in Futurama are necessary.

InputParameters

This property is only available when DatabaseType 'SQLServer' is selected and SelectType is set to 'StoredProcedure'. In this property the input has to be set which is required by the stored procedure defined in the property SPName. It is possible to pass on multiple inputparameters.

SPName

This property is only available when DatabaseType 'SQLServer' is selected and SelectType is set to 'StoredProcedure'. This property contains the name of the Storedprocedure which is to be used. If no stored procedure in the database exists with this name an error occurs.

TimeOut

This property is only available when DatabaseType 'SQLServer' or 'ODBC' is selected. This property indicates the maximum duration (in seconds) which can be used to execute a query or stored procedure. Value 0 implies no timeout will applicable. If this duration expires, the execution will be aborted.

(Name)

The name of the object.

Comment

Here a comment can be entered. For example a short description of the object.

ID

The unique identification number of the object. This number is automatically generated by Futurama on the moment of creation. This number can be used when searching for a certain object in the Find Window.

Automatic retrieval of all DatabaseFields

After a connection to a database is made through the DatabaseView one by one all DatabaseFields can be defined. This can be a time-consuming work-out, especially when the number of DatabaseFields is large. Instead of doing this manually it can be done automatically. Select the DatabaseView which has a proper connection as well as a proper querystring or stored procedure. Do a rightclick on the DatabaseView and select 'Retrieve fields'. The result will be that within the DatabaseView a number of DatabaseFields will be created corresponding to the fields of the result of the query/stored procedure.

Installation Client Software

If you want to make use of a SQL Server or an Oracle database as the input for your DatabaseView, make sure you have the Client Software of SQL Server or Oracle respectively installed on the server on which Futurama runs. For SQL Server this will typically always be the case for this software comes automatically with the installation of Windows. For Oracle it most likely has to be done explicitly.

Related Topics

- DatabaseField

Updated: 2012-08-31