CAD · Question #43
Which of the following GuideRecord methods run a query against a database table? Choose 3 answers
The correct answer is A. -query( ) C. query() E. get(. This question identifies GlideRecord methods used to execute database queries, despite some options containing likely typographical errors.
Question
Which of the following GuideRecord methods run a query against a database table? Choose 3 answers
Options
- A-query( )
- BrunQuery()
- Cquery()
- D-get()
- Eget(
How the community answered
(50 responses)- A90% (45)
- B2% (1)
- D8% (4)
Why each option
This question identifies GlideRecord methods used to execute database queries, despite some options containing likely typographical errors.
Although syntactically flawed with a leading hyphen, `-query()` is likely intended to represent the `query()` method, which executes the database query after setting up the query conditions.
`runQuery()` is not a standard GlideRecord method in ServiceNow.
The `query()` method on a GlideRecord object executes the configured database query, populating the GlideRecord object with matching records.
`-get()` is not a standard GlideRecord method; the `get()` method (represented by option E) is used for retrieving records, but this specific string is invalid.
While syntactically flawed with an unclosed parenthesis, `get(` is likely intended to represent the `get()` method, which runs a query to retrieve a single record based on its sys_id or a key-value pair.
Concept tested: GlideRecord database query methods
Source: https://docs.servicenow.com/bundle/utah-application-development/page/script/server-scripting/reference/r_GlideRecordAPI.html
Topics
Community Discussion
No community discussion yet for this question.