Service Desk Practitioners Forum
cancel

Meaning of Query and writing SQL statements in SC

Highlighted
Krish-SC
Outstanding Contributor.

Meaning of Query and writing SQL statements in SC

I cannot understand the meaning of this query :

$query="(full.name#\""+toupper($requested.for)+"\" or contact.name#\""+str($requested.for)+"\") and contact.name>\"9999\""

Can you please convert this to simple SQL statements and point out how to write SQL statements in SC?
2 REPLIES
Steve Liddle
Trusted Contributor.

Re: Meaning of Query and writing SQL statements in SC

Not sure where you got that syntax from? Maybe from a database trace?

It looks like it's a query based on the name associated with an item. Doesn't look much like the queries that I run.

Here is a simple query to retrieve the Service Call row based on Service Call ID:
select sc.ser_requestor_per_oid, sc.ser_caller_per, sc.ser_ass_per_from_oid
from servicedesk.itsm_servicecalls sc
where sc.ser_id = '206604'

servicedesk is the name of the schema, you will need to change that to your schema name.
Krish-SC
Outstanding Contributor.

Re: Meaning of Query and writing SQL statements in SC

Hi,

Can you tell me which ver. of Service Center are you using ?
Mine is SC6.2.4
The Query is actually an expression in a complex link.

Meaning is understood.
The field full.name starts with uppercase of the variable "$requested.for" or contact.name field starts with string($requested.for) and contact.name field > 9999.

I just do not understand where to keep "" and / in the expression?