Thread: ars_DeleteEntry
Brought to you by:
jeffmurphy
|
From: Brad E. <bev...@fo...> - 1996-12-06 23:32:44
|
I'm having trouble getting ars_DeleteEntry to work. I'm logging into the server using a user with administrator privileges and I can successfully retrieve the entry id that meets my query requirements; however when I try to delete the entry using the following statement: ars_DeleteEntry($ctrl,$schema,$entry_id); where $schema and $entry_id are set earlier in the script, I'm getting the following error from $ars_errstr: Entry does not exist in database But it does! Has anyone else had this same kind of problem? |
|
From: David A. <D.J...@so...> - 1997-04-17 16:25:19
|
I may have an early version of ARSPerl, but it is very useful! However, a simple script I wrote, which deletes a record from a schema, fails when the entry-id is not the default length of 15, but is shorter and has a prefix. For example, I try to delete record IB000215 with the line $r = ars_DeleteEntry($ctrl, $schema, $entryid); and get the error message: Entry does not exist in database : 0000000IB000215 Is there a workaround to prevent 0000000 being prefixed? -- David Adams Computing Services University of Southampton |
|
From: Marc V. <mar...@ge...> - 1997-04-17 23:44:17
|
David Adams wrote: > For example, I try to delete record IB000215 with the line > $r = ars_DeleteEntry($ctrl, $schema, $entryid); > and get the error message: > Entry does not exist in database : 0000000IB000215 > Is there a workaround to prevent 0000000 being prefixed? This may be too simplistic but... have you tried padding it with spaces? Alternately, have you tried enclosing it in quotes. -- Marc Visconte Work phone (804) 734-1210 mailto:mar...@ge... Home phone (757) 865-1398 http://www.geocities.com/Yosemite/3223 The ideas expressed herein are only hypothetically coincident with those of my employer. (Carl Rowan is a Racist Hate-monger.) |
|
From: David A. <D.J...@so...> - 1997-04-18 11:24:18
|
>
> David Adams wrote:
>
> > For example, I try to delete record IB000215 with the line
> > $r = ars_DeleteEntry($ctrl, $schema, $entryid);
> > and get the error message:
>
> > Entry does not exist in database : 0000000IB000215
>
> > Is there a workaround to prevent 0000000 being prefixed?
>
> This may be too simplistic but... have you tried padding it with spaces?
> Alternately, have you tried enclosing it in quotes.
>
> --
> Marc Visconte
I have experimented and found a workaround: right padding with spaces!
The improved code is:
$r = ars_DeleteEntry($ctrl, $schema, sprintf("%-15s",$entryid));
--
David Adams
Computing Services
University of Southampton
|
|
From: Steve M. <Ste...@ch...> - 2009-03-31 00:35:46
|
Prior to a server upgrade and migration I need to purge 750k + records from my custom help desk application. The records contain an attachment pool. If I use ars_DeleteEntry will the corresponding b table bxxxcxxxxxxx entries be deleted as well? Thanks, Steve McDonald Sr. Remedy Applications Programmer Choice Hotels International |
|
From: jeff m. <jcm...@je...> - 2009-03-31 00:38:16
Attachments:
smime.p7s
|
Yes, although it'll take probably a long time to delete them all. You might be better off going to SQL and deleting from the H, T and B tables directly. On Mar 30, 2009, at 7:56 PM, Steve McDonald wrote: > Prior to a server upgrade and migration I need to purge 750k + > records from my custom help desk application. The records contain > an attachment pool. If I use ars_DeleteEntry will the corresponding > b table bxxxcxxxxxxx entries be deleted as well? > > Thanks, > > > Steve McDonald > Sr. Remedy Applications Programmer > Choice Hotels International > > ------------------------------------------------------------------------------ > > > -- > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users |
|
From: Thilo S. <thi...@ap...> - 2009-03-31 08:17:09
|
Just as a note, the speed of mass deletions can be vastly increased by using ars_Begin(End)BulkEntryTransaction. Of course, deleting by SQL will probably still be a magnitude faster. jeff murphy wrote: > Yes, although it'll take probably a long time to delete them all. You > might be better off going to SQL and deleting from the H, T and B tables > directly. > > On Mar 30, 2009, at 7:56 PM, Steve McDonald wrote: > >> Prior to a server upgrade and migration I need to purge 750k + records >> from my custom help desk application. The records contain an >> attachment pool. If I use ars_DeleteEntry will the corresponding b >> table bxxxcxxxxxxx entries be deleted as well? >> >> Thanks, >> >> >> Steve McDonald >> Sr. Remedy Applications Programmer >> Choice Hotels International >> >> ------------------------------------------------------------------------------ >> >> >> -- >> Arsperl-users mailing list >> Ars...@ar... <mailto:Ars...@ar...> >> https://lists.sourceforge.net/lists/listinfo/arsperl-users > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > > -- > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users |
|
From: Steve M. <Ste...@ch...> - 2009-03-31 14:12:29
|
Well, sounds like sql is the way to go. Other than the t, h, b, and bxxx tables, do I have anything else to consider? Thanks everyone. -----Original Message----- From: Thilo Stapff [mailto:thi...@ap...] Sent: Tuesday, March 31, 2009 1:17 AM To: ARSperl User Discussion Subject: Re: [Arsperl-users] ars_DeleteEntry Just as a note, the speed of mass deletions can be vastly increased by using ars_Begin(End)BulkEntryTransaction. Of course, deleting by SQL will probably still be a magnitude faster. jeff murphy wrote: > Yes, although it'll take probably a long time to delete them all. You > might be better off going to SQL and deleting from the H, T and B > tables directly. > > On Mar 30, 2009, at 7:56 PM, Steve McDonald wrote: > >> Prior to a server upgrade and migration I need to purge 750k + >> records from my custom help desk application. The records contain an >> attachment pool. If I use ars_DeleteEntry will the corresponding b >> table bxxxcxxxxxxx entries be deleted as well? >> >> Thanks, >> >> >> Steve McDonald >> Sr. Remedy Applications Programmer >> Choice Hotels International >> >> --------------------------------------------------------------------- >> --------- >> >> >> -- >> Arsperl-users mailing list >> Ars...@ar... <mailto:Ars...@ar...> >> https://lists.sourceforge.net/lists/listinfo/arsperl-users > > > ---------------------------------------------------------------------- > -- > > ---------------------------------------------------------------------- > -------- > > > ---------------------------------------------------------------------- > -- > > > > -- > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users ------------------------------------------------------------------------------ -- Arsperl-users mailing list Ars...@ar... https://lists.sourceforge.net/lists/listinfo/arsperl-users |
|
From: Joel M. <jm...@cn...> - 1996-12-06 23:47:43
|
> where $schema and $entry_id are set earlier in the script, I'm getting the > following error from $ars_errstr: > > Entry does not exist in database > > But it does! Has anyone else had this same kind of problem? > off hand, you might need to pad the entry_id with zeros. ars_padEntryid does this for you. |
|
From: Jeff M. <jcm...@sm...> - 1996-12-06 23:51:32
|
> ars_DeleteEntry($ctrl,$schema,$entry_id);
>
>where $schema and $entry_id are set earlier in the script, I'm getting the
>following error from $ars_errstr:
>
> Entry does not exist in database
>
>But it does! Has anyone else had this same kind of problem?
i use the following script frequently and have never seen an error.
it runs as an Administrator user.
#!/usr/local/bin/perl
#
use ARS;
($schema, $eid) = @ARGV;
if(!defined($eid)) {
print "Usage: $0 [schema] [entry id]\n";
exit 0;
}
$ctrl = ars_Login($SERVER, $ACCOUNT, $PASSWORD);
if(ars_DeleteEntry($ctrl, $schema, $eid) == 0) {
printf "entry $eid deleted from \"$schema\"\n";
} else {
print "Couldn't delete entry $eid from $schema: $ars_errstr\n";
}
ars_Logoff($ctrl);
|
|
From: tim.widowfield <ta...@en...> - 1996-12-09 21:19:56
|
Don't laugh. Aything's possible, right?
I haven't had much success yet. I'm using Perl 5.003 and ARS 2.1.3.
Should I jump back a rev. on Perl?
I've attached error messages. We have two compilers to choose from: cc
(Metaware) and gcc. With either, compilation fails. Using "cc" I get
complaints about Perl's av.h. Using "gcc" I get errors from the ARS.c
file, referencing av.h again.
--------------------------
Here's what I see from cc:
damfino(69)# make
/bin/cc -c -I/usr/ar/api/include -I/usr/include -I/usr/ucbinclude -I/usr
/gnu/include -O -Xa -DOVR_DBL_DIG=17 -DVERSION=\"1.3\" -DXS_VERSION=\"1.3\"
-Kpic -I/usr/gnu/lib/perl5/sys3k/5.003/CORE -g -DWASTE_MEM -DPROFILE ARS.c
(/bin/cc:) Warning: -g or -ql specified, optimization restricted
NCR High Performance C Compiler R1.0c
(c) Copyright 1992-94, NCR Corporation
(c) Copyright 1987-94, MetaWare Incorporated
E "/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h",L12/C13: (syntactic) unexpected
symbol:'<IDENTIFIER>':xav_fill
REPAIR: ',' was inserted before '<IDENTIFIER>':xav_fill@"/usr/gnu/lib/perl5/sy
s3k/5.003/CORE/av.h",L12/C13
E "/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h",L13/C13: (syntactic) unexpected
symbol:'<IDENTIFIER>':xav_max
REPAIR: ',' was inserted before '<IDENTIFIER>':xav_max@"/usr/gnu/lib/perl5/sys
3k/5.003/CORE/av.h",L13/C13
2 user errors No warnings
*** Error code 8 (bu21)
make: fatal error.
-----------------------------
Here's some of the stderr from gcc:
.....many warnings deleted......
In file included from /usr/gnu/lib/perl5/sys3k/5.003/CORE/perl.h:619,
from ARS.c:34:
/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:12: parse error before `ssize_t'
/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:12: warning: no semicolon at end of str
uct or union
/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:13: warning: data definition has no typ
e or storage class
/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:22: parse error before `}'
In file included from ARS.c:34:
/usr/gnu/lib/perl5/sys3k/5.003/CORE/perl.h:1367: parse error before `top_env'
/usr/gnu/lib/perl5/sys3k/5.003/CORE/perl.h:1367: warning: data definition has no
type or storage class
ARS.c: In function `dup_Value':
ARS.c:873: warning: assignment makes pointer from integer without a cast
ARS.c:876: warning: assignment makes pointer from integer without a cast
*** Error code 1 (bu21)
make: fatal error.
--Tim Widowfield,
tim...@en...
|
|
From: Jeff M. <jcm...@sm...> - 1996-12-09 21:27:06
|
>Here's some of the stderr from gcc: > >In file included from /usr/gnu/lib/perl5/sys3k/5.003/CORE/perl.h:619, > from ARS.c:34: >/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:12: parse error before `ssize_t' ssize_t is usually defined in sys/types.h or unistd.h .. trying defining I_SYS_PARAM and PARAM_NEEDS_TYPES when compiling ARSperl maybe? sorry, no experience on ncr unix. |
|
From: tim.widowfield <ta...@dn...> - 1996-12-09 21:43:51
|
That's a start. Thanks. BTW, please note the corrected e-mail address above. --Tim Widowfield, tim...@en... On Mon, 9 Dec 1996, Jeff Murphy wrote: > >Here's some of the stderr from gcc: > > > >In file included from /usr/gnu/lib/perl5/sys3k/5.003/CORE/perl.h:619, > > from ARS.c:34: > >/usr/gnu/lib/perl5/sys3k/5.003/CORE/av.h:12: parse error before `ssize_t' > > > ssize_t is usually defined in sys/types.h or unistd.h .. > > trying defining I_SYS_PARAM and PARAM_NEEDS_TYPES when compiling ARSperl > maybe? > > sorry, no experience on ncr unix. > |
|
From: Kurt S. <ku...@mi...> - 1997-01-13 10:00:54
|
Hi
Having a few problems accessing structures within ARSperl. It's more me
not understanding what is going on than anything else (I am very much a
perl novice). So, I have the following bits of code (all borrowed from
GetFilter.pl), don't quite print what I want.
(@filters=ars_GetListFilter($ctrl,$schemaname,0)) || die "can't get
filters: $a
rs_errstr";
foreach $filtername (@filters) {
print "filter: $filtername\n";
($finfo = ars_GetFilter($ctrl, $filtername))
|| die "error in GetFilter: $ars_errstr";
print "Name : \"".$finfo->{"name"}."\"\n";
print "Schema : \"".$finfo->{"schema"}."\"\n";
print "Exe on : ".Decode_opSetMask($finfo->{"opSet"})."\n";
print "Exe Order : ".$finfo->{"order"}."\n";
print "Enable : ".$finfo->{"enable"}."\n";
print "Query : ".$finfo->{"query"}."\n";
}
Example output:
Query: ARQualifierStructPtr=SCALAR(0x181498)
From GetFilter.pl we get the following output. What I would like to
understand is why field-id's are printed instead of values and sometimes
with SetField operations, the values are not printed with them.
actionList :
Action 1:
Notify:
notifyText: Your group has been assigned ticket
$1$.
It is a $536870914$ call from $536870915$.
user: $536870918$
notifyMechanism: User Default
notifyMechanismXRef: 0
subjectText: Group Assignment $1$ - $536870914$ -
$5368
70915$
fieldIdListType: Changed
Field List: ARRAY(0x19e248)
Set Fields example:
Action 2:
Set Fields:
fieldId: 536870913
Arithmetic:
Expression: + $4$ ) +
Any help would be appreciated.
bye
Kurt
|
|
From: Jeff M. <jcm...@sm...> - 1997-01-13 16:56:46
|
>Example output: > > Query: ARQualifierStructPtr=SCALAR(0x181498) > the qualifier field is not available as plain-text. it is a compiled field that arsperl doesnt decode. when you do $q = ars_LoadQualifier(..., "'Login name' = \"bart\""); this compiles the qualification 'Login name' = "bart" into $q. once done, arsperl can not decode it. when you print the Qualifier and see the above output, what you are really printing is the address of the compiled qualifier (which is stored with filters and active links). jeff |
|
From: Joel M. <jm...@cn...> - 1997-01-13 17:30:41
|
actually there is an undocumented function called ars_perl_Qualifier
that expands a qualifier structure into a hash of sorts. I added it
when working on a web interface, but forgot about it.
$h = ars_perl_Qualifier($q);
print join(",",%$h);
the c structure looks like this:
typedef struct ARQualifierStruct {
unsigned int operation;
union {
struct {
struct ARQualifierStruct *operandLeft;
struct ARQualifierStruct *operandRight;
} andor;
struct ARQualifierStruct *not;
ARRelOpStruct *relOp;
} u;
} ARQualifierStruct;
the hash returned by ars_perl_qualifier has the members:
oper = "and", "or", "not", "rel_op"
left = qualifier (only for and, or)
right = qualifier (only for and, or)
not = qualifier (only for not)
rel_op = rel_op (only for rel_op)
a rel_op is:
oper = "==", ">", ">=", "<", "<=", "!=", "like", "in"
left = FieldValueOrArithStruct
right = FieldValueOrArithStruct
FieldValueOrArithStruct is:
fieldId = integer
value = scalar value (integer, string, float, etc.)
arith = ArithOpStruct
statHistory = StatHistoryValue
valueSet = list of scalar values
variable = integer /* I think this is for passing
macro arguments */
queryValue = QueryValueStruct
queryCurrent = integer
...and I don't have time to keep going right now. You probably don't
want to have to walk this expression tree anyways.
You might want to try this instead:
ars_Export($c, "Filter", $filter_name)
and look at the text it gives you.
> >Example output:
> >
> > Query: ARQualifierStructPtr=SCALAR(0x181498)
> >
>
>
> the qualifier field is not available as plain-text. it is a compiled
> field that arsperl doesnt decode.
>
> when you do
>
> $q = ars_LoadQualifier(..., "'Login name' = \"bart\"");
>
> this compiles the qualification 'Login name' = "bart" into $q.
> once done, arsperl can not decode it. when you print the Qualifier and
> see the above output, what you are really printing is the address of
> the compiled qualifier (which is stored with filters and active links).
>
> jeff
>
|