This section shows how to create an employee list application. The employee list shows total sales figures for each sales representatives, using information in sampledb. This will be the master application.
Creating the employee list of sales reps
In Mobile Web Studio, select Applications in the left pane, New in the Application Builder Status menu, and click the New button.
In Application Builder, click the down-arrow to the right of Add, and select Database Element.
On the Database Element Definition window, define the database element:
Make sure the Connection Cache option is selected.
In Conn Cache Name, select sampledb from the drop-down list.
In SQL query string, enter this query:
set rowcount 10 select e.emp_id, e.emp_fname, e.emp_lname, s.cust_id, (soi.quantity * p.unit_price) as sales_total from employee e, sales_order s, sales_order_items soi, product p where e.emp_id = s.sales_rep and s.id = soi.id and soi.prod_id = p.id and s.region = '@OP["region"="Western"]' set rowcount 0
Click Preview and make sure these columns are included: emp_id, emp_fname, emp_lname, cust_id, and sales_total.
Click Next. The Split window displays.
Click Next. The Define window displays.
On the Define window, select record 1 as the Label. To do so:
Click the Records Contain Labels check box.
Accept 1
in
the Labels are displayed in Record field.
Click Next. The Filter window displays.
Click Next. The parameter definition window displays.
On the parameter definition window, make these modifications (otherwise accept the defaults):
region – click the Variable box, and make these changes:
Default Value – enter Western,Central
(no
spaces).
Type – choose “Select” from the drop-down list. The Add button displays, which you can ignore.
Personalize – choose “database table” from the drop-down list.
Key – region
displays
as the personalization key (you created region in “Creating a personalization key”).
Click Next. The Window Preview window displays.
In Element Name, enter employeeSales
.
Click Next. The Continuous Capture window displays.
Click Finish.
Click Save to create the application.
On the Finish window, make these changes (otherwise accept the defaults):
Name – enter employeeSales
(no
spaces).
Click Finish.
Click OK to confirm.
Click Close to close Application Builder.
When you return to the Mobile Web Studio main window, select New from the Application Builder Status menu. The employeeSales application displays in the detail pane.
In Mobile Web Studio, approve the application:
Right-click the employeeSales application in the detail pane, and select Approval Status | Approved.
Click OK to confirm.
Select Approved from the Application Manager Status menu. You see your newly approved employeeSales application in the detail pane.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |