question stringlengths 19 6.88k | answer stringlengths 38 33.3k |
|---|---|
Problem Statement: Some VBA applications, when connecting to a database using SQLplus ODBC driver, require that a user submit his username and password for authentication. Moreover, the operator using the application may not be the same person as the one who is logged in to the network on that computer. Does SQLplus OD... | Solution: SQLplus ODBC driver does not use the UID and PWD connection parameters. It just uses the user that is logged in.
To work around this problem you could define a second SQLplus network server on a secret port number with security disabled and use this from the program.
To do this you would:
1. Start the In... |
Problem Statement: Sometimes users get the following error message when trying to create an ODBC connection using Aspen SQLplus 64-bit ODBC driver:
The module ip21odbc.dll may not be compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) vers... | Solution: Check the Path Environment Variable to make sure both paths listed below are present:
C:\Program Files\Common Files\AspenTech Shared
and
C:\Program Files (x86)\Common Files \AspenTech Shared
If the path C:\Program Files\Common Files\AspenTech Shared is not in the Path Environment Variable, you will need ... |
Problem Statement: How to access the value of the estimation objective function with automation? | Solution: This can be obtained using the LeastSquaresObjective property available on the simulation e.g. Application.simulation.LeastSquaresObjective
This property will documented in the next version, as follows:
Simulation.LeastSquaresObjective
This read only property allows you to access the result of an estimation... |
Problem Statement: Have you ever wanted to scan an IoGetDef record, look for all the Analog (or Discrete) data records that this IoGetDef record points to, and then retrieve data from fixed area fields of those Analog (or Discrete) records ? | Solution: For example, let's suppose that you have an IoGetDef record, that has over 80 occurrences in the IO_#TAGS repeat area. Let's call this IoGetDef record Aspen_Get. Inside each occurrence of Aspen_Get there is a field called IO_Value_Record&Fld. This field points to the Analog (or Discrete) data record that will... |
Problem Statement: When using the NOT IN function of Aspen SQLplus, it is possible to get No rows selected as an output even when there are records in a folder that match the search criteria.
For example, if the folder named folder1 contains three IP_AnalogDef records (rec_1, rec_2, and rec_3), then it would be expecte... | Solution: To work around this behavior, add the clause, where record_name is not null to the query. The entire query would then look like:
SELECT NAME from IP_AnalogDef where NAME NOT IN
(Select RECORD_NAME from folder1 where RECORD_NAME is not NULL);
Keywords:
References: None |
Problem Statement: I want to model unsteady diffusion in a sphere. The diffusion term is (in equation, not ACM syntax)
dc/dt = D/r^2 d/dr (r^2 dc/dr)
How can I program this in ACM? | Solution: If you like to use the compact form, here''s the correct way to write it:
r*$c(r.interior) = D*(2*c.ddx(r.interior) + r*c.d2x2(r.interior));
But if C is an array and not a scalar distribution, such as for example an array of concentrations, you need to control the expansion of equations with for loops:
for j... |
Problem Statement: After configuring a report in Aspen SQLplus web reporting tool to send a report to specific email address it don't really send an email to Inbox however the email just sits in the local machine queue under the folder C:\Inetpub\mailroot\Queue. | Solution: When reports in Aspen SQLplus are set to send to an email it goes through Default SMTP Virtual server located in IIS. Make sure this service is started and running. If this is running but still you are not getting emails there is a possibility that they are just sitting in the local machine queue. In order to... |
Problem Statement: Sometimes it would be desirable to not have any informational messages appear in your output. For instance, if you're writing a report or preparing a text file for someone and you have your output directed to a file, you wouldn't want messages such as No Rows Selected or 4 rows inserted to appear in ... | Solution: Using the SET command of LOG_ROWS is the way to accomplish this. It is a toggle of 0 or 1 where 1 is the default to show the messages. To suppress them, simply put
SET LOG_ROWS 0;
at the beginning of your query.
You could also turn it off and on within your query if there's a certain statement's informational... |
Problem Statement: Is there a way to know how many times in a day a tag is below a certain value? | Solution: Open Aspen SQLPlus and run the following query to know how many times the value has been below or equal to 10,000.
NOTE: Modify the query as needed. (replace TagName with the name of your tag and the value field name)
Select count (IP_Trend_Value) from ATCAI
where IP_Trend_Time between '21-AUG-12 12:00:00... |
Problem Statement: How can I display Aspen InfoPlus.21 tag names that are greater than 24 characters in length using an SQL Plus query? | Solution: In order to display tag names that are more than 24 characters use the WIDTH function. The following query will display all the tag names that have a character length of 64 or less.
Select Name WIDTH 64 from IP_Analogdef;
Note: More details about how WIDTH function is used can be found in the Aspen SQL Plus... |
Problem Statement: Is there a debug file created for errors generated via the automated reporting option of Aspen SQLplus Reporting? | Solution: If an error occurs when an automated report that was scheduled to run at a particular time then you will possibly see some error message in TSK_SQLR out like 'Failed to run the report, check additional log file for more info.'.
There will also be a log file generated in the Group200 folder (located either in ... |
Problem Statement: Unable to get multiple-line headers to output correctly when using the CROSS BY function. | Solution: You can only use multiple-line headers if you know in advance what the headers will be. This isn''t the case with a general Cross By query. However, if you do know the headers you can use a Cross By within an inner query as follows.
Select ts, atcai a|b, atcbatch c|d
from
select ts, avg(value) by name
from hi... |
Problem Statement: During the ATIMUS WIN2K session, there was some interest in a small SQL script to count the number of user connections on an InfoPlus.21 server. So Frank van de Pol wrote this script to allow counting the number of connections in InfoPlus.21 v2.51. He added: Use it at your own risk. It didn''t eat my... | Solution: -- **************************************************
--
- record: UserCountQry
--
- calculate user connections to the ip21 database
--
- 18 sept 2001
- Frank van de Pol,
- Cargill Bergen op Zoom
--
-- **************************************************
--
- Modification log... |
Problem Statement: You may create additional TSK_IQ tasks (i.e. tasks that start an occurrence of the executable iqtask.exe).
The benefit of this is that when you are using Aspen SQLplus heavily, and the existing (default) TSK_IQ1 task has too many processes. | Solution: To add an additional occurrence of iqtask.exe, take the following steps:
1) In the Aspen InfoPlus.21 Manager double click on the TSK_IQ1 task from your list of tasks in the Defined Tasks window. The task detail information will be displayed on the right side of the Aspen InfoPlus.21 Manager window, in t... |
Problem Statement: We have had several people ask whether they can setup an ODBC connection between an InfoPlus.21 database and a Setcim database. | Solution: You can use the ODBC Open Access Module (OAM) on InfoPlus.21 to connect to Desktop ODBC served by a SETCIM system. It is possible using the ODBC OAM to do INSERTs, DELETEs and UPDATE on a remote Setcim 4.8 system.
For this you need:
SQLplus Version on InfoPlus.21 (windows NT) with SQLplus and ODBC OAM license... |
Problem Statement: Customers would like an automated way to check the status of their history. One way to do this is to write an SQL+ query that monitors a repository, save it as an InfoPlus.21 record and schedule the activation of that record. | Solution: The following script checks to see if the archive process for a repository is running. It will send a response of Running or Not Running to an output file called HistoryD_HIST.out. (Please note, it will report a status of 'Not Running' if the archiver is stopped OR paused.) Some people have used third party p... |
Problem Statement: Values displayed in Excel using ODBC not displaying with value format associated with record.
For instance, if you were using ODBC connection with Excel to pull in the NAME, IP_VALUE_FORMAT, IP_INPUT_VALUE, and IP_INPUT_TIME. The results were displayed but the data was not displayed using the value f... | Solution: One may ask if this is a problem with Excel or the ODBC driver? The answer is neither.
The default for the SQLplus ODBC driver is to return floating point data directly and allow the application (Excel in this case) to format it.
If you want SQLplus to do the formatting, you need to check the Reals sent as Ch... |
Problem Statement: SQLplus 2004 and above includes a Web Service that allows users to access Aspen InfoPlus.21 information using SQLplus query language.
This | Solution: contains a sample VB.NET application that uses the SQLplus Web Service.
Solution
The attached zip file includes a sample Microsoft Visual Studio 2003Solution. Comments in the source code explain how the functionality has been implemented.
NOTE: This sample is provided as is and will not be supported by Asp... |
Problem Statement: Aspen SQLplus query executed from a Web page via an ODBC connection returns ERROR [HYT00] [AspenTech][SQLplus] Query timeout. Where is the timeout value that needs to be set to allow a query to execute to completeness? | Solution: The error code [HYT00] [Aspentech][SQLplus] at first appears to originate from an AspenTech product, but at a second look, the error-code [HYT00] is generic to ODBC-drivers using a Microsoft library or template. Here the default of 30sec. is set.
The following link describes how to change the timeout-value, w... |
Problem Statement: Finding a single data point at a particular timestamp in IP.21 history is not straightforward. Due to the high timestamp re | Solution: in IP.21 (microsecond precision) the following query:
select IP_TREND_TIME, IP_TREND_VALUE from ATCAI
where IP_TREND_TIME = '28-JUL-04 08:00:00';
will only return a value if the timestamp in history is equivalent to 28-JUL-04 08:00:00.000000 If the value is instead at timestamp 28-JUL-04 08:00:00.000001, no ... |
Problem Statement: How do I create an output line > 600 characters? | Solution: Create a local variable whose data type is Variant. Set the variant equal to a string of any length.
The fact that the variable is an Variant overcomes the normal 600 character string limit.
set output 'c:\out.txt';
local var1 char(100);
local i int;
local var2;
var1 = '1234567890123456789012345678901234567... |
Problem Statement: Aspen Custom Modeler COM interface behaves oddly with C# although I have written the interface codes correctly. | Solution: When developing a C# program to work with the ACM Automation interface, it is necessary to declare C# object variables that reference ACM objects as dynamic to ensure that late binding is used to resolve these objects.
Here is an example:
static void Main(string[] args)
{
dynamic App = new AspenCustomMode... |
Problem Statement: When multiple data types are used in an Aspen SQLPlus update statement, the order of updates is dependent upon the data type. For example, if an Aspen SQLplus update statement contains both integer and character values, the integer value will update before the character value. This | Solution: provides the order in which the updates will occur.Solution
This list provides the sequence of updates by data type. If the order in which fields are written is significant then separate UPDATE statements are recommended.
DTYPDUBL
DTYPQUDUBL
DTYPREAL
DTYPQUREAL
DTYPUSTS
DTYPIDFT
DTYPQULONG
DTYPQUTEXT
DTYPREID... |
Problem Statement: This | Solution: shows the query syntax for setting a timestamp variable to take current date but always at a specific time.
This is useful when the user wants to initialize a variable every day at a specific hour, regardless of the query execution time.
Solution
Sample query that will set a local variable to be current day b... |
Problem Statement: Aspen SQLplus timestamp calculations do not calculate correctly when using timestamps with the D option specified. Note: The D option is used to ensure that an event will reschedule at the same time(s) everyday, regardless of Daylight saving time changes.
Example:
select name,last_executed,schedule_t... | Solution: Adding the ABS() function to parameters that use the timestamp D option allows the time to calculate correctly.
Example:
select name,last_executed,schedule_time[1],reschedule_interval[1],
last_executed - (schedule_time[1] - ABS(reschedule_interval[1])) as duration
from querydef where name = 'dtimes'
name
last... |
Problem Statement: When deleting records, it is first necessary to make them unusable. Is it possible to make records unusable using SQLplus? | Solution: Records can be made unusable by setting USABLE=0. USABLE is 0 if a record is unusable and 1 if it is usable. It can be specified as an indirect field.
Here are two examples where a record called Tester-A is made unusable:
Update IP_AnalogDef set USABLE=0 where name like 'Tester-A';
update Tester-A set usabl... |
Problem Statement: 연속 두개의 IP_TREND_VALUEs 의 값 차이가 50 인 Tag들을 찾아내는 방법
예: 만약 IP_TREND_VALUEs 값의 범위가 1000 부터 10000 이고 연속 두개의 IP_TREND_VALUEs 의 값 차이가 50 인 Tag를 찾는 방법은 아래와 같습니다. | Solution: 1. 아래와 같은 SQLPlus 스크립트를 실행하여 IP_TREND_VALUE 값이 1000 부터 10000 간의 Tag 를 찾을수 있음.
Select name, value from HISTORY
where value >1000 and value < 10000;
2. 절차 1에서 실행한 결과를 Microsoft Excel 에 Copy.
3. 컬럼 C 에서 아래와 같은 함수로 연속 두개의 IP_TREND_VALUE 값을 계산.
4. 컬럼 D 에서 아래와 같은 함수로 요구하는 Tag를 찾을수 있음.
Keywords: Aspen SQLplus
select... |
Problem Statement: Many try to use a local variable to hold a record name in the TABLE spot in the FROM clause so that they can, within a loop, change the record with every iteration. This will not work. SQLplus does not allow a local variable to be in the FROM clause. | Solution: You can START a second query from the first query and pass it a parameter. SQLplus does allow this parameter to be in the FROM clause because they are treated as macros.
For example:
We want to create a report that contains a selector record name, and all the possible values for that selector record for all t... |
Problem Statement: Is it possible to save a snapshot of the database from within SQLplus? | Solution: Yes, use the following command which will force the SAVE_SNAP record to execute:
UPDATE Save_Snap SET schedule_time=CURRENT_TIMESTAMP;
Note that this will now become the time basis for when your regularly scheduled snapshot will be saved, unless you issue a second command that resets the schedule_time time b... |
Problem Statement: How can I time how long my query or a portion of my query is taking to run? | Solution: There may be many ways to accomplish this, but here are 3 good examples to do this.
1. Creating Standard Records in DB
A. Create a standard record in the database which has a history repeat area sized to at least 2.
B. Write to the raw value field each time you wish to set a timer for an operatio... |
Problem Statement: When accessing IP.21 using ODBC from an ASP page it fails with access denied error. | Solution: Assign a domain user account with permissions to read from the IP.21 database to the anonymous login in IIS. Steps:
1. Open internet service manager.
2. Right click and select properties.
3. Select the Directory security tab.
4. Click the Edit button by the anonymous access box.
5. When Allow Anonymous Access... |
Problem Statement: How to search for repeat area fields by using the NXTFTDEF function within SQLPlus. | Solution: By default, the NXTFTDEF function only searches the fixed area of each defintion record, to see if it contains the field you specify. But what if the field you are looking for resides within a definition record''s repeat area? In order to search for fields in a record''s repeat area, one must specify an occur... |
Problem Statement: This knowledge base article explains how to join tables from two different Aspen InfoPlus.21 databases. | Solution: Create Aspen SQLplus External links for each Aspen InfoPlus.21 database. Create a Join query referencing those External links and select from the Aggregates or History table or any tag record.
Aspen SQLplus External Links referencing ODBC data sources to multiple Aspen InfoPlus.21 databases
Select Average o... |
Problem Statement: This knowledge base article provides suggestions to minimize relational database disconnection errors when multiple Aspen SQLplus queries are processed by multiple instances of iqtask.exe (TSK_IQ#). | Solution: Each TSK_IQ# process (an instance of iqtask.exe) is an independent task. If multiple instances of iqtask.exe process queries which connect to a relational database, they each make separate connections to the database. Executing a query or a disconnect command on one instance of iqtask.exe has no effect on the... |
Problem Statement: Are there any connectivity components, other than ODBC, that can be used to connect to an application called Statistica? | Solution: At the time of this writing (January 2007) there are no mechanisms available, other than ODBC, to allow connectivity to Statistica. However, it is possible to use the Statistica COM API from within AspenSQLplus like any other COM API. This would allow the developer to combine Aspen SQLplus's agility in readin... |
Problem Statement: How do you connect to an Excel spreadsheet that's set up as an ODBC data source? | Solution: First of all, you must set up the Excel spreadsheet as an ODBC data source:
Start -> Settings -> Control Panel -> Administrator Tools -> Data Sources (ODBC)
Click the System DSN tab, then click the Add button
Select Microsoft Excel Driver (*.xls) and click the Finish button
Enter a name for the Data Source... |
Problem Statement: If Excel is installed on the machine in which the Aspen SQLplus script is run, the query output can be sent directly to an Excel spreadsheet using COM object as detailed in knowledge base article 117590 (Sending SQLplus query output directly to an Excel spreadsheet using a COM object).
Alternatively,... | Solution: provides ways to generate Excel file (XLS) which Excel can open even though Excel is not installed on the machine.
Solution
There are 2 methods to generate Excel XLS file that can be opened by Microsoft Excel.
1. By using Horizontal Tab.
The Aspen SQLplus query below will generate an Excel XLS file that... |
Problem Statement: The following error is reported when Automating a report in Web Sqlplus Reporting:
Failed to get list of printers: ERROR [HY00][Aspentech][SQLplus] SYSTEM commands, CREATEOBJECT and file writes disable at line 1 | Solution: The user who is getting this error must be added to the role that has full permission (read, write, System Command and Monitor) to the Sqlplus application in AFW Security Manager
Keywords: Web Reports
Automated
References: None |
Problem Statement: What formulas does SQLplus use for the Aggregates table's time weighted average calculations? | Solution: The SQLplus Aggregates table retrieves the average data through the same IP.21 API call that Process Explorer uses. There are 2 request types which can be used for a time weighted average. The first (stepped=0) treats data as though it were continuous, the other method (stepped=1) treats data as discrete/step... |
Problem Statement: UPDATE Statement in Aspen SQLplus is not allowed to use a column list. For example, the following query will report Cannot update expression list :
update MODULE.vals set (maxval, minval, avgval, stdevval) = (select trunc(max,2) as maxval, trunc(min,2) as minval, trunc(avg,2) as avgval, trunc(std,2) ... | Solution: The SQLplus help file has the following statement on the ANSI standard:
SQLplus is based on the American National Standards Institute (ANSI) standard X3.135-1992, which is also an International Standard ISO/IEC 9075:1992. SQLplus is primarily a data manipulation tool, and has some data definition capabilities... |
Problem Statement: The GetDBTime function returns the timestamp from the local server. This example query makes an ADO connection to a remote server, then queries for the current timestamp of the remote server using GetDBTime. The user will need to change the hostname for this query to work. | Solution: --------
local conn, rs;
conn = createobject('ADODB.Connection');
conn.open('DRIVER={AspenTech SQLplus};HOST=YourHostNameGoesHere');
rs = conn.execute('!write getdbtime;');
write rs(0);
conn.close;
Keywords:
References: None |
Problem Statement: This knowledge base article provides an example query which returns data timestamped at the beginning of each hour instead of data timestamped when the query was executed. | Solution: The CAST and FORMAT functions can be used to convert the timestamp to the beginning of the hour. For example:
local k, begintime;
k= getdbtime-500:00:00.0;
begintime = cast(k as timestamp format('MM/DD/YYYY HH'));
SELECT ts, avg FROM aggregates WHERE name='TagName' AND
ts > begintime and ts < current_timest... |
Problem Statement: This knowledge base article describes how to apply Left, Right or Center justification to output columns in Aspen SQLplus. This article also describes whether or not the Justification statements can be combined with the Using and Width statements. | Solution: Use the words Left, Center or Right following any column name in a Select statement. The default justification is to Right justify all Integer and Real data columns and Left justify all other columns.
The Using and Width syntaxes can be combined with justification. The Aspen SQLplus Using syntax temporarily... |
Problem Statement: This knowledge base article describes why the Aspen SQLplus Query Writer can sometimes hang when GetObject is called from an Aspen SQLplus query to open an Excel sheet. | Solution: This has been seen to occur when an instance of the Excel work book is already open by another application. In this case, Excel tries to issue a dialog box to ask if it should open a read-only copy. However, the background Excel process does not have access to create windows, so it hangs. This causes Aspen SQ... |
Problem Statement: Aspen Custom Modeler has access to property methods, especially polymer specific methods such as PC-SAFT that are not found inside HYSYS.
When importing an Aspen Custom Modeler (ACM) user model into HYSYS, will HYSYS inherit the property method used inside ACM flowsheet? | Solution: When a user model is created inside ACM (see the attached PDF for instructions on creating an ACM user model for HYSYS), the user model contains all the infrastructure for deploying the property method used in the ACM flowsheet
In 2004.2 version of HYSYS, you will need to specify the APPDF (problem definition... |
Problem Statement: I have developed a model in ACM and have exported it to Aspen Plus. The model runs ok in ACM, but in Aspen Plus the flowrate of the output streams is always zero, even if the model is converged. | Solution: You need to check the port properties in ACM. To be able to connect a stream correctly in Aspen Plus, the port type in ACM must be one which is recommended (see on-line help for details, in general you need to use the MoleFractionPort).
When you set the export model properties, you need to check that the co... |
Problem Statement: When you browse to http://<servername>/SQLplusWebService/SQLplusWebService.asmx, you get the following error message:
Furthermore, you find the following error message logged in Event Viewer:
It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Adm... | Solution: This is because there is a conflict of the ASP.NET versions used by the applications assigned to the same application pool.
1. Create at least 2 application pools, one dedicated to ASP.Net 2.0 applications and the other to ASP.Net 1.1 applications.
1. Right-click on Application Pools node.
2. ... |
Problem Statement: This knowledge base article describes how to work around the following error
Connection is busy with results for another hstmt
which can be returned when executing a query against a remote Microsoft SQL Server database from within Aspen SQLplus. | Solution: This error message is returned from Microsoft SQL Server. The error is described in the following Microsoft knowledge base article, http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032
This error is returned because Microsoft SQL Server cannot process more than one statement on a connection at once... |
Problem Statement: During certain conditions you may need to force the memory data in a record to be written to disk. A side effect of doing this is that the create date of the record gets changed to the current date and time, thus the data in the repeat area for the record is no longer visible in Aspen InfoPlus.21 Adm... | Solution: There are two ways to resolve the problem, one uses the command XOLDESTOK in SQLplus, available in Aspen InfoPlus.21 version 6.x and higher, and the second one is using the XOLDESTOK command utility.
1stSolution
Using XOLDESTOK in Aspen SQLplus Query Writer.
First pick a record that was created at the sam... |
Problem Statement: Can you explain the meaning of the solver messages when one changes in Run, Solver Options, Non-linear tab, Diagnostics, the values of Highest variable steps and Highest residuals? These messages are issued when running the attached simulation.
Solving steady state ...
Decomposition:
Total number ... | Solution: complete
Solution
Let''s review this section by section.
The message below is issued when the non-linear solver diagnostics option Highest residuals is set to a non-zero value (we suggest a value in the range of 2 to 5, to show the top 2 or 5 highest residuals, that means the 2 to 5 equations that are usuall... |
Problem Statement: Your custom SQLplus web-based reports, built for example using an html editor and connecting to Aspen Infoplus.21 via a system DSN in the ODBC data sources with AspenTech SQLplus as driver, timeout when they take longer than 30 seconds to generate. | Solution: The timeout can be set in the .asp page itself by changing the CommandTimeout value for your connection. The default command timeout within ADO is 30 seconds.
CommandTimeout tells the server how long to wait, in seconds, for completion of any command sent to the data source. This value is editable before an... |
Problem Statement: The Begin/Exception statement does not write if the query fails due to an invalid record name.
Query1 (Q1):
BEGIN
SELECT ip_input_value from ATCAI3;
EXCEPTION
WRITE 'record name not found';
END
If the record name ATCAI3 does not exist, the query will fail and will not write the exception message. | Solution: The Begin/Exception only traps run-time errors, not parse-time errors. A way to work around this is to put the main query in a separate record or file and use a Start command to run it from within the Begin/Exception. As an example: Save the query in Q2 as Select.SQL. Then use a start statement in Q3 to run t... |
Problem Statement: Is there a way to make Aspen SQLplus query records read only without using record level security? | Solution: Records defined by QueryDef and CompQueryDef have a field called READ_ONLY. If this field is set to YES, any query lines that perform a database update or a write will be disabled.
Keywords: Querydef
ComQueryDef
read only
References: None |
Problem Statement: What would be a better way to get a nearest value for a specific time | Solution: You can find the nearest value before the time by selecting from the record:
SET MAX_ROWS=1;
select ip_trend_time, ip_trend_value from mytag where ip_trend_time < mytime;
You can find the nearest value after the time by selecting from the history pseudo table:
SET MAX_ROWS=1;
select ts, value from histo... |
Problem Statement: Sometimes it is necessary to call a stored procedure on a remote SQL Server or Oracle database. This knowledge base article suggests 2 ways to call a stored procedure on a remote database. | Solution: If calling a stored procedure on a remote database that has only input parameters, the SQLplus EXECUTE statement can be used. If this statement needs to be split over multiple lines, the quote at the end of the first line can be closed and then opened again at the start of the second line.
Eg.
execute '{call ... |
Problem Statement: The following SQLplus example query reads a bit then writes the seventh (reading from right to left) bit component to an Aspen InfoPlus.21 record. | Solution: write current_timestamp;
local mybitstring integer;
local mydevicestate integer;
--
-- Here is an example of how to read the seventh bit (counting from right to left)
--
mybitstring = 64; -- This would be 0000000001000000 in binary
--
-- Shift the bits six places, then and with 1 to filter out the bit
--
myde... |
Problem Statement: The error maximum string length exceeded is returned when attempting to execute a query containing a WRITE command. | Solution: The maximum string length for a WRITE is 600 characters when using a CHAR data type. Using a variant data type, it is possible to write strings longer than 600 characters.
In the following example, a variable of undeclared type is treated as a variant. A string 8000 characters in length will be returned.
... |
Problem Statement: When a person is in Excel, MS Query, or Access and accessing the IP.21 database via Desktop ODBC, the pseudo tables available in SQLplus aren't available to them. Many would like to have access to the AGGREGATES and HISTORY pseudo tables in particular. | Solution: In the SQLplus Query Writer, create a view of these tables. Then those views can be accessed in ODBC aware applications.
For example, to create a view of the AGGREGATES table, use a query of one of the following forms.
CREATE VIEW aggreg AS
SELECT * FROM AGGREGATES;
-OR-
CREATE VIEW aggreg AS AGGREGATES;
Each... |
Problem Statement: Creating a delta timespan by subtracting variables defined as timestamps from each other does not work. | Solution: Note the first screen capture below, where tsIndex is defined as a timestamp. The attempt to define several successive timespan deltas fails:
In this next screen capture, the only significant change is changing tsIndex to type INT instead of TIMESTAMP, and the delta timespans are defined successfully:
... |
Problem Statement: Compquerydef or Querydef records with a reschedule interval of 1 month, do not execute as expected. | Solution: When 1 Month is specified as the RESCHEDULE_INTERVAL for a QueryDef or CompQueryDef, the following logic is used.
If the day of the month is less than or equal to 14 then the rescheduled date use the same number. For example, if the reschedule date is set on 08-AUG-06 with a RESCHEDULE_INTERVAL of 1 Month, ... |
Problem Statement: Hints on using Optimization in Aspen Custom Modeler and Aspen Dynamics | Solution: Once you have developed a flowsheet of your plant, it is easy to implement a basic set of steady state optimization parameters. For example, define an objective function such as the value of the plant product made, less the cost of energy required to create the product. The design variable in this case could ... |
Problem Statement: An SQLplus Web Report may not run and error out with this message:
Error generating report test
Failed to transform XML
No stylesheet was loaded
The corresponding SQLReportDef record may report the following information in its ERROR_TYPE field:
Failed to load report
What can one do to get past this p... | Solution: Please try the suggestions inSolution 116430, especially if the underlying query has changed. If that does not fix the problem, please try restarting the IIS Admin Service on the machine which is acting as the web server. One may be prompted that other services need to be restarted in order to do this. Please... |
Problem Statement: An Aspen InfoPlus.21 QueryDef or CompQueryDef record that contains a link to a remote relational database does not execute successfully. The query definition record's #OUTPUT_LINES repeat area contains the following error information:
error type=Remote
Remote database error on link <link_name>
Where ... | Solution: To work around this behavior, select the Disconnect on any error check box within the Database Link configuration to make Aspen SQLplus reconnect to any database type of error. If this option is not used, then Aspen SQLplus disconnects only on network errors. This option is useful for databases that do not re... |
Problem Statement: What function should I use in Aspen SQLplus to evaluate a number raised to a certain exponent? | Solution: If you need to evaluate a number (such as 5) raised to a certain power (in this case 3) the proper numeric function to use is POW. POW(x, y) calculates x to the power y.
Example:
POW(5, 3) = 125
Alternatively, the Aspen SQLplus numeric function EXP(x) calculates mathematical constant e (which is ≈ 2.71828) to... |
Problem Statement: This knowledge base article explains how text data is handled when queried through the Aspen SQLplus History table. | Solution: The boxcar data compression algorithm used to reduce the amount of storage needed for Aspen InfoPlus.21 history means that data is not stored at regular time intervals even if it is scanned to regular intervals. The History table interpolates the data to present Aspen InfoPlus.21 history data as if it was rec... |
Problem Statement: My simulation is correctly specified when my model has only one section. However, if I change the number of sections, I observe that my simulation is no longer square. Why? | Solution: Here's a little example to show what is happening.
Model test
X as LengthDomain (DiscretizationMethod:CFD2, HighestOrderDerivative:2, numsections:2) ;
y as Distribution1D (XDomain is X);
y = 123;
End
If you set X.numsections : 1, then the simulation is square. If you set X.numsections : 2, then the simulatio... |
Problem Statement: Flash efficiency does not seem to apply to a Procedure type flash when using any of the submodels below:
Props_flash2, Props_flash2_entr, Props_flash2w, Props_flash3, Props_flash3_entr, Props_lle, Props_lwe | Solution: Flash efficiency is only relevant when FlashBasis=Equation or SmoothEquation. It is not used in a Procedure type flash.
There is no easy way to support efficiencies for Procedural flashes because the Aspen Plus Flash routine does not support efficiencies. Efficiencies can only be used for FlashBasis=Equation ... |
Problem Statement: How can I determine the data type of a field within an Aspen InfoPlus.21 record? | Solution: Ita??s possible to do this with the Aspen InfoPlus.21 Administrator tool where each field is displayed using a special icon (if the field is in the fixed area of the record).
The most common data types for any field in the Database are as follows:
A A A A A Real (single or double precision)
A A A A A Inte... |
Problem Statement: How to ensure that IP.21 is not scanning the same device tagname from multiple IOGetdef records. | Solution: Using this SQLplus query it will list duplicates:
select name, occnum, a.IO_TAGNAME, a.IO_VALUE_RECORD&&FLD
from iogetdef a, (select count(IO_TAGNAME) as ct, IO_TAGNAME, IO_VALUE_RECORD&&FLD from iogetdef group by IO_TAgname,IO_VALUE_RECORD&&FLD) b
where b.ct > 1 and a.IO_TAGNAME = b.IO_TAGNAME;
Sample output... |
Problem Statement: This knowledge base article explains why when populating tags in an Aspen Infoplus.21 database from a text file using Aspen SQLplus, you might encounter the following error:
Error creating record: incorrect buffer size at line n | Solution: This error occurs when there are tag names in the text file more than 24 characters long.
Keywords: Incorrect buffer size
References: None |
Problem Statement: This knowledge base article describes how to use the AGGREGATES table in Aspen SQLplus when to query for multiple time ranges. | Solution: The AGGREGATES table does not support multiple time ranges, so you will need to use separate queries in conjunction with the UNION operation .
For example:
SELECT TS, AVG(AVG)
BY NAME
FROM
(SELECT NAME, TS, AVG
FROM AGGREGATES
WHERE NAME IN ('atcai', 'atcl101', 'atcph101')
AND PERIOD = 00:10
AND TS BETWEEN ... |
Problem Statement: QueryDef or CompQueryDef records can have multiple records defined in the #Wait_for_COS_Fields repeat area. Any of these records may activate the record, which does not provide a method to determine which record caused a COS activation. This | Solution: contains a query which writes the name of the record that activated the query.Solution
The query redirects the activation_field and casts it as record. cast(*activation_field as record); which writes the record's name that activated the QueryDef or CompQueryDef.
--declare variables
local faultrec record;
--wh... |
Problem Statement: Excel can use a time format consisting of <number>.<number>, like 39018.50767500000. Is there a way to convert an Excel double timestamp into an InfoPlus.21 timestamp? Yes, the function below will convert the Excel double timestamp and return an InfoPlus.21 timestamp. | Solution: Save this function as a ProcedureDef and then call this function (CDate) in SELECT and INSERT statements within your own scripts.
Function CDate(x double)
local t timestamp, i VarDate;
--Sample input Value x=38904.50767500000;
i = trunc(x * 24)/24.0;
return cast(i as timestamp)+(x-cast(i as real))*2... |
Problem Statement: How to catch parse time errors persisting in the midst of query execution | Solution: Begin/exception only traps run time errors, not parse time errors. One way around this is to put the main query in a separate record or file and use a START statement to run it from within the BEGIN/EXCEPTION. For Example:
The START query will have:
BEGIN
START 'updatequery.sql';
EXCEPTION
Write 'Error: ' || ... |
Problem Statement: It is observed that a rather large simulation using partial differential equations is solving slowly. Is there any setting that could improve the speed? | Solution: You could give a try to the transpose option in the Run, Solver Options, Linear Solver, with M48 solver.
When checked, MA48 uses a transpose of the matrix instead of the original matrix when solving linear systems. This has the effect of changing the direction in which MA48 searches for pivots. For some model... |
Problem Statement: How can I call the physical property subroutines from my own subroutines which implement my procedures? | Solution: The subroutines that can be called are documented in ACM on-line help, under Aspen Custom Modeler
Keywords:
References: , Physical Properties reference.
We illustrate how this can be done with an example, where we call the liquid density subroutine (GPILMX version without analytical derivatives, GPIDLMX ve... |
Problem Statement: How do you get an interpolated value for an exact time? | Solution: Use the HISTORY table with the REQUEST type set to 2. For example:
SELECT value FROM HISTORY where name = 'atcai' and request = 2 and ts = '23-OCT-05 23:59';
For more information about the History table and request types, please see the SQLplus User's Guide and/or the SQLplus Help files.
Keywords:
Referenc... |
Problem Statement: When you create Automated reports in Aspen Web.21 SQLplus Reports, they should be saved under the \Documents and Settings\All Users\Application Data\AspenTech\SQLplus\automated folder, but the folder is empty. | Solution: When running the Aspen Web.21 server in a different system as the Aspen InfoPlus.21 database the automated reports and their output are saved in the Aspen InfoPlus.21 database system, not in the Aspen Web.21 server.
The default paths in the Aspen InfoPlus.21 database system are:
\Documents and Settings\All ... |
Problem Statement: This knowledge base article explains why a custom application (e.g. a VB.NET or C# application) based on Aspen SQLplus (that connects to Aspen InfoPlus.21 ODBC with the AspenTech SQLplus driver) terminates with the following exception:
ERROR [HY000] [AspenTech][SQLplus] No free cursor
This can ha... | Solution: 1. Call the Dispose method on OdbcCommand objects when you have finished with them.
......
Dim cmd As New System.Data.Odbc.OdbcCommand(SELECT COUNT(*) FROM IP_AnalogDef;, OdbcConn)
cmd.ExecuteScalar()
cmd.Dispose()
......
The problem is with closing ODBC statements. This error happens when a program opens... |
Problem Statement: How to retrieve the list of variables associated with a block using a script? | Solution: The FindMatchingVariables method can be used to list the variables associated with a block in ACM. See example code below:
Set flowsheet = Application.simulation.flowsheet
'Assuming there is a block named B1
Set vars = flowsheet.B1.FindMatchingVariables(~, fixed free, , False, True, True, False)
For Each s ... |
Problem Statement: This knowledge base article describes how to resolve the errors
Server Not Available and Tag Not Found
which can be returned when Aspen SQLplus web reports are executed even though connectivity to the Aspen InfoPlus.21 server has been verified through ping and nslookup commands. | Solution: These errors can potentially occur if another application which uses IIS has been installed on a server which is currently running the Aspen SQLplus web server. In a few cases, installation of Microsoft Sharepoint corrupted the Aspen SQLplus web reporting components. TheSolution is to uninstall the offending ... |
Problem Statement: This knowledge base article contains an example Aspen SQLplus query that monitors scheduled QueryDef and CompQueryDef records and sends an e-mail if the records are not executing on schedule. This query could be modified for other schedule record types. | Solution: In case the reschedule interval is set to 1 month:, the above query should be treated different and instead of subtracting the schedule_time - reschedule_interval you will have to use subtract_months as shown in the example below:
select name, last_executed t, reschedule_interval intrvl, subtract_months(t, in... |
Problem Statement: How do I access domain resources and Aspen InfoPlus.21 tasks with a local account? | Solution: Using a local account for the Aspen InfoPlus.21 task service is a common method to decrease the start-up time of InfoPlus.21. However, a local account by default can not access domain resources. There are manySolutions to overcome this problem.
1. Create a local user account on the domain resource with th... |
Problem Statement: How can I make my queries more generic using the PROMPT statement? | Solution: By using the PROMPT statement and a MACRO, it is possible to make your queries generic. Ita??s great for user input as well without the need for a VB or VBA application.
MACRO recname = PROMPT ('Please enter a record name');
SELECT IP_Input_Value, IP_Input_Time, IP_Eng_Units FROM &recname
A second param... |
Problem Statement: ANSI Standard SQL has a key word called 'TOP' to retrieve TOP 'n' number of records from a table. How do I retrieve TOP 'n' records from Aspen InfoPlus.21 Aspen SQLplus? | Solution: Aspen SQLplus does not have a key word like 'TOP', but there is a similar key word MAX_ROWS. Using this we can achieve the same goal. Use the following statement to retrieve TOP 'n' numbers of records from Aspen SQLplus:
SET MAX_ROWS=10; -- retrieving top 10 records
SELECT NAME FROM IP_ANALOGDEF
The above que... |
Problem Statement: Is there a way for a QueryDef record to access its own output lines from the previous execution? Also, is it possible to access a specific output line (line #3 for example)? | Solution: SQLplus clears the output of the query before the query execution starts. So, having a query select its own output does work but it returns what the query has produced in this execution not what it produced in the last execution.
For example:
write 'ok';
Select output_line from QueryDef where name = '... |
Problem Statement: Using Aspen SQLplus, is it possible to list all tags on a system that receive updates from Aspen Cim-IO via an I/O transfer record? | Solution: The following sample query demonstrates one way to display all such tags and their corresponding IO_GetDef record.
Query1
SELECT io_value_record&&fld->name AS TAGNAME, name AS GET RECORD, OCCNUM AS OCCURRENCE NUMBER
FROM iogetdef
ORDER BY 1
You also can add a where condition to display only the occurrence... |
Problem Statement: This sample program shows how to create a simple console application that uses the ADO.NET DataReader object to access data from IP.21 | Solution: Follow the steps below to create the application. The code is also attached to the knowledge base article.
Launch Microsoft Visual Studio .NET
Select File | New | Project
Select a Project type of Visual C# Projects
Select the Console Application Template
Type a Project Name and click OK
An empty program templ... |
Problem Statement: How can I get the 'real' value of the quotient when dividing two integers in SQLplus? | Solution: Suppose you wanted to calculate the percentage of IP_AnalogDef records that currently have IP_Value_Quality = 'Bad'. Using the COUNT(*) function in SQLplus returns an integer value. The example SQLplus script describes the result you would get using
local #_bad_tags integer,
total_tags integer,
percent_bad ... |
Problem Statement: This article attempts to clarify:
The basic capabilities of the product sub-component 'Aspen Desktop ODBC'.
How it would be installed.
Whether it needs to be purchased as a standalone product. | Solution: Aspen Desktop ODBC is a 32-bit ODBC driver and server that allows you to use ODBC-compliant applications with Aspen SQLplus to retrieve data from the Aspen InfoPlus.21 database. For a full list of AspenTech recommended ODBC-Compliant Applications, as well as the current ODBC application versions supported, pl... |
Problem Statement: Users of Pocket PC's would like to read and write data to and from InfoPlus.21. AspenTech is not supporting the SQLplus ODBC driver on a Pocket PC, so users cannot write their own client applications. | Solution: SQLplus version 2004 and later provides a Web Service that will allow remote queries from any SOAP compliant client.
This example is written using Visual Studio 2005 and DotNET v2.0. The application was compiled for Pocket PC 2003.
The complete Visual Studio 2005Solution is attached and there are some comme... |
Problem Statement: This knowledge base article explains how to make the results of a subquery, which has been executed through the START command, available to the main query. | Solution: The START command does not return values to the calling query like a procedure or function. Rather, the START command executes an Aspen SQLplus query which resides in a text file then returns the results of any select statements to the Aspen SQLplus Query Writer as if the subquery was executed normally.
If ... |
Problem Statement: Driver not capable message appears after querying a remote database via an ODBC Driver. | Solution: Run an ODBC Trace (see knowledge base article # 114134). If the message (EXIT SQLTransact with return code -1 (SQL_ERROR)) appears in the log file add the ROLLBACK command to the end of the query.
Example:
SELECT * from Informix.table;
ROLLBACK;
SQLplus always calls SQLTransact at the end of a query if remote... |
Problem Statement: This ER fixes the following problem:
The MSI install of 6.0.1 does not upgrade the SQLplus ODBC driver (CQ00148904.) | Solution: Version 6.0.1 of the SQLplus ODBC driver allows DSN-less connections from ADO.NET.
Apply this Engineering Release to your system to resolve the problem described above. The Release Notes contain detailed installation instructions.
Keywords:
References: None |
Problem Statement: Is it possible to launch the Aspen SQLplus Query Writer from a query saved to the desktop? | Solution: Yes, it is possible to run an Aspen SQLplus script from a desktop icon.
1. Save the query to the desktop.
2. Right click on the query icon (on the desktop) and select 'Open With'.
3. If the Aspen SQLplus Query Writer is not on the list of files to associate, browse to SQLplus.exe on the hard... |
Problem Statement: Since version 2004.1 I can use multiple experiments with data reconciliation (a special case of estimation), but the results are no longer copied back into the flowsheet. The values can only be seen in the Estimation tool. Is there a way to access the predicted values using automation? | Solution: This is possible with version 2004.1 and higher but currently undocumented. We will document the method.
You can access the predicted value for a measured variable in an experiment using the GetEstimationPredictedValues method (from the Simulation object). The syntax is:
Application.Simulation.GetEstimationPr... |
Problem Statement: How can I update the number of license points for an Aspen InfoPlus.21 database without stopping the database? | Solution: Using Aspen SQLplus Query Writer you can execute the following query to report the number of points that your Aspen InfoPlus.21 database is licensed for:
write 'Current number of license points = ' || getpointlicensecount;
and the output will display something like this:
Current number of license points = 105... |
Problem Statement: This knowledge base article provides troubleshooting steps to resolve the error
Failed to create object: tli:tliapplication: Access denied. at line 1
which can be generated by the Aspen SQLplus Query Writer. | Solution: The tli.tliapplication object is contained in tlbinf32.dll. This is a Microsoft type library information object which allows applications to programmatically extract information from type libraries. This file may be corrupted, missing or have been overwritten by a Microsoft patch or by the installation of ano... |
Problem Statement: This knowledge base article provides troubleshooting steps when the following error
ERROR[HY000][AspenTech]SQLplus Access Denied - No read access ERROR [01000][Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).... | Solution: Restart the AFW Security Client service
? Check the identity that the application pool runs under in IIS to make sure that this account has permission to access the Aspen InfoPlus.21 server.
? Enable ASP.NET impersonation. If ASP.NET impersonation is not enabled, the ASPNET account will be... |
Problem Statement: This knowledge base article provides the syntax required to reference a table in SQL Server from Aspen SQLplus. | Solution: SQL Server tables which are accessed through a database link can be referenced using the following syntax:
Linkname.DBName.Username.Tablename
For example, an appropriate select statement for the following database information is shown below.
Item
Example Database
Linkname
AdvisorTraining - SQL Server
DBNa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.