[ Team LiB ] Previous Section Next Section

Workshop

Quiz

1:

Which function would you use to open a database using the DBA functions?

2:

Which function would you use to insert a record into a database?

3:

Which function would you use to replace a record in a database?

4:

How would you access a record from a database by name?

5:

How would you get the name (as opposed to the value) of the first element in a database?

6:

How would you get subsequent element names?

7:

How would you delete a named element from a database?


Answers

A1:

You can open a database with the dba_open() function.

A2:

The dba_insert() function adds a record to a database.

A3:

The dba_replace() function replaces a record in a database.

A4:

The dba_fetch() function returns an element given a DBA resource and the element's name.

A5:

dba_firstkey() returns the name of the first element in a DBM-like database.

A6:

After calling dba_firstkey(), you can get subsequent element names by calling dba_nextkey().

A7:

You can delete an element with dba_delete().


    [ Team LiB ] Previous Section Next Section