Need suggestions to write a PL/SQL program

Hi,
We have some readme documents in different places. we need to keep the docs in specified folders. for example if we have around 100 docs we need to figure out the required docs by giving the just any one word from that doc name.
now the requirement is need to keep all the docs in one specified folder (check the product name, if the product is there then it will pick all the docs related to that particular product and keeps in separate folder). whenever we need to find out any one of the document from that product we need to give the short word from that doc name then it will show you the required doc.
So could you please let me know is it possible to write any PL/SQL program for the above requirement else suggest me which one will support to resolve the above requirement.
Kindly suggest me for the above request.
thanks in advance.

You may want to consider loading the documents into blobs or using BFILES.
BFILE defnition
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements001.htm#SQLRF50996
BLOB definition
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements001.htm#SQLRF50997
Regardless of whether you use BLOB's or BFILE's, you'll have to build a metadata table for each document.
For example, if you decided upon BLOB's, you would need some kind of metadata table as follows;
create table doc_table (id number, doc_name varchar2(20), b blob);
insert into doc_table values (1, 'DOC_A', to_blob('A'));
insert into doc_table values (2, 'DOC_B', to_blob('B'));
commit;
create table doc_metadata (id number, keyword varchar2(20));
insert into doc_metadata values (1, 'A');
insert into doc_metadata values (2, 'B');
commit;You would then search for a document based on a keyword, for example,
to find document A;
select dt.doc_Name      
from   doc_table    dt
      ,doc_metadata dm
where  dt.id = dm.id
and    dm.keyword like 'A';You could add more columns (as you like), for example location, size etc.

