James: I have been trying to do something similar. One question. If the table on which I want to run the sql query is on a different database, what do I have to do within Remedy so it can connect to a table in that database.

Thanks
Ravi
Russell, James C wrote:
**
Hello Victor;

I don't know that this is what you're looking for, but I run a series of sql 
queries in a single escalation to populate a 'current state' kinda form--I'm 
using one query per field; might not be the most effective way in the world, 
but it works.

This has MS SQL date conversions in--oracle is different and a bit more cryptic 
(IMO--I've got those around somewhere if you need 'em):

Here's a Set Fields example that works just fine:

----
Read Value for Field From: SQL
SQL Command:
SELECT COUNT(1) FROM Your_Form_Name WHERE (Create_Date >= DATEDIFF(s, 
'19700101', DATEADD(mm,-30,getdate()))) AND (rb_TicketType = 5)

If No Requests Match: Set fields to NULL
If Multiple Records Match: Use first matching

Fields:
  Name: cntTiks
  Value: $1$
----

...there's no reason in the world that you couldn't make a set fields with an 
sql statement like:

SELECT thing1, thing2, thing3, ... ,thingN FROM Your_Form WHERE Field_name = 
'char_value' OR Field_Name2 > 84600

(or whatever--could do joins and unions against multiple forms if necessary)

..and then the Names/values in the 'Fields' section of the set fields is like:

Name: Field1   Value: $1$
Name: Field2   Value: $2$
Name: Field3   Value: $3$
  :
  :
Name: FieldN   Value: $N$

When you're choosing a value for the field, the drop-down list will give you an 
option to choose a value x from the 'SQL Result Column,' where x is a number 
between 1 and N (the number of fields you're pulling in your select statement).

Erm. For whatever it's worth.

HTH
~james



-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Victor
Sent: Sunday, May 18, 2008 12:47 PM
To: arslist@ARSLIST.ORG
Subject: Populating Table field with sql query result

Hello Listers,

It is possible to populate a table field with the result from an sql
query?
Any idea how this could be done?

Victor

_______________________________________________________________________
________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"


_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to