Skip to main content
Question

Create new document with local file by PLSQL

  • March 7, 2023
  • 5 replies
  • 334 views

Forum|alt.badge.img+7
  • Sidekick (Customer)

how to Create new document with local file by PLSQL? like create new document revision>click check in>select local file and open.

5 replies

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • March 7, 2023

It can be done if the "local" file is on the database server, using the utl_file package to read the file contents.

Can you tell us more about what it is that your want to achieve?

 


Forum|alt.badge.img+7
  • Author
  • Sidekick (Customer)
  • March 8, 2023

Mathias,

I want to create a new document revision with a local file check in by PLSQL. could you please share me sample of the code? thanks!

can the file in oracle database ‘Directories’ path? if no, I can try to move the file to database server folder.


Forum|alt.badge.img+15
  • Superhero (Employee)
  • March 8, 2023

@lion 

Hope below post will give you some insight.

 


Forum|alt.badge.img+7
  • Author
  • Sidekick (Customer)
  • March 8, 2023

Hi Sahan,

thanks for the info, I have saw the codes yesterday, the file is empty, I want the file is point to a local file and can checkin to the document revision.


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • March 8, 2023

You basically can combine the code in the post shared by Sahan with using utl_file. And yes, you need a DIRECTORY object in Oracle to do it.

I think you need to put together the complete code yourself, or try with ChatGPT 🙃 (it can actually produce PL/SQL code snippets).

Good luck!