Working with Preferences

Specifying Preferences

This section describes how to set VQB preferences to specify:

  1. Click Query > Preferences. The Preferences dialog box appears.

  2. Specify the Preferences settings as described in the following table.

    PreferenceValueDescription

    Read NULL numbers as

    0

    If you accept the default value for this field, NULL data imported from databases into the MATLAB workspace appears as NaN. Setting this field to 0 causes NULL data imported into the MATLAB workspace to appear as 0s.

    Data return format

    numeric

    Select a data format based on the type of data you are importing, memory considerations, and your preferred method of working with retrieved data.

    Cell arrays and structures support mixed data types, but require more memory and process more slowly than numeric matrices. Select numeric if:

    • The data you are retrieving is numeric, or

    • You need to convert nonnumeric data to the format specified in the Read NULL numbers as field.

    Error handling

    report

    • Set this field to store or empty to direct errors to a dialog box rather than to the MATLAB Command Window.

    • Set this field to report to display query errors in the MATLAB Command Window.

  3. Click OK.

  4. Assign the query results to a workspace variable, A.

  5. Click Execute to rerun the query.

    Information about the retrieved data appears in the Data area.

  6. To see the results, enter A in the Command Window.

    A =
    
          125970        1400        1100         981
          212569        2400        1721        1414
          389123        1800        1200         890
          400314        3000        2400        1800
          400339        4300           0        2600
          400345        5000        3500        2800
          400455        1200         900         800
          400876        3000        2400        1500
          400999        3000        1500        1000
          888652           0         900         821
    

    NULL values appear as 0s instead of NaNs.

    For more information about Preferences, see the setdbprefs function reference page.

Saving Preferences

Preferences apply only to the current MATLAB software session. They are not saved with queries. Default Preferences apply when you start a new session, or after you clear all variables (using, for example, the clear all command). It is a good practice to check Preferences settings before you run queries.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS