ARSperl
view release on metacpan or search on metacpan
# DESCRIPTION
# this routine, when given an encoded status history field
# (returned by GetEntry) will decode it into a hash like:
#
# $retval[ENUM]->{USER}
# $retval[ENUM]->{TIME}
#
# so if you have a status field that has two states: Open and Closed,
# where Open is enum 0 and Closed is enum 1, this routine will return:
#
# $retval[0]->{USER} = the user to last selected this enum
# $retval[1]->{TIME} = the time that this enum was last selected
#
# You can map from enum values to selection words by using
# arsGetField().
sub ars_decodeStatusHistory {
my ($sval) = shift;
my ($enum) = 0;
my ($pair, $ts, $un);
my (@retval);
foreach $pair (split(/\003/, $sval)) {
if($pair ne "") {
universe of Remedy and such ...
I'm looking for a perl library which could take standard ARS/Remedy style
query and return the query in Sybase Transact SQL format. Something like
this:
@SYBASE_SQL = get_SybaseSQL($ARS_QUERY);
where:
$ARS_QUERY = "'Field' = \"$value\" ...etc"
and:
@SYBASE_QUERY would be something like this:
select Ticket_No from Schema_Name
WHERE Field = '$value'
-----------------------------------------------
allow substitution of current transaction values
in qual and recompilation of qual. this facilitates
the retrieval of dynamic query menu items
example/ars_GetListSQL.pl view on Meta::CPAN
my ( $server, $user, $password ) = ( shift, shift, shift );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $password ) )
|| die "ars_Login: $ars_errstr";
# The arschema table contains information about what schemas are
# in the system. We'll grab some of the columns and dump them.
my $sql = "select name, schemaid, nextid from arschema";
print "Calling GetListSQL with:\n\t$sql\n\n";
( my $sql_hash = ars_GetListSQL( $ctrl, $sql ) )
|| die "GetListSQL Failed: $ars_errstr\n";
# Log off nicely
ars_Logoff($ctrl);
html/manual/ars_GetListEntry.html view on Meta::CPAN
<body>
<h2>
<code>ars_GetListEntry(ctrl, schema, qualifier, maxRetrieve=0, firstRetrieve=0,...)</code>
</h2>This function is used to retrieve the list of <code>entry_id</code>s and results list
strings from the specified schema. The entries are returned as an array of <i>(entry_id,
resultslist)</i> pairs. If you wish to retrieve all entries in the schema (upto the maximum
allowed by the server or specified by you as the <code>maxRetrieve</code> parameter) you should
load a qualifier with something like <code>(1 = 1)</code>.
<p>
See also the <a href="ars_GetListEntryWithFields.html">ars_GetListEntryWithFields</a> which
is similar to GetListEntry but returns selected fields as separate values and not as
formatted strings.
</p>
<p>
The "..." in the above function can be one of two things:
</p>
<ol>
<li>A Hash Reference that specifies what you want the query list to look like, followed by
(optionally) a list of field ids and sorting types to indicate how you want the query list
sorted.
</li>
html/manual/ars_GetListSQL.html view on Meta::CPAN
<DL>
<DT><B>On success</B><DD>
Returns a HASH.
<DT><B>On failure</B><DD>
Returns undef.
</DL>
<P>Example:
<PRE>
($a = ars_GetListSQL($ctrl, "select name, schemaid, nextid from arschema")) ||
die "$ars_errstr";
</PRE>
<I>ars_GetListSQL was introduced in version 1.5 of ARSperl</I>
<P>
<HR WIDTH="30%">
<P>
<A HREF="toc.html"><IMG ALT="<--" SRC="arrow.gif" ALIGN=CENTER> Table of Contents </A>
<p>
t/10getlist.t view on Meta::CPAN
@a = ars_GetListSchema($c, 0, 0 + 1024);
ok(@a, "GetListSchema") ||
diag "GetListSchema $ars_errstr";
# since this test can fail and still be OK
# (/etc/ar is empty) we wont do it.
#@a = ars_GetListServer();
# this test might fail if the sql is bad or this
# isnt an admin account we are running with
@a = ars_GetListSQL($c, "select name, schemaid, nextid from arschema");
ok(@a, "GetListSQL") ||
diag("GetListSQL ($ars_errstr) - it's OK if this fails");
@a = ars_GetListUser($c);
ok (@a, "GetListUser") ||
diag("GetListUser ($ars_errstr)");
@a = ars_GetListVUI($c, "ARSperl Test");
ok (@a, "GetListVUI") ||
diag("GetListVUI ($ars_errstr)");
t/aptest50.def view on Meta::CPAN
export-version : 6
escl-monthday : 67372036
escl-weekday : 0
escl-hourmask : 74880
escl-minute : 0
wk-conn-type : 1
schema-name : ARSperl Test
schema-name : ARSperl Test2
escl-query : 4\1\1\4\2\4\10\NOT-really\
action {
direct-sql : 1\@\24\select * from all_tables\
}
action {
notify-user : jcmurphy
notify-mech : 99
notify-pri : 3
notify-xref : 536870917
notify-behvr: 0
notify-perm : 0
notify-text : notifytext
notify-subj : subjectline
t/aptest51.def view on Meta::CPAN
export-version : 6
escl-monthday : 67372036
escl-weekday : 0
escl-hourmask : 74880
escl-minute : 0
wk-conn-type : 1
schema-name : ARSperl Test
schema-name : ARSperl Test2
escl-query : 4\1\1\4\2\4\10\NOT-really\
action {
direct-sql : 1\@\24\select * from all_tables\
}
action {
notify-user : jcmurphy
notify-mech : 99
notify-pri : 3
notify-xref : 536870917
notify-behvr: 0
notify-perm : 0
notify-text : notifytext
notify-subj : subjectline
( run in 0.823 second using v1.01-cache-2.11-cpan-49f99fa48dc )