Database access
Username:  
Password:
  > Home
v User Guide
    > Introduction
    > Hello World
    > Flow Control
    > Function Calls
    > Authentication
    v Database access
       o Decode and encode
       o Searching
       o Display paging
       > Modify records
    > Content Management
    > Remote Calling
    > Object-Oriented
    > Other Features
> Reference
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> User Guide >> Database access <=  =>      <  1  >  
Database access

Database access is one of the initial objectives of the creation of BEE.  It caters not only for basic data access operations such as select, update, insert and delete, but also useful features such as user-defined field encoding and decoding, multiple-field search criteria including range test and regular expression matching, display paging in long search result, and many more.

How about we starts with a simple query:

database phbook query="select * from PhoneBook";

foreach ((db)phbook) display "{foreach|list}<br>";

 

The output is a too long to be completely included here but you can check it from the online interpretor.  Here is a sample listing:

ID=>'16',Name=>'Joe Chan',Tel=>'98765432',Height=>'178',Birthday=>'985260627'
ID=>'17',Name=>'Dick Smith',Tel=>'87654321',Height=>'147',Birthday=>'0'
...

 

It does not look very good.  So we put in some table formatting.  (As we do BEE Script and HTML in and out, we include the <script ...> and </script> tags here.)

<table>

  <tr>

    <td><b>ID</b></td>

    <td><b>Name</b></td>

    <td><b>Tel</b></td>

    <td><b>Height</b></td>

    <td><b>Birthday</b></td>

  </tr>

<script language="bee">

database phbook query="select * from PhoneBook";

foreach ((db)phbook as rec) {

</script>

  <tr>

    <td>${rec:ID}</td>

    <td>${rec:Name}</td>

    <td>${rec:Tel}</td>

    <td>${rec:Height}</td>

    <td>${rec:Birthday}</td>

  </tr>

<script language="bee">

}

</script>

</table>

 

Now we have:

ID Name       Tel      Height Birthday

16 Joe Chan   98765432 178    985260627

17 Dick Smith 87654321 147    0

 

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd