The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Document attachment using sql

SOLVED
Go to solution
Highlighted
Varun_PPM
Super Collector

Document attachment using sql

We have requirement to attach document to package using either a SQL script or ppm command.

Found a way  to create the refrence to package as attachment using sql. but not sure how to create entry in knta_document table which points to real file.

Another question is how ppm store attachments i can see numbered folder inside attachment folder in which attachments exist on server...

 

Please help

4 REPLIES
Kerim KILIC
Frequent Visitor

Re: Document attachment using sql

hi,

 

can you please share which package contain that function to attach a file to package. in ppm attachments stored in db with holder id, and this id is the prefix for attachment in file system. if you checked with that package you are able to attach a file, then no need to worry about documents table, it should do it also.i checked util packages there is no such function.

 

regards

Varun_PPM
Super Collector

Re: Document attachment using sql

Hi,

 

yes you are right it is storing the documents with holder_id. I am using the KCRT_REQUEST_UTIL.CREATE_REFERENCES package.But it is not updating the document table.It is just updating the reference table.

 

Do you know any other OOTB function for this.

Utkarsh_Mishra
Honored Contributor

Re: Document attachment using sql

Hi Varun,

 

The number folder in the attachment directory refers to the last two digits of "DOCUMENT_ID" in KNTA_DOCUMENTS table.

 

So if the ID is genereted like 32456, then the document will be stored in "56" folder, further within this directoy the file is stored with the name prefixed with Document ID.

 

In PPM there no OOTB SQL utility to upload the file, rather it is done via Java utility/classes.

 

In order to implement your requirement, you can proceed like:

 

  1. Create a new record in KNTA_DOCUMENT table
  2. Get the new Document _id
  3. FTP/SCP the file to the Attachement directory based on the Document_id
  4. Finally use KCRT_REQUEST_UTIL.CREATE_REFERENCES to create a reference
Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Varun_PPM
Super Collector
Solution

Re: Document attachment using sql

Right utkarsh i am able to figure it out this process and able to attach it.

 

But it is cumbersome implementation there should be OOTB utility to do it in simple way.Thanks :)

//Add this to "OnDomLoad" event