Similar Messages

  • Need to take Print out - PL SQL Program / Unix

    Hi,
    I need to take print out from a file already created in Database Server in a specific path to a printer. Any PL SQL program or any shell script is there to do this??
    Thanks,
    Neil

    Neil_80 wrote:
    I need to take print out from a file already created in Database Server in a specific path to a printer. Any PL SQL program or any shell script is there to do this??Not enough information.
    {message:id=9360002}
    It's perfectly possible, but will depend on where your data is and whether it's already a printer output file etc.
    e.g. you could use the dbms_scheduler package to call a command line that sends the file directly to the printer device
    However, the specifics of that will depend on your database version and your operating system, and what file you're trying to send.

  • Need suggestion on image storing in SQL Server

    Hi All,
      I want to store image into a column. I would like to know which datatype is the best to store image and which file format(bmp,jpg,png,...) is the best to store and to retrieve.We are using SQL Server 2005 Enterprise Edition.
      Waiting for valuable replies.
     Thanks and Regards
     Sridhar.R

    That is right but the OP mentioned that he uses SQL Server 2005.... BTW IMAGE data type  is still presented in SQL Server 2012 :-)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • PL/SQL Program for automation

    Hi All,
    I want to write a Pl/sql program for the following requirement.
    1. wnat to connect to remote desktop .
    2. There we can find one more DB like AS-access. This one contains one file( ltake it as "XYZ" i)n some particular path.
    3. want to save this file in share folder.
    4. this share folder contains some "abc.txt" file.
    5.want to replace the data which XYZ contains.
    6. It is already having one ".XLS" file in share folder. want to delete it. ( because while running the exporting data the ".XLS" file created daily)
    7. now in share folder we have one ".mdb" file.If we click on that it will ask like "create Report"," Exit".
    8. we should click on "Create Report"
    9.then one pop up will come like "All the exisiting data will be lost",then press "OK"
    10. Again one window will open. It contains 2 buttopns. 1. Import Data 2. Export data.
    11.Click on Import data. Then it will ask for "Password"
    12.After giving the password it will import the whole data. ( It's taking around Hr time)
    13. After that one pop up will come says " Import completed". then press OK and then click on "Export data"
    14.After clicking this it will generate ".xls" file in share folder.
    15. after that open that ".XLS" file and then Goto Tools --> Macros --> Macros, to run the Macros from Excel sheet.
    16. Run the macro - "PERSONAL.XLS!macNewEFG".
    17.Once done, save the ".xls" as "Report - <Month 'YY>.xls" in share folder.
    18.Send then this generated report to respective mail-ids automatically.
    daily manually we are doing this job. But I am planning to do it automatically.
    so can any one please give me ur suggestions fir this.
    Thanks in adv.

    Hi,
    thanks for your quick response.Can you please suggest me how to write a shell script for this .
    I hope this is not the correct place to ask this.But please help me out regarding this.
    Thank you.

  • Program using Native SQL ... Need suggestion.. Look into code

    Hi Friends ,
    I need your Inputs to solve the new requirement , which need to be solve using Native SQL,
    For this i need to connet to data base 'SIP'.
    The table used for this  are SAPI.TRANSACTION
    fields in SAPI.TRANSACTION
             -  SYSTEMCODE
             - BATCH_ID
         and more
    the above two fields are selection parameters based on which i need to get data :
    please rectify the code and also  help me in this
      TRY.
          EXEC SQL.
            CONNECT TO :'SIP'
          ENDEXEC.
          IF sy-subrc NE 0.
    Error Message
          ENDIF.
          EXEC SQL.
            OPEN dbcur FOR
              SELECT SYSTEM CODE   BATCH_ID
                     FROM SAPI.TRANSACTION
    can i use where condition here , i tried to put the selection parameters here
    and tried to put the internal table , but the programs gets terminated,
    How should i get the fields from table SAPI.TRANSACTION
           IF sy-subrc <> 0.
           RAISE EXCEPTION TYPE cx_sy_native_sql_error.
           ENDIF.
          ENDEXEC.
    DO.
      EXEC SQL.
          FETCH NEXT dbcur INTO :BATCH_ID
    Here i want to get batch id and delete data from other table SAPI.BATCH
      ENDEXEC.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
      ENDIF.
    ENDDO.
          EXEC SQL.
            CLOSE dbcur
          ENDEXEC.
          EXEC SQL.
            DISCONNECT :'SIP'
          ENDEXEC.
      ENDTRY.

    Hi Anirban, I tried that and it still gives the same error:
    - "itab_mytable" cannot be a table, a reference, a string, or contain any of these objects. any of these objects"
    itab_mytable has been declare as an internal table.
    Basically, from the code in the link you gave me, I have made the following changes:
    REPORT demo_native_sql.
    TYPES: BEGIN OF st,
            connid   TYPE spfli-connid,
            cityfrom TYPE spfli-cityfrom,
            cityto   TYPE spfli-cityto,
          END OF st.
    DATA: itab_mytable TYPE TABLE OF st.
    <...>
    EXEC SQL.
      SELECT connid, cityfrom, cityto
      INTO   :itab_mytable
      FROM   spfli
    ENDEXEC.
    But this doesn't work. If the internal table is replaced with a one-lined work area, then the select statement works.

  • Need help in writting the sql

    The sql
    select 'alter system kill session '||sid||','||serial#||';' from v$session where username= 'EV05';
    give the output in the below given form
    alter system kill session 69,38769;
    But i need the output to be
    alter system kill session '69,38769';
    Can some one re-writes the sql select statment,
    Thanks
    Naveen

    Naveen,
    This isn't the forum for help with writing SQL - rather with using the SQL Developer product. In future, I would suggest that you use the SQL and PL/SQL forum for these sorts of questions.
    However, to answer your question this time, you can include a ' in a string by having two together ie 'fred''s' will return the string fred's.
    The following SQL will give you the result you want:
    select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username= 'EV05';

  • Help needed in executing pl/sql programs

    hi all
    iam new to PL/SQL programming
    i have installed oracle 9i
    iam trying to practice some sample pl/sql programs
    i have opened oracle 9i and typed these commands
    sql>ed sum
    then a notepad opens where i type my pl/sql program and save it and then return back to oracle 9i and type this
    sql>@ sum
    then my pl/sql program gets executed.......but iam not getting any output
    its comig as procedure implemented succesfully
    is it compulsory to open notepad to execute pl/sql progams or we can direclty type the programs in oracle 9i
    please help in this matter ASAP
    Regards
    Suresh

    Yes, you can type the program directly at the SQL prompt, but editing will be a bit difficult.
    You should use some good editor that allows you to edit properly and then run like you did.
    You need to do:
    SQL> set serveroutput onbefore running your program to see dbms_output messages.

  • My daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    my daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    If you know that you will not be asked to design GUI interfaces, and the C programming course will adhere to command line compilation environments, then get the Xcode command-line developer tools, and skip the extra complication of Xcode until you absolutely need it. Apple has kicked GNU C to the curb and is rightly so, using Clang/LLVM compiler technology.
    Sign up for a free Apple Developer account using your Apple ID, and then visit the Mac Dev Center, and towards the bottom of the page, you will see additional downloads. Click on the associated, all down loads link. Know your OS X version beforehand, as the command-line tool releases are tied to general operating system versions, and the most recent Xcode version.  That said, there are currently two March 9, 2015 command-line tools for Xcode 6.2 — one for OS X 10.9 Mavericks, and the other for OS X Yosemite.

  • HOW TO WRITE QUERY OR PL/SQL PROGRAM FOR THIS

    I HAVE TABLE X
    SELECT ENO FROM X
    ENO
    123
    423
    332
    562
    678
    986
    621
    WHEN I RUN PL/SQL PROGRAM I WILL PASS PARAMETER
    FOR EXAMPLE LIKE 134
    I NEED OUTPUT LIKE
    134 EXIST OUTPUT
    123
    423
    332
    562
    621
    134 NOT EXIST OUTPUT
    678
    986
    Regards
    Dev

    This?
    <tested in TOAD>
    SQL> accept my_parm
    old: with t as (
    select '123' eno from dual union all
    select '423' from dual union all
    select '332' from dual union all
    select '562' from dual union all
    select '678' from dual union all
    select '986' from dual union all
    select '621' from dual )
    select eno || ' ' || output_type results
    from (
    select to_char(&&my_parm) eno, 'EXIST OUTPUT' output_type, 1 output_id
    from dual union all
    select null eno, null output_type, 3 output_id
    from dual union all
    select to_char(&&my_parm) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
    from dual union all
    select
    eno,
    null,
    case when regexp_instr(eno,'[' || &&my_parm || ']') >0
    then 2
    else 5
    end output_id
    from t
    order by output_id, eno
    new: with t as (
       select '123' eno from dual union all
       select '423' from dual union all
       select '332' from dual union all
       select '562' from dual union all
       select '678' from dual union all
       select '986' from dual union all
       select '621' from dual )
    select eno || ' ' || output_type results
    from (
       select to_char(134) eno, 'EXIST OUTPUT' output_type, 1 output_id
       from dual union all
       select null eno, null output_type, 3 output_id
       from dual union all
       select to_char(134) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
       from dual union all
       select  
          eno,
          null,
          case when regexp_instr(eno,'[' || 134 || ']') >0
             then 2
             else 5
          end output_id
       from t
    order by output_id, eno
    SQL> with t as (
       select '123' eno from dual union all
       select '423' from dual union all
       select '332' from dual union all
       select '562' from dual union all
       select '678' from dual union all
       select '986' from dual union all
       select '621' from dual )
    select eno || ' ' || output_type results
    from (
       select to_char(134) eno, 'EXIST OUTPUT' output_type, 1 output_id
       from dual union all
       select null eno, null output_type, 3 output_id
       from dual union all
       select to_char(134) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
       from dual union all
       select  
          eno,
          null,
          case when regexp_instr(eno,'[' || 134 || ']') >0
             then 2
             else 5
          end output_id
       from t
    order by output_id, eno
    RESULTS            
    134 EXIST OUTPUT   
    123                
    332                
    423                
    621                
    134 NOT EXIST OUTPUT
    562                
    678                
    986                
    10 rows selected.Message was edited by:
    MScallion

  • I have a Mac.  I need  suggestions on what program to purchase to create a few PDF files

    I have a Mac.  I need  suggestions on what program to purchase to create a few PDF files

    ~graffiti wrote:
    Why would you say that LiveCycle is the only thing to recommend (but isn't available for Macs) then bring up InDesign?
    If it can't be done by the Mac OS (she hasn't mentioned what she has) then it can be done with Acrobat. She asked about a program to create PDF files. That's pretty much what Acrobat does.
    where is whatI said.
    Being That LiveCycle designer is not availble for Mac. That would be about the only thing to recommend. InDesign Maybe but more pricey.
    The part I've underline refers to Acrobat.  InDesign Maybe but more pricey referes to, Indesign being more expensive than Acrobat.

  • Need suggestion for choosing Java development enviroment

    Hi Evereyone,
    I am new to Java Desktop Application.I need help on choosing proper Java technologies and development tool.
    We have an existing CLIENT/SERVER based distributed control system, which was developed in C++(Server side) and VB(Client GUI).Now we are think of migrating the system to Java platform.
    Here is the outline:
    We want to create web based application that will run on windows and linux (linux on embedded PC).
    The application should be able to support 10 � 100 users at once accessing/editing database.
    We will also need to create a communication server that will run on web server P.C. that will communicate tcpip to field panels/log to db, as well as allow web screens to send/receive commands with field panels etc.
    Could any one give me some suggestion about it?
    I am thinking of Using J2SE 5.0, including RMI, JDBC and Swing for GUI. As for field panels, may choose J2ME.
    Thank you very much in advance.

    Thanks, zadok .
    Actually, I don't have the system requirements neither. All I know is the following outline:
    "We want to create web based application that will run on windows and linux (linux on embedded PC).
    The application should be able to support 10 � 100 users at once accessing/editing database.
    We will also need to create a communication server that will run on web server P.C. that will communicate tcpip to field panels/log to db, as well as allow web screens to send/receive commands with field panels etc."
    It is a interview question, which need me to do research and give some suggestions. What I want to know is to figure out what kind of Java technology is necessary for developing this system because I want to make sure I head to right direction.
    I know somehow it is hard to give suggestion based on this limited information.
    One more thing I was confusing is the server-side architecture.
    I need suggestion about sever side architecture:
    a. write a dedicated server-side program, which act
    as communication server to monitor and control field
    panel, also act as server-side applicaiton by using
    RMI to communicate with Client-side communication.
    b. choose a general web server architecture. Put
    everything in server side in Web Server, for example
    Tomcat AS container, implementing the Communication
    server as Web Service and the request from
    Client-side go to Web Server first, then dispatch to
    a proper web service.Why did you not include this information in the original question!
    Why don't you just use Tomcat?
    For your answer, "Why don't you just use Tomcat?", does it mean Tomcat without Web Service will be enough for this system development? Could you give me some detail about it?
    Thank you very much, zadok.

  • Need Suggestion/advice

     
    Hi guys,
    I would like to be advised from experts on one career related question.
    I have 5 + years of Experience as a DEV and Test.
    I had mostly worked on VB6, .NET 1.1[ asp.net ,C#] for 3 years as DEV and since 2 years i am into Software System testing [ its more related to Functionality Testing of applications built using .NET [ asp.net/c#, Sql server 2005 ].
    I would like to switch the career to Core Development again and would like to seek experts's adivice..
     Iam interested in learning SQL Server 2005 advanced features[ BI]:
    Could you pls suggest me one area in SQL server 2005  from below[ parameters:I should be able to learn it quickly on my own,great demand in the market , great scope for development in near fure etc.,] :
    1) SSIS
    2) Analysis Services
    3) Reporting Services etc.,
    or any other suggestions are welcome..I appreciate your time responding to this thread.
    thanks!

    Just wondering why do you want to use SQL Server 2005 when SQL Server 2014 is released?
    Start from the latest release - you will be more marketable.
    I think you can start from SSRS as this is the simplest of these 3. You can find lots of good articles and you may want to read articles in TechNet Wiki, in particular you may find these articles helpful
     TechNet
    Guru Contributions - SQL BI and Power BI
    (Hopefully someone will update this article with 2014 articles). I need
    to write a new blog post about it.
    Hmm, now that I checked the creation date of that thread no wonder the OP was speaking of 2005 at that time. I bet he is already proficient in all these technologies...
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • CS5 do I need a licence to sell my flash programs?

    hi guys,
    im new to CS5 but alot of my Action Script 3 tutorials and books require me to install it, (namely to create MovieClip files).
    My question is I intend to write software using flash that I can then sell commercially but im confused as to what licence I would need to do that? or if my CS5 licence would need to be valid for as long as I sell my software.....
    so far I have the trial version of CS5 Pro to continue coding but after reading this part of the user agreement (see below) it suggests that I cannot sell software with any 'output' files I produce during the 30 day trial... is this correct? what licence, if any, do I need to sell my flash programs created using CS5 Pro and will I need to keep it renewed once the program development is finished? thanks in advance.
    2.1.2 The Software, or portions of the Software, that are provided with a serial number designated for “evaluation purposes” or other similar designation (such as Software or a serial number supplied as “EVAL” under a separate ordering document) and that includes an expiration date (“Evaluation Software”) may only be installed and used on Computers for demonstration, evaluation, and training purposes only and only if any Output Files or other materials produced through such use are used only for internal, non-commercial, and non-production purposes. The Evaluation Software will automatically time out with or without prior notice. You may not use such Evaluation Software after any applicable time-out period has ended, unless you input a valid serial number under Section 2.2. ACCESS TO AND USE OF ANY OUTPUT FILES CREATED WITH SUCH EVALUATION SOFTWARE IS ENTIRELY AT YOUR OWN RISK.

    Basically, if you pay for the software and activate it you're good to go.  When you buy it, you are licensed to use it for the rest of your life for creating things for profit.
    I am not a legal authority in these matters, but these discussions come up in the forums one in a while.

  • 1z0-144 PL/SQL Programming Recommended books

    Hello everybody,
    I am studying for the 1z0-144 exam, and I need a few suggestions on the study materials.
    I have already downloaded the PL/SQL Language Reference guide and Matthew Morris certification guide, and I am wondering whether it is worth investing on one of these two books:
    1) Oracle PL/SQL Programming by Steven Feuerstein and Bill Pribyl (It has very good reviews on Amazon)
    2) Oracle Database 11g PL/SQL Programming (Oracle Press) by Michael McLaughlin  (It does not have good reviews as many readers complain about typos and redundant content)
    Alternatively I have also seen the Oracle Database 12c PL/SQL Programming book also by Michael McLaughlin.
    Thanks in advance for any suggestions
    Michele

    user6714349 wrote:
    Hello everybody,
    I am studying for the 1z0-144 exam, and I need a few suggestions on the study materials.
    I have already downloaded the PL/SQL Language Reference guide and Matthew Morris certification guide, and I am wondering whether it is worth investing on one of these two books:
    1) Oracle PL/SQL Programming by Steven Feuerstein and Bill Pribyl (It has very good reviews on Amazon)
    2) Oracle Database 11g PL/SQL Programming (Oracle Press) by Michael McLaughlin  (It does not have good reviews as many readers complain about typos and redundant content)
    Alternatively I have also seen the Oracle Database 12c PL/SQL Programming book also by Michael McLaughlin.
    Thanks in advance for any suggestions
    Michele
    Good Luck,
    Well I have both at  McLaughlin(11g) and Feuerstein (5th edition) .... my  Feuerstein is more ragged from use.  Neither of these are exam oriented but are more for learning the language; which is actually what in the end you need to do even more than learning the exam.  McLaughlin has stuff in it which usually at any point in time I really don't what to know.  I'm reluctant to recommend Mclaughim over Feuerstein for the versions I have if for no other reason than the font, layout and structure works better from Feuerstein for me.
    Both of these books have editions are out for 12cR1 and consider getting the latest.  Getting an earlier edition cheap second hand might work as well.  At present on Amazon UK the latest Feuerstein on kindle is just over half the price of the paperback ... sometimes I find some books are not on good on kindle etc but Feuerstein is a lump to cart around.
    Don't discount putting funnel's the concise expert guide to PL/SQL on your kindle either.
    See what others say anyway. 

  • Need help in writing a tricky sql/PL/Sql Procedure

    Hi,
    I have a Branch table with just two fields in it node1 and Node2, The table looks like this
    node1 | node2
    -------|---------
    1 | 2
    3 | 2
    3 | 4
    4 | 5
    1 | 5
    1 | 6
    5 | 6
    in the above data if you draw lines between node_1 and node_2 you will see that there are 3 different paths to get from 1 to 5, as follows
    /--------6-------\
    1----------------------5
    \2------3-------4/
    Now I need to Find all the nodes between 1 and 5 or all the possible paths from node 1 to node 5 in this case I have 3 possible paths they are as follows
    1-2-3-4-5
    1-3-5
    1-5
    Now I know if this data was stored in a hierarchical manner I can get the results i want by using CONNECT BY and SYS_CONNECT_BY_PATH.
    Is there a way to transform this data into a hierarchcal manner so that I can use the CONNECT BY or can somebody give me an Idea as to how to write a PL/SQL procedure to get the result I want.
    Any help will be greatly appreciated

    Hi!
    1.Create another table Branch1 to hold 'transformed data'.
    2.Use the following procedure to insert data into branch1 table.
    declare
    cursor n is select * from branch;
    begin
    for nrec in n loop
    if nrec.node1 = 5 then
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    elsif nrec.node2= 5 then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    else
    if      nrec.node2> 5      then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    elsif nrec.node1> 5 then
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    elsif (nrec.node1 < nrec.node2 ) then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    else
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    end if;
    end if;
    end loop;
    commit;
    end;
    3.Then execute the following connect by query:
    SQL> select lpad(' ',level*2,' ')||node1 from branch1
    2 start with node1=1
    3 connect by prior node2=node1;
    Hope this is satisfactory.
    Thanks!

Maybe you are looking for