Skip to main content

Accessing Data

Accessing Data

To access, modify, and delete data associated with a persistent class, your code can do any or all of the following:

  • Open instances of persistent classes, modify them, and save them.

  • Delete instances of persistent classes.

  • Use embedded SQL.

  • Use dynamic SQL (the SQL statement and result set interfaces).

  • Use SQL from Python.

  • Use low-level commands and functions for direct global access. Note that this technique is not recommended except for retrieving stored values, because it bypasses the logic defined by the object and SQL interfaces.

InterSystems SQL is suitable in situations like the following:

  • You do not initially know the IDs of the instances to open but will instead select an instance or instances based on input criteria.

  • You want to perform a bulk load or make bulk changes.

  • You want to view data but not open object instances.

    (Note, however, that when you use object access, you can control the degree of concurrency locking. If you know that you do not intend to change the data, you can use minimal concurrency locking.)

  • You are fluent in SQL.

Object access is suitable in situations like the following:

  • You are creating a new object.

  • You know the ID of the instance to open.

  • You find it more intuitive to set values of properties than to use SQL.

FeedbackOpens in a new tab