Query abt creating a directory?

i created a directory as
create or replace directory image as 'd:\photos\';
i got message as directory created.
does my image directory contains all the data as in 'd:\photos\ '??
if yes how to know tht my image directory has all the data from 'd:\photos\'
if no then how to insert the data from 'd:\photos\' to my image directory ??
Thanks in Advance,.......
Regards,
Santosh.Minupurey

CREATE DIRECTORY just create a logical link in your database between the given name and the physical directory. This order will not create the physical directory nor put anything into it. You have to copy the file in that physical diorectory via your system.
Once the Oracle Directory is created , you have to grant rights like READ/WRITE to it.
At this moment, you would be able to use this Oracle Directory with the UTL_FILE or DBMS_LOB package's functions to read/write the content of this directory.
Take the time to read the documentation, rather than doing only one part of the job, then counting on the Forum to get the rest of the process, then keep also in minf that this has nothing in relation with the Oracle Forms product.
Francois

Similar Messages

  • Creating a directory via a jsp page sql query return

    Is it possible to create a directory based on the results of a sql query?
    i.e.
    My sql query returns application number 1234 for a building application (BC for short).
    Is it possible to create a directory /BC/1234
    It is then proposed to use an iframe to look into the directory so users can place and access scanned documents which are captured during the approval process.
    If so how?
    An example would be great.
    Jason

    Sorry hope your still around I've been away for a while. We've created a samber share to the file server where the documents are stored and mounted it within the web file directory. It works ok if there is an existing directory but if there isn't we want it to be created when the page looks for the folder. I've done this with an asp page it basically did a directory exist test first then create folder if it didn't. The problem is can't find an example of how to do the directory exist test then directory create syntax so an example of both would be great

  • Shouldnt the owner of the directory object be the user who created the directory?

    This is in continuation to my earlier query. I checked the all_directories table. Here it says that the owner of the directory is 'SYS' although I created the directory from 'SCOTT'.
    Is this the reason why the PL/SQL proc trying to load an image cannot access the directory?
    Any clues?

    See my reply to your other question.

  • Wanted to create a directory- but insufficient privilage

    My SQL Query:
    create or replace directory <dir_name> as '<PATH of my file in my local machine>'
    I could not successfully execute the above statement in oracle application express as i said "insufficient privilage"/
    I wanted to create a directory path so that i can access my file in my local machine.
    Please help me in this regard.
    Message was edited by:
    user627214

    "Create directory" is only for directories where the database is installed. It's essentially a server-side concept. So, if your database is installed on a machine called myDBserver, you can only create directories on the file system that myDBserver has access to. You also need to be logged-in as system to do this, then grant read and/or write to the schemas that need access to the directory.
    Tyler

  • Loading an XML file into the table without creating a directory .

    Hi,
    I wanted to load an XML file into a table column . But I should not create a directory in the server and placing the XML file there and giving the path in the insert query. Can anybody help me here?
    Thanks in advance.

    You could write a java stored procedure that retrieves the file into a clob. Wrap that in a function call and use it in your insert statement.
    This solution require read privileges granted by sys and is therefore only feasible if the top-level directory/directories are known or you get read-access to everything.

  • How Create Virtual Directory On Oracle Application Server 10g on RHEL 5

    Dear Sir
    i have deployed my application on OAS 10g on RHEL 5 ,,now since my application is calling some pro*c programs and then they generate some text based reports on fixed folder named
    /treas/temp
    now i simply have to open these text based reports on web browser
    WEB.SHOW_DOCUMENT('/forms/pcreport/'||v_filename);
    but for that i need to create virtual directory name : " /pcreport " without code
    kindlly help as its working on my developer suit 10g i created a virtual directory in my application server by making following entry in "orion-web.xml" file
    <virtual-directory virtual-path="/pcreport" real-path="/u/treas/temp" />
    kindlly help

    (My paths shown, yours will be different)
    In a text editor :
    /u01/app/oracle/product/midtier/Apache/Apache/conf/httpd.conf
    Add
    Alias /pcreport/ "/u01/app/oracle/product/midtier/forms/pcreport/"
    <Directory "/u01/app/oracle/product/midtier/forms/pcreport/">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    Create the pcreport directory.
    Add a simple test page
    vi /u01/app/oracle/product/midtier/forms/pcreport/test.html
    <html>
    <head>
    <title>Simple test page </title>
    <style type="text/css">
    body {
    margin-left: 20%;;
    margin-right: 20%;
    border: 1px dotted gray;
    padding: 10px 10px 10px 10px;
    </style>
    </head>
    <body>
    <p>test!</p>
    </body>
    </html>
    Test
    http://yourserver.com:7777/pcreport/test.html
    Best Regards
    mseberg

  • Creating a directory on a remote machine using a UNC path

    Hi all,
    Is it possible to create a directory on a remote machine using a UNC path such as \\Server\Share\Directory?
    If so, how would i go about this? (Sorry for the newbie question, that's exactly what I am!)
    Thanks,
    Rob

    The tables on your pages are images. Not very convenient if the visitor wants to copy the information and use it.
    Read this how to use tables :
    http://www.wyodor.net/blog/archives/2010/01/entry_297.html
    http://www.wyodor.net/blog/archives/2010/01/entry_298.html
    Samples :
    http://www.wyodor.net/mfi/Maaskant/Seabreeze.html
    http://www.wyodor.net/mfi/Maaskant/Experiment.html
    http://www.wyodor.net/mfi/roodhout/Prices.html
    And here's a non-iWeb page with a sortable table :
    http://www.wyodor.net/htmlegg/TallCard/TallAjax.html?pg=tablesorter
    Or use a database on the server with MySQL and make tables with PHP :
    http://www.google.com/search?q=create+html+table+with+data+from+mysql+database
    Here's a very simple way to do it :
    http://home.wyodor.net/w3school

  • How can I create a directory on my server using FTP in applescript?

    Hi
    I have created a script which successfully uploads files to my server using FTP and a curl command.
    The one thing I haven't worked out how to do is how to create a directory on my server using applescript. At the moment I have to manually create the correct directory for the script to work, but would like to be able to automate everything.
    Would this be possible?
    Thanks
    Nick

    Thanks Bernard.
    I have tried that and still get the error message:
    "curl: Can't open '--ftp-create-dirs'!
    curl: try 'curl --help' or 'curl --manual' for more information
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    curl: (9) Server denied you to change to the given directory"
    The other relevant parts of the script are:
    set ftp_url to "ftp.****.org.uk/artists/" & artistName2 & "/assets/"
    set ftp_username to "*****@*****.org.uk"
    set ftp_password to "****"
    set ftp_entire to ftp_username & ":" & ftp_password & " ftp://" & ftp_url
    set outPath to outputFolder & fileCounter & ".jpg"
    and then...
    do shell script ("curl -T --ftp-create-dirs " & outPath & " -u " & ftp_entire)
    Like I said, all works fine when the directories are already in place. I have permissions for the artists folder set to "777", i.e. writable. Because the script is trying to create two directories at once, i.e. "artistName2" and then "assets" under it, I wondered if this was significant, but then I tried with just one new directory, and still got the error.

  • Error in creating a directory

    Hi,
    I'm trying to create directory using sql command in apex. But it is throwing an error as 'Insufficient privileges'
    So whom I have to ask for privilege to create a directory?
    Thanks,
    Anoo..

    Good morning Anoo,
    You should check with your DBA to make sure that APEX_PUBLIC_USER has create directory rights.
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • Error creating a directory while downloading

    I installed this the first time fine, but it wouldn't recognize my itouch, so i uninstalled all of apples programs from my computer and reinstalled, then got the error:
    "An error occurred while attempting to create the directory: C:\Program Files\Common Files\Apple\Mobile Device Support\in\AppleMobileDeviceHelper.app"
    When I continue past this by canceling, i get similar errors with different variations under the program file directory writing, and when i try to install a previous version, I get this as well.
    Any help/ideas would be great.
    Message was edited by: Verrexis

    Same exact problem for me. Reported it 9/24/09. Have not tried deleting the fonts. May try it if I'm not using them for something else. This is rediculious. There's a million reports of this problem out there with all sorts of Operating Systems and no one will fix it.

  • Error when trying to create a directory in ASM

    Hello,
    I've got Oracle RAC 11gR2. Two nodes with Windows Server 2008. Database in ASM instance.
    I'm trying to create a directory "backupp" in ASM instance, but got error.
    All Oracle Windows services are running under Local Ssystem Account.
    I've logged in Windows Server 2008 with user AdminRAC, which is membor of Administrators and ORA_DBA Windows group.
    Diskgroup: data
    C:> SET ORACLE_HOME=C:\app\11.2.0\grid
    C:\>SET ORACLE_SID=+ASM1
    C:\asmcmd
    Connected to an idle instance.
    ASMCMD> mkdir +data/backupp
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    ORA-15032: not all alterations performed
    ORA-15005: name "+data/backupp" is already used by an existing alias (DBD ERROR:
    OCIStmtExecute)
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    ASMCMD>

    user521219 wrote:
    Hello,
    I've got Oracle RAC 11gR2. Two nodes with Windows Server 2008. Database in ASM instance.
    I'm trying to create a directory "backupp" in ASM instance, but got error.
    All Oracle Windows services are running under Local Ssystem Account.
    I've logged in Windows Server 2008 with user AdminRAC, which is membor of Administrators and ORA_DBA Windows group.
    Diskgroup: data
    C:> SET ORACLE_HOME=C:\app\11.2.0\grid
    C:\>SET ORACLE_SID=+ASM1
    C:\asmcmd
    Connected to an idle instance.
    ASMCMD> mkdir +data/backupp
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    looks like two different problems exist
    ORA-15032: not all alterations performed
    ORA-15005: name "+data/backupp" is already used by an existing alias (DBD ERROR:
    OCIStmtExecute)directory already exists
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for appenderror can't be logged

  • Help needed in creating File Directory if not exist

    hi, All
    I am thinking about wite files to directories based on year, month, day. if the directory for that year or month or day exists already, do not create the directory, but write the file to that directory.
    For example: 2003/02/22/file.txt --2003/02/22 exist, just write file.txt
    If the directory does not exist, the program will create the direcotry and write the file into the right directory.
    For example 2003/02/22/file.txt, ---2003/02/22/ does not exist, the program will create the directoies and write file file.txt
    If anyone can provide any example or suggestion, I really appreciate!
    Thanks
    Steve

    Hi!
    Just have a look at the class "File"
    and it's method "exists()".
    Hope, that helps.
    Thoto

  • How to create a directory in application server

    Hi all,
    How to create a directory in application server through Progaram??
    eg:\tmp - is already existing
    I want to create \tmp\fi 
    Within \tmp\fi - i should able to store my file,,,
    Kindly help me urgent...

    Hello San,
    Either contact Basis guys at ur end for the same or u can do it dynamically via a piece of ABAP code, i hope it wll help u.
    call function 'GUI_CREATE_DIRECTORY'
         exporting
    dirname = '//<ip_address>/qfilesvr400/<host>/usr/sap/TST/SYS/Folder1'
         exceptions
              failed  = 1
              others  = 2.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • Creating Target Directory Paths

    My questions are mixed in below, marked with "Q:"
    Task 7A-1-6 in the PTools 8.48 Installation Guide talks about directory path structures that are required by the Oracle DBMS install wizard, but need to be manually created by me.
    I installed database 10g. My SID is "HCM". There is an initHCM.ora file in my database folder. The contents were:
    SPFILE='C:\oracle\product\10.2.0\db_1/dbs/spfileHCM.ora'
    and I added the following, per install guide instructions:
    DB_NAME = HCM
    DB_FILES = 1021
    CONTROL_FILES = (/filesystem1/cntrl1HCM,/filesystem2/cntrl2HCM)
    OPEN_CURSORS = 255
    db_block_size = 8192
    remote_login_passwordfile=NONE
    Q: I substituted HCM for &lt;SID&gt; in the CONTROL_FILES variable, but are things like filesystem1 and filesystem2 meant to be literals, or is it intended that I substitute something for these? Also, there are some forward slashes in the SPFILE variable - is that ok for Windows?
    The guide mentions these CREATEDB.SQL references...
    startup nomount pfile=%ORACLE_HOME%\database\init&lt;SID&gt;.ora
    DATAFILE '&lt;drive&gt;:\oradata\&lt;SID&gt;\system01.dbf' SIZE 400M
    LOGFILE '&lt;drive&gt;:\oradata\&lt;SID&gt;\log01.dbf' SIZE 70M,
    '&lt;drive&gt;:\oradata\&lt;SID&gt;\log02.dbf' SIZE 70M;
    *...So I assume that I need to create c:\oradata\HCM*
    The guide then says:
    The init&lt;SID&gt;.ora parameter file that is referenced in the CREATEDB.SQL script makes the following
    directory path structure references:
    Note. Portions of the init&lt;SID&gt;.ora parameter file have been omitted for clarity. These paths are hardcoded
    by the user creating the init&lt;SID&gt;.ora parameter file. The Data Configuration Wizard will not make any
    substitutions for mount point, target directory path, or &lt;SID&gt; in the init&lt;SID&gt;.ora file.
    +
    Control file references:
    +
    control_files = ("c:\apps\db\oracle9i\oradata\ORC1\control01.ctl", "c:\apps\db&rArr;
    \oracle9i\oradata\ORC1\control02.ctl", "c:\apps\db\oracle9i\oradata\ORC1&rArr;
    \control03.ctl")
    background_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\bdump
    core_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\cdump
    user_dump_dest = c:\apps\db\Oracle9i\admin\ORC1\udump
    Q:  Does this mean I need to create c:\apps\db\Oracle10g\admin\ORC1 plus subfolders bdump, cdump and udump?  I particularly wonder if those exact names are correct, especially since the examples are for the 9i version.
    Q:  The guide says (above) that it's the init&lt;SID&gt;.ora parameter file which makes the above control file references... but as I showed above, that file only contained the one line, before I added the parms I mentioned.  Is the install guide saying that I should add the control file references above to my initHCM.ora file?

    With regard to the CONTROL_FILES variable...
    I'm not sure how forward slashes are meant to be interpreted in the Windows world. Are you saying that I should substititute an entire valid Widows path, like this?
    CONTROL_FILES = (c:\myfilesys1\cntrl1HCM.txt,c:\myfilesys2\cntrl2HCM.txt)
    ...after having first created folders c:\myfilesys1 and c:\myfilesys2, and that the database creation script will generate files cntrl1HCM.txt (I added the extension) and cntrl2HCM.txt?
    Can you post a sample Windows init<SID>.ora file?
    Edited by: M_Borok on Oct 7, 2008 7:46 AM
    (continued)
    ...on re-reading, it seems to me that section Task 7A-1-5: Creating an INIT<SID>.ORA File shows the general format:
    CONTROL_FILES = (/filesystem1/cntrl1<SID>,/filesystem2/cntrl2<SID>)
    ...but section Task 7A-1-6: Creating Target Directory Paths shows an example of substituted code for this line:
    control_files = ("c:\apps\db\oracle9i\oradata\ORC1control01.ctl", "c:\apps\db\oracle9i\oradata\ORC1control02.ctl", "c:\apps\db\oracle9i\oradata\ORC1\control03.ctl")
    Is that true? i.e. does this mean that I can create any path and file name I want, and the database create script will read it here and use it?
    If so, does this mean that I have to substitute actual paths ANYWHERE I see a forward slash?
    Also... I'm thinking that ORC1 in the sample code is their example of the SID, and for me it might be HCM instead.
    I note that their example shows three control files instead of the two shown in the first template. Does it matter.
    Q: Are these control files files that will be written by the create script, or are they a reference to files I should have created and populated?
    Edited by: M_Borok on Oct 7, 2008 7:51 AM
    Edited by: M_Borok on Oct 7, 2008 8:02 AM

  • Query to create a view using the following tables

    Hi,
    I am struggling to write the proper query to create a view using three tables.
    I would really be thankful if anyone can help me.
    I am pasting the following script to create the required tables and also insert appropriate data in each of the table.
    create table HR.STUDENT_DETAILS (
    STUDENT_ID NUMBER(10),
    STUDENT_NAME VARCHAR2(50),
    DOB DATE,
    SEX CHAR(1),
    ACTIVE CHAR(1),
    CONTACT_NUMBER NUMBER(20),
    primary key(STUDENT_ID)
    create table HR.PAYMENT_HEADER (
    PAY_HEADER_ID NUMBER(10),
    DOC_NUM NUMBER(5),
    MONTH_NAME VARCHAR2(10),
    primary key(PAY_HEADER_ID)
    create table HR.PAYMENT_DETAILS (
    HEADER_ID NUMBER(10),
    LINE_ID NUMBER(10),
    STUDENT_ID NUMBER(10),
    CUM_AMOUNT NUMBER(10),
    primary key(HEADER_ID,LINE_ID)
    INSERT ALL
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1112,'James','17-JUN-05','M','Y',23674378)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1113,'David','21-SEP-05','M','Y',24565457)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1114,'Michael','13-JAN-06','M','Y',25436784)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1115,'Joseph','03-JAN-06','M','Y',23435673)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1116,'Juliet','21-MAY-05','F','Y',23234527)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1117,'Monica','25-JUN-05','F','Y',24873245)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1118,'William','05-FEB-05','M','Y',23623245)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1119,'Karen','07-FEB-06','F','Y',26757543)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1120,'Erika','17-AUG-05','F','Y',25435465)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1121,'Noah','16-AUG-05','M','Y',23457645)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1122,'Angelina','28-SEP-05','F','Y',26456787)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1123,'Gabriela','30-SEP-05','F','Y',29767543)
    INTO HR.STUDENT_DETAILS (STUDENT_ID,STUDENT_NAME,DOB,SEX,ACTIVE,CONTACT_NUMBER) VALUES (1124,'Sofia','07-MAR-06','F','Y',27656578)
    SELECT * FROM DUAL;
    INSERT ALL
    INTO HR.PAYMENT_HEADER (PAY_HEADER_ID,DOC_NUM,MONTH_NAME) VALUES (305,1,'JAN')
    INTO HR.PAYMENT_HEADER (PAY_HEADER_ID,DOC_NUM,MONTH_NAME) VALUES (306,2,'FEB')
    INTO HR.PAYMENT_HEADER (PAY_HEADER_ID,DOC_NUM,MONTH_NAME) VALUES (307,3,'MAR')
    INTO HR.PAYMENT_HEADER (PAY_HEADER_ID,DOC_NUM,MONTH_NAME) VALUES (308,4,'APR')
    INTO HR.PAYMENT_HEADER (PAY_HEADER_ID,DOC_NUM,MONTH_NAME) VALUES (309,5,'MAY')
    SELECT * FROM DUAL;
    INSERT ALL
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (305,12,1112,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (305,13,1113,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (305,14,1114,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (306,15,1112,80)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (306,16,1113,80)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (306,17,1114,80)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (306,18,1115,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (306,19,1116,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,20,1112,120)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,21,1113,120)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,22,1114,120)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,23,1115,80)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,24,1116,80)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,25,1117,40)
    INTO HR.PAYMENT_DETAILS (HEADER_ID,LINE_ID,STUDENT_ID,CUM_AMOUNT) VALUES (307,26,1118,40)
    SELECT * FROM DUAL;
    The above table STUDENT_DETAILS stores the details of all the students and each student has a unique student id.
    Another table PAYMENT_HEADER saves the payment details as a document for each month which has a header id.
    In the PAYMENT_DETAILS table, payment details are stored for the students (who made the payment for that month). This table does not save the data for a student if he has not paid on that month. This table is connected to the PAYMENT_HEADER table through a header Id.
    The view should be such that when I pass the document number, it shall show the names of all the students, but shall show payment amount only for those students who had paid under the selected document number, for other it should show null.
    I tried the following query:
    select * from (
    select sd.student_name,sd.DOB,sd.sex,sd.contact_number,pd.doc_num,pd.month_name,pd.cum_amount
    from hr.student_details sd left join
    (select hdr.doc_num,hdr.month_name,det.student_id,det.cum_amount
    from hr.payment_header hdr, hr.payment_details det
    where hdr.pay_header_id = det.header_id) pd on sd.student_id = pd.student_id)
    But when I pass the filtering values like document number, it does not show some students with null values.
    select * from (
    select sd.student_name,sd.DOB,sd.sex,sd.contact_number,pd.doc_num,pd.month_name,pd.cum_amount
    from hr.student_details sd left join
    (select hdr.doc_num,hdr.month_name,det.student_id,det.cum_amount
    from hr.payment_header hdr, hr.payment_details det
    where hdr.pay_header_id = det.header_id) pd on sd.student_id = pd.student_id)
    where doc_num = 1 or doc_num is null;
    My requirement is that, every time I use a document number in the where clause for the view it should show the paid amount against the student names who has paid on that month and for all other student it should null. Total student number is 13. So every time it should show 13 students only even when I pass document No 2 or 3.
    Seeking your help.
    Regards
    Hawker

    Hi Frank,
    as per your advice, I am omitting the 'DOB', 'GENDER','ACTIVE','CONTACT_NUMBER' fields from the 'STUDENT_DETAILS' table.
    I shall create separate tables and insert the desired output from the view for each where clause.
    First let us create three tables each for the desired out put:
    1) For the desired output I want to see when I pass doc_num as 1
    create table HR.SDT_PAY_DET_DOC_ONE (
    STUDENT_ID NUMBER(10),
    STUDENT_NAME VARCHAR2(50),
    DOC_NUM NUMBER(5),
    C_AMOUNT NUMBER(10),
    primary key(STUDENT_ID)
    2) For the desired output I want to see when I pass doc_num as 2
    create table HR.SDT_PAY_DET_DOC_TWO (
    STUDENT_ID NUMBER(10),
    STUDENT_NAME VARCHAR2(50),
    DOC_NUM NUMBER(5),
    C_AMOUNT NUMBER(10),
    primary key(STUDENT_ID)
    3) For the desired output I want to see when I pass doc_num as 3
    create table HR.SDT_PAY_DET_DOC_THREE (
    STUDENT_ID NUMBER(10),
    STUDENT_NAME VARCHAR2(50),
    DOC_NUM NUMBER(5),
    C_AMOUNT NUMBER(10),
    primary key(STUDENT_ID)
    Now I shall insert values in each of the above three tables:
    INSERT ALL
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1112,'James',1,40)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1113,'David',1,40)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1114,'Michael',1,40)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1115,'Joseph',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1116,'Juliet',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1117,'Monica',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1118,'William',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1119,'Karen',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1120,'Erika',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1121,'Noah',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1122,'Angelina',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1123,'Gabriela',null,null)
    INTO HR.SDT_PAY_DET_DOC_ONE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1124,'Sofia',null,null)
    SELECT * FROM DUAL;
    INSERT ALL
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1112,'James',2,80)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1113,'David',2,80)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1114,'Michael',2,80)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1115,'Joseph',2,40)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1116,'Juliet',2,40)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1117,'Monica',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1118,'William',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1119,'Karen',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1120,'Erika',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1121,'Noah',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1122,'Angelina',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1123,'Gabriela',null,null)
    INTO HR.SDT_PAY_DET_DOC_TWO(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1124,'Sofia',null,null)
    SELECT * FROM DUAL;
    INSERT ALL
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1112,'James',3,120)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1113,'David',3,120)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1114,'Michael',3,120)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1115,'Joseph',3,80)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1116,'Juliet',3,80)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1117,'Monica',3,40)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1118,'William',3,40)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1119,'Karen',null,null)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1120,'Erika',null,null)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1121,'Noah',null,null)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1122,'Angelina',null,null)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1123,'Gabriela',null,null)
    INTO HR.SDT_PAY_DET_DOC_THREE(STUDENT_ID,STUDENT_NAME,DOC_NUM,C_AMOUNT) VALUES (1124,'Sofia',null,null)
    SELECT * FROM DUAL;
    Thanks & Regards
    Hawker

Maybe you are looking for

  • How do I downgrade my MacBook Pro Retina Display from Mountain Lion to Lion?

    I have a brand new MacBook Pro Retina Display that came with OS X 10.8.1. I´m an audio engineer so I work with Pro Tools, tons of plug-ins etc... Some of my software doesn't work with Mountain Lion just yet. Some of them haven't upgraded, and some of

  • Replaced iPod.... Windows Reconizes iPod, but iTunes Doesn't. HELP!!!

    I just got my iPod replaced today. When I pluged it in, it showed the "Do Not Disconnect" thing on it, and my computer tells me that it's plugged in. But, iTunes does not reconize it. I've tried updating it, resetting it, and putting it in different

  • How can I edit items in a listbox?

    What I need to do is:  when the user clicks the 'edit' button, it should reference the listbox to ensure an item was selected.  So, if an item is selected, I need to store the item to a string variable. Next, the user should be able to use a textbox

  • Conversion of Flat file to tables in oracle

    hi i am doing my project in oracle and i have got stuck up at a point where i have to convert flat files to tables in oracle Please suggest a solution for the above problem Regards, Mahesh

  • SAP - Lumira - ECC 6.0 - Source by java connector - timeout

    Hi, I try , to create a dataset for ERP 6.0 data by java connector ( SQL-Source). After connection to ERP, I can select an ERP-infoset . By selection of an infoset   a SQL-Statement is created . ( select * from "Local"."INFOSET"."id of erp-infoset" )