ARS-Simple

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
    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

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
        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

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<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

666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
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.356 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )