OnDemand Users Group

Support Forums => CMOD for Multiplatforms => Topic started by: pankaj.puranik on December 11, 2012, 02:41:37 PM

Title: arsdoc delete
Post by: pankaj.puranik on December 11, 2012, 02:41:37 PM
Hi

I wanted to delete a document from CMOD that has around 30 fields.
I have the load ID and I can use load ID plus one of the 30 fields to uniquely identify the document using 'arsdoc query' with -x parameter.

Unfortunately, the arsdoc delete doesnot have -x option which means I have to pass all 30 fields to make sure only one record is deleted.
This is really frustrating.

Does anyone have any suggestions?

Thanks
Pankaj.
Title: Re: arsdoc delete
Post by: Justin Derrick on December 11, 2012, 05:56:14 PM
You should be able to use the -i option and use an SQL statement to identify your document to be deleted.

Let us know how it works out!

-JD.

Title: Re: arsdoc delete
Post by: pankaj.puranik on December 12, 2012, 07:39:57 AM
Yes -i would work.
But I wanted to avoid constructing a query with -i parameter since i will have to add 30 fields to uniquely identify a document.
If I had a -x option, i would have to just pass the load ID and one of the 30 fields.

But looks like I will have to live with the -i parameter.
Title: Re: arsdoc delete
Post by: jw on December 12, 2012, 12:16:49 PM
Pankaj,

If I understand Justin correctly, he meant something like this in your -i, rather than having all 30 fields

[-i "WHERE doc_name = '3762FAA' and pri_nid=132 and sec_nid=0"]

Hope this works for you.

-jw
Title: Re: arsdoc delete
Post by: Justin Derrick on December 12, 2012, 04:05:38 PM
Yes - the -i option allows you to do free-form SQL select statements.  JW's example was correct.  You can use any field you've defined in the AG, as well as CMOD's internal fields like DOC_NAME and DOC_OFFSET.

I would use something like "where CUST_NUM=12345 and ZIP_CODE=90210".

Just remember to be careful and test your queries.  You could cause a lot of damage with a typo.

-JD.
Title: Re: arsdoc delete
Post by: pankaj.puranik on December 19, 2012, 12:37:09 PM
pri_ind, sec_ind and doc_name - Are these CMOD defined columns?
Title: Re: arsdoc delete
Post by: jw on December 19, 2012, 01:15:47 PM
Pankaj,

Yes, they are.  But, you can use them in the -i clause.

By the way, it is pri_nid and sec_nid, not pri_ind and sec_nid

-jw