Courseiva
Database Administration and CMDBhardMultiple ChoiceObjective-mapped

SNOW-CSA Database Administration and CMDB Practice Question

Exhibit

```javascript
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('sys_class_name', 'cmdb_ci_server');
gr.addQuery('u_environment', 'production');
gr.setLimit(1);
gr.orderByDesc('sys_updated_on');
gr.query();
if(gr.next()) {
    gs.info(gr.getValue('name'));
}
```

Refer to the exhibit. The script runs but no output is produced. What is the most likely cause?

⚠ Common exam trap

Test-takers frequently assume 'no output' means 'no records matched the query' (Option A), but the real issue is that the script runs successfully yet prints nothing because the field being accessed does not exist on the queried records.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The field 'u_environment' does not exist on records with sys_class_name='cmdb_ci_server'.

The script uses `getValue('u_environment')` on a GlideRecord query for `cmdb_ci` with `sys_class_name='cmdb_ci_server'`. If the field `u_environment` does not exist on that table or class, `getValue` returns null, and the `gs.print` statement outputs nothing (or an empty string). The script runs without error, but no output is produced because the field is missing, not because the query returns zero rows.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The table 'cmdb_ci' has no records with sys_class_name='cmdb_ci_server'.

    Why it's wrong here

    There could be servers but the query might still fail due to field issues.

  • The orderByDesc method is misspelled (should be orderByDescending).

    Why it's wrong here

    orderByDesc is a valid GlideRecord method.

  • The script lacks point number of rows (no rows with condition).

    Why it's wrong here

    This is a restatement, not a root cause.

  • The field 'u_environment' does not exist on records with sys_class_name='cmdb_ci_server'.

    Why this is correct

    A missing field causes the query to return no results.

About these practice questions

One of 504 original SNOW-CSA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CSA practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CSA exam.