ARS-Simple

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

    if(-e './t/config.cache')
    {
        do './t/config.cache';
        $i = &CCACHE::server;
        $u = &CCACHE::user;
        $p = &CCACHE::password;
    }

    print "=== ARS::Simple 'make test' configuration. ===

Test on your own dev system where you know the user you select below
is in the administrator group.

Please enter the following information. This information will be
recorded in ./t/config.cache.  YOU SHOULD REMOVE this file once
you have finished testing as the data is in plain text.

As an alternate, skip testing and install and start trying it out!

If you want to skip the 'make test' step, just hit ENTER
three times. You can configure it later by either re-running

examples/generate_fid_hash.pl  view on Meta::CPAN

        server   => 'dev_machine',
        user     => 'greg',
        password => 'password',
        });

print "Enter the name of the Remedy form: ";
my $form = <STDIN>;
chomp $form;

#----------
my $sql = qq{select
f.fieldName,
f.fieldID,
decode(FOption, 1, 'Required ', 2, 'Optional ', 3, 'System RO', '*Unknown*'),
decode(datatype, 0, 'AR_DATA_TYPE_NULL', 1, 'AR_DATA_TYPE_KEYWORD', 2, 'AR_DATA_TYPE_INTEGER', 3, 'AR_DATA_TYPE_REAL', 4, 'AR_DATA_TYPE_CHAR', 5, 'AR_DATA_TYPE_DIARY', 6, 'AR_DATA_TYPE_ENUM', 7, 'AR_DATA_TYPE_TIME', 8, 'AR_DATA_TYPE_BITMASK', 9, 'AR_...
c.maxlength
from arschema a
join field f
on f.schemaid = a.schemaid and datatype < 30 and f.fieldID != 15
left outer join field_char c
on c.schemaid = f.schemaid and c.fieldid = f.fieldID

html/Simple.html  view on Meta::CPAN


<h2 id="get_SQL">get_SQL</h2>

<p>Run direct SQL on your server, there is only one required argument, the sql, you may optionally set the max_returns value.</p>

<p>The names of the fields can be found from the Admin Tool, under the database tab for a form. This will be the name of the field used in the database view of the Remedy form. <b>Note</b> you do need to replace spaces with and underscore &#39;_&#39;...

<p>Example method call:</p>

<pre><code> <span class="keyword">my</span> <span class="variable">$data</span> <span class="operator">=</span> <span class="variable">$ars</span><span class="operator">-&gt;</span><span class="variable">get_SQL</span><span class="operator">(</span><...
     <span class="string">sql</span> <span class="operator">=&gt;</span> <span class="string">q{select Login_name, Full_Name from User_X where Login_name like 'g%' order by Login_name}</span><span class="operator">,</span>
     <span class="string">max_returns</span> <span class="operator">=&gt;</span> <span class="number">0</span><span class="operator">,</span>
     <span class="operator">}</span><span class="operator">);</span>
</code></pre>

<p>The return is a hash reference with two keys, numMatches and rows, example:</p>

<pre><code> <span class="variable">$data</span> <span class="operator">=</span> <span class="operator">{</span>
     <span class="variable">numMatches</span> <span class="operator">=</span> <span class="operator">&gt;</span> <span class="number">2</span><span class="operator">,</span>
     <span class="string">rows</span> <span class="operator">=&gt;</span> <span class="operator">[</span>
        <span class="string">'greg'</span><span class="operator">,</span> <span class="string">'Greg George'</span><span class="operator">,</span>

lib/ARS/Simple.pm  view on Meta::CPAN

the sql, you may optionally set the max_returns value.

The names of the fields can be found from the Admin Tool, under
the database tab for a form.  This will be the name of the field
used in the database view of the Remedy form. B<Note> you do need
to replace spaces with and underscore '_' character.

Example method call:

 my $data = $ars->get_SQL({
     sql => q{select Login_name, Full_Name from User_X where Login_name like 'g%' order by Login_name},
     max_returns => 0,
     });

The return is a hash reference with two keys, numMatches and rows, example:

 $data = {
     numMatches = > 2,
     rows => [
        'greg', 'Greg George',
        'geoff', 'Geoffery Wallace',



( run in 0.616 second using v1.01-cache-2.11-cpan-49f99fa48dc )