Query Problem Oracle9i Release 9.2.0.7.0

Hello,
I need help with this one. I have xml file like this:
<?xml version="1.0" ?>
- <TecKomBS xmlns="http://www.bsi.si" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bsi.si http://www.bsi.si/_data/tecajnice/TecKomBS-l.xsd">
- <tecajnica datum="2006-12-29" veljavnost="2007-01-01">
- <tecaj oznaka="GBP" sifra="826">
<nakupni>0.67251</nakupni>
<prodajni>0.67049</prodajni>
</tecaj>
- <tecaj oznaka="CZK" sifra="203">
<nakupni>27.526</nakupni>
<prodajni>27.444</prodajni>
</tecaj>
- <tecaj oznaka="NOK" sifra="578">
<nakupni>8.2504</nakupni>
<prodajni>8.2256</prodajni>
</tecaj>
- <tecaj oznaka="SEK" sifra="752">
<nakupni>9.0540</nakupni>
<prodajni>9.0268</prodajni>
</tecaj>
- <tecaj oznaka="JPY" sifra="392">
<nakupni>157.17</nakupni>
<prodajni>156.69</prodajni>
</tecaj>
- <tecaj oznaka="HUF" sifra="348">
<nakupni>252.15</nakupni>
<prodajni>251.39</prodajni>
</tecaj>
- <tecaj oznaka="AUD" sifra="036">
<nakupni>1.6716</nakupni>
<prodajni>1.6666</prodajni>
</tecaj>
- <tecaj oznaka="CAD" sifra="124">
<nakupni>1.5304</nakupni>
<prodajni>1.5258</prodajni>
</tecaj>
- <tecaj oznaka="SKK" sifra="703">
<nakupni>34.487</nakupni>
<prodajni>34.383</prodajni>
</tecaj>
- <tecaj oznaka="PLN" sifra="985">
<nakupni>3.8367</nakupni>
<prodajni>3.8253</prodajni>
</tecaj>
- <tecaj oznaka="DKK" sifra="208">
<nakupni>7.4672</nakupni>
<prodajni>7.4448</prodajni>
</tecaj>
- <tecaj oznaka="HRK" sifra="191">
<nakupni>7.3614</nakupni>
<prodajni>7.3394</prodajni>
</tecaj>
- <tecaj oznaka="USD" sifra="840">
<nakupni>1.319</nakupni>
<prodajni>1.315</prodajni>
</tecaj>
- <tecaj oznaka="CHF" sifra="756">
<nakupni>1.6093</nakupni>
<prodajni>1.6045</prodajni>
</tecaj>
</tecajnica>
- <tecajnica datum="2007-01-02" veljavnost="2007-01-03">
- <tecaj oznaka="GBP" sifra="826">
<nakupni>0.67451</nakupni>
<prodajni>0.67249</prodajni>
</tecaj>
- <tecaj oznaka="CZK" sifra="203">
<nakupni>27.566</nakupni>
<prodajni>27.484</prodajni>
</tecaj>
- <tecaj oznaka="NOK" sifra="578">
<nakupni>8.2203</nakupni>
<prodajni>8.1957</prodajni>
</tecaj>
- <tecaj oznaka="SEK" sifra="752">
<nakupni>9.038</nakupni>
<prodajni>9.011</prodajni>
</tecaj>
- <tecaj oznaka="JPY" sifra="392">
<nakupni>158.000</nakupni>
<prodajni>157.520</prodajni>
</tecaj>
- <tecaj oznaka="HUF" sifra="348">
<nakupni>251.82</nakupni>
<prodajni>251.06</prodajni>
</tecaj>
- <tecaj oznaka="AUD" sifra="036">
<nakupni>1.6719</nakupni>
<prodajni>1.6669</prodajni>
</tecaj>
- <tecaj oznaka="CAD" sifra="124">
<nakupni>1.5475</nakupni>
<prodajni>1.5429</prodajni>
</tecaj>
- <tecaj oznaka="SKK" sifra="703">
<nakupni>34.435</nakupni>
<prodajni>34.331</prodajni>
</tecaj>
- <tecaj oznaka="PLN" sifra="985">
<nakupni>3.8344</nakupni>
<prodajni>3.8230</prodajni>
</tecaj>
- <tecaj oznaka="DKK" sifra="208">
<nakupni>7.4678</nakupni>
<prodajni>7.4454</prodajni>
</tecaj>
- <tecaj oznaka="HRK" sifra="191">
<nakupni>7.3735</nakupni>
<prodajni>7.3515</prodajni>
</tecaj>
- <tecaj oznaka="USD" sifra="840">
<nakupni>1.329</nakupni>
<prodajni>1.325</prodajni>
</tecaj>
- <tecaj oznaka="CHF" sifra="756">
<nakupni>1.6128</nakupni>
<prodajni>1.6080</prodajni>
</tecaj>
</tecajnica>
+ <tecajnica datum="2007-01-03" veljavnost="2007-01-04">
+ <tecajnica datum="2007-01-04" veljavnost="2007-01-05">
+ <tecajnica datum="2007-01-05" veljavnost="2007-01-06">
+ <tecajnica datum="2007-01-08" veljavnost="2007-01-09">
+ <tecajnica datum="2007-01-09" veljavnost="2007-01-10">
under every "tecajnica" from witch I want to get "datum" as date I have more data,
first "tecaj" from witch I want to get "sifra" and under "tecaj" first I have "nakupni" from witch I want to get value of "nakupni" and second I have "prodajni" from witch I want to get value of "prodajni".
So the data I want would look like this:
For every "datum" I want "sifra", "nakupni" and "prodajni"
If I have in my xml file only one "datum" for "tecajnica" this is not a problem, I get this with this query:
SELECT     
extractValue(Value(d), 'tecajnica/.@datum','xmlns="http://www.bsi.si"') datum,
extractValue(VALUE(p), 'tecaj/.@sifra','xmlns="http://www.bsi.si"')     sval,
extractValue(VALUE(p), 'tecaj/nakupni','xmlns="http://www.bsi.si"') nakupni,
extractValue(VALUE(p), 'tecaj/prodajni','xmlns="http://www.bsi.si"') prodajni     
FROM     
Xml_tab x,
TABLE(XMLSequence(extract(x.xml, '/TecKomBS/tecajnica','xmlns="http://www.bsi.si"'))) d,
TABLE(XMLSequence(extract(x.xml, '/TecKomBS/tecajnica/*','xmlns="http://www.bsi.si"'))) p
but if I have xml file like example on top (with more dates), I get mix of all data in the xml file. So I get alot of wrong data!
I have tried some examples with Xqery but I gues I am doing something wrong.
Can you pleeease help me ?
Thanks for your time
J

I have tried also this, but I get error that doesn't mean nothing:
select xmlquery('for $i in $d/TecKomBS/Tecajnica where $i/.@datum eq
"2006-01-26" return $d/TecKomBS/Tecajnica/.@datum'
passing t.XML as "d" returning content)
from Xml_tab t
I get this:
SQL> /
passing t.XML as "d" returning content)
ERROR at line 2:
ORA-00907: missing right parenthesis
Can you help me please ?

Similar Messages

  • Load XML file to XMLTable from FTP site Problem Oracle9i Release 9.2.0.7.

    Hi,
    I was wondering if it is possible to load XML file from FTP address directly to XMLType Table?
    Can someone help me?
    For example I have ftp site "ftp://test" and on this site I have file "file.xml"
    and I would like to load "file.xml" to table "xml_tab" ?
    I tried to use "load_xml" procedure and set DIRECTORY "xml_dir" to 'ftp://test' but I get this error
    exec load_xml(p_dir=>'XML_DIR', p_filename=>'file.xml');
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The network path was not found.
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at "P.LOAD_XML", line 8
    ORA-06512: at line 1
    Procedure looks like this:
    (p_dir IN VARCHAR2,
    p_filename IN VARCHAR2) AS
    l_bfile BFILE := BFILENAME(p_dir, p_filename);
    l_clob CLOB;
    BEGIN
    DBMS_LOB.createtemporary (l_clob, TRUE);
    DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
    DBMS_LOB.loadfromfile(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
    DBMS_LOB.fileclose(l_bfile);
    INSERT INTO xml_tab (
    id,
    filename,
    xml
    VALUES (
    xml_tab_seq.NEXTVAL,
    p_filename,
    XMLTYPE.createXML(l_clob)
    COMMIT;
    DBMS_LOB.freetemporary (l_clob);
    END;
    I have tried also with this
    select xdburitype('ftp://test/file.xml').getCLob() from dual;
    but i get error
    ERROR:
    ORA-31001: Invalid resource handle or path name "ftp://test/file.xml"
    Can you pleeeeeeas show me a way to do this, thanks ???

    This will not work.. Ypu cannot use FTP to 'PULL' a document into the database. (Yes I know there's a placeholder for an FTPURITYPE() but it was never implemented).
    However you can use an FTP client to PUSH content into the XML DB repository. If the content is schema based XML associated with a known (registered) XML schema the content of the file will automatically be stored in the default table associated with the root element of the file. If the content is not associated with an known XML schema you can then use xdburitype to read the resource that was created when the document was uploaded into the repository

  • Problem Oracle9i DB UTF8 with delphi

    dear friend
    I have a problem with delphi and UTF8.
    My database is Oracle9i Release 2 and set with American_america.utf8 and I create database with UTF8 character set.(WIN2K).
    I Have delphi 7, when I create a form on it and do a query I can see data without any problem but when I insert or update data with Delphi form my program crash,
    when I want to see data from DBA studio I take message "Oracle can not convert character....."
    and my BD crash.
    how can I solve this problem.
    thanks

    Please, read the topics
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96529/ch3.htm#56353
    and
    http://download-uk.oracle.com/docs/html/A95493_01/gblsupp.htm
    I think these are the data which you have inserted earlier.
    If you insert new text and then select it from database, then all should be correct.

  • Export with query problem

    Hello,
    I have to export three tables out of my database with a query. I started the export with following command (on a Windows testing machine).
    exp.exe userid=ccq/xxx@KDG file=C:\download\export\NEW.dmp tables= qem_message, qem_messagestatlog, qw_text query=””"where qem_message.messagebody > 739409 AND qem_message.pkey = qem_messagestatlog.pkey AND qem_message.messagebody = qw_text.qwkey" log=C:\download\export\NEW.log
    I have got the following error:
    . . Export of the table QEM_MESSAGE
    EXP-00056: ORACLE-error 904 found
    ORA-00904: Unknown columnname
    I think the problem is the query statement. All the columns are written right. Is there an error in the statement or is it impossible to execute such statement in an export?

    Hi,
    you have to use export one time at a time with query parameter
    consider
    SQL> host type d:\query.txt
    query="where emp.deptno = dept.deptno
           and emp.sal > 1000
           or dept.deptno = 40"
    SQL> host exp scott/tiger file=d:\tt.dmp tables=(EMP,DEPT) PARFILE=d:\query.txt
    Export: Release 10.1.0.2.0 - Production on Thu Feb 1 17:11:11 2007
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table                            EMP
    EXP-00056: ORACLE error 904 encountered
    ORA-00904: "DEPT"."DEPTNO": invalid identifier
    . . exporting table                           DEPT
    EXP-00056: ORACLE error 904 encountered
    ORA-00904: "EMP"."SAL": invalid identifier
    Export terminated successfully with warnings.
    SQL>regards
    Taj

  • How to write ASP code to connect to Oracle9i (Release 1)?

    I am experiencing a problem when writing a program using ASP and Oracle9i (Release 1). I know the connection string when working with Access. However, the oracle9i connection string makes me headache.
    A lot of thanks!

    Hi,
    Need few information about your system setup:
    1. Which data provider are you using to connect ASP to Oracle9i?
    2. Write the connect string you are using. Write the error message you get while establishing the connection.
    Also try the following connect strings
    1. Connection using Oracle Data Provider for .NET (ODP.NET)
    In the postback method of your .aspx.cs file call this method.
    a)//include these namespaces
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    b) //Declare
    OracleConnection conn ;
    c) //Write this method
         private Boolean getDBConnection()
              try
                   //Connection Information     
                        string connectionString =
                             //username
                             "User Id=scott"
                             //password
                             ";Password=tiger"
                             //replace with your datasource value (TNSnames)
                             ";Data Source=ora9idb;"
                        //Connection to datasource, using connection parameters given above
                        conn = new OracleConnection(connectionString);
                        //Open database connection
                        conn.Open();
                        return true;
                   // catch exception when error in connecting to database occurs
                   catch (Exception ex)
                        //Display error message
                        return false;               }
    2.
    In case you are using Oracle Provider for OLEDB
    use the following connect string
         string ConnectionString =
                             //Oracle OleDB .Net Data provider
                             "Provider=OraOLEDB.Oracle" +
                             //username
                             ";User Id=scott"
                             //password
                             ";Password=tiger"
                             //replace with your datasource value (TNSNames)
                             ";Data Source=ora9idb"
                             //using OLEDB .Net Data Provider features
                             ";OLEDB.NET=true" ;
    Let me know if you are unable to establish the connection, after trying the preceding connect strings.
    Hope that helps.
    regards
    OTNTeam@IDC

  • The query cannot be released for OLE DB for OLAP

    Hi,
    I have created a SAP BI query by query designer,which includes a replacement path variable.Query is working totaly fine.
    Now i want to use this query in SAP BO universe, so i have checked the query property Release for OLE DB for OLAP in Advance preoperty of query which allow external use of query.
    But after this when i try to run the query its showing error messages-
    The query cannot be released for OLE DB for OLAP
    Query ZBO_OVERDUE_CUST could not be opened.
    >> Row: 37 Inc: CONSTRUCTOR Prog: CL_RSR_OLAP_VAR
    Error when generating dataProvider
    If i remmove it,my query will work fine.But problem is here,i have to use both thing.
    I want repleasement path in query,and because i have to use query in Universe,so i have so allow external use of query.
    What should i do,how can i get my desire result.
    Thanks,
    Piyush

    I think it may be a limitation due to some of the logic in the BEx query.
    http://help.sap.com/saphelp_nw04/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/content.htm
    Release for OLE DB for OLAP
    External reporting tools that communicate using the OLE DB for OLAP interface use queries as data sources. If you want to release this query as a data source for external Reporting tools, select Allow External Access to this Query.
    Note: Queries containing formulas with the operators %RT, %CT, %GT, SUMRT, SUMCT, SUMGT, and LEAF cannot be released for OLE DB for OLAP. These operators are dependent on how the list is displayed in the BEx Analyzer and the formulas return unexpected values when using OLE DB for OLAP or MDX. You may be able to obtain the required result by selecting constants. For more information, see Selecting Constants.
    For more information about using formula operators, see Defining Formulas.
    For more information about OLE DB for OLAP, see Mapping Metadata.

  • Problem for releasing  blocked sales order on Creditlimit

    Hi Gurus,
            I a   hve a problem for releasing blocked sales orders
             what i have done: 1)i have blocked sales order based on exceeded creditlimit
             (i have change SDType in 'OVAK' is 'C')
                      2)now i have to release for furthur processing so i have done following steps
                      3)Goto VKM3/VKM1 T.Code and then release what order that is blocked.
                      4) order will appear in the list.
                      5)Select that one.
                      6)Click on the green flag that appears on the left hand side.
                      7)Click on save.
                      8)click on back it will ask for "Leave list".
                      9)Click on yes.
                      10)It said that Sales orer has been released
    Still what my problem is:
    Problem: 1)So i'm trying to create deliver for Sales order but it shows an error
             2)"Sales order is blocked for delivery: Credit limits" Even it was released    
    Plz kindly help  me what i do....
    Thanks In Advance
    sivakumar

    sorry   i was  unfotunately put this thread here  over in SD

  • Error generating data provider-Query cant be released

    Hello Experts,
    I am working on web template (WAD 3.5) where i have 6 graphs each having independadnt data provider (Bex query).
    I also have drop boxes which represents the selection screen of queries attached to graphs.
    'Affected data providers list' of dropboxes consist of all data providers that are attached to graphs in template, as each graph is supposed to get refreshed if user changes drop box selection.
    Template was working fine until i made the change to query 2 which is dataprovider 2 for graph 2.
    Since then i am not able to run template it gives me error -
    -The query cant be release for OLE DB for OLAP
    -Query couldnt be open
    -Error generating data provider.
    As i checkd that qury independantly in query analyzer, its working perfect without any error.
    What could be the possible reason for this error then??
    regards,
    Pritesh.

    Hi Manpreet,
    Use the 'verify' icon in the query designer to check whether your query definition is correct. Also u  you
    can check if you can execute the query in the backend with transaction RSRT2. In  RSRT2 try re-generating
    the query before running it.
    Hope it helps.
    Regards,
    Javed

  • Problem while releasing Request

    Hello All,
    In one of our client's DEV Server, we are facing problem while releasing requests.
    When I release a request it is not appearing in the PRD import Queue.
    When I checked the TMS Alert Viewer, it is showing as" TP REPORTED ERROR"
    And more over when I checked in the OS level,only the cofile is created not the data file.
    Please suggest ..
    Thank You,
    Regards,
    Hasan

    Hello,
    Here is some contents from Slog.dev
    Name:       SLOG1126.DEV
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (10), I'm waiting 4 sec (20110627095120). My name: pid 8084 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (20), I'm waiting 1 sec (20110627095151). My name: pid 8084 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (30), I'm waiting 4 sec (20110627095215). My name: pid 8084 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (10), I'm waiting 4 sec (20110628123131). My name: pid 7500 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (10), I'm waiting 4 sec (20110630093900). My name: pid 8124 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (20), I'm waiting 1 sec (20110630093925). My name: pid 8124 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (30), I'm waiting 4 sec (20110630093949). My name: pid 8124 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (40), I'm waiting 2 sec (20110630094020). My name: pid 8124 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (50), I'm waiting 2 sec (20110630094055). My name: pid 8124 on stisdev (APServiceDEV)
    WARNING:
    stisdev\sapmnt\trans\tmp\SAPABAP.LOS is already in use (60), I'm waiting 1 sec (20110630094132). My name: pid 8124 on stisdev (APServiceDEV)

  • Problem in releasing request

    Hi
    I am facing a problem while releasing transport oif copies. I have created a TC which contains a Workbench request. When I am releasing the request its not getting released. it gives message at bottom of the screen " tp successfully connected" and does not move further neither it gives any error.
    If its a local request then its getting released immediately. I created a virtual system in TMS and connected to the system from where I am releasing the request. This virtual system is mentioned in target of the request. Transport tool and transport route check also not giving any error.
    Any idea what could be the problem?
    Thanks in advance

    Please post the solution to the problem... this way someone else will benefit from your post.
    Regards
    Juan

  • Problem with release statergy po

    Dear Friends ,
    I had maintained release statergy for PO . I had taken chraterstic "Order type" "Purchase group" "Order Value" . All configaration is fine and simulation also showing ok . But it is not triging . Is it any problem in release indicator seting . I had maitained in two level for 3types of currency . I had maintained charaterstic for for each currency type . I am unable to find the error.......what could be the cause .........
    R

    Hi
    If you have maintained 3 chracteristics for 3 Currencies then The sytem will check if all the three currencies exits or not & then only the relase strategy will trigger.
    better option is to maintain the Currency Key charcteristic with 3 Charcteristic values INR, USD, EUR.
    Please check
    Thanks & Regards
    Kishore

  • Designing LOV Query Problem

    Hello APEX people,
    I posted my problem here:
    Designing LOV Query Problem
    What I have is a sequence like this:
    CREATE SEQUENCE
    DR_SEQ_FIRST_SCHEDULE_GROUP
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE ;
    What I need would be a SQL query returning all possible values oft my sequence like:
    1
    2
    3
    4
    5
    6
    7
    I want to use it as a source for a LOV...
    The reason why I use the cycling sequence is: My app uses it to cycle scheduling priorities every month to groups identified by this number (1-7).
    In the Admin Form, I want to restrict the assignment in a user friendly way - a LOV.
    Thanks
    Johann

    Here ist the solution (posted by michales in the PL/SQL forum):
    SQL> CREATE SEQUENCE
    dr_seq_first_schedule_group
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE
    Sequence created.
    SQL> SELECT LEVEL sn
    FROM DUAL
    CONNECT BY LEVEL <= (SELECT max_value
    FROM user_sequences
    WHERE sequence_name = 'DR_SEQ_FIRST_SCHEDULE_GROUP')
    SN
    1
    2
    3
    4
    5
    6
    7
    7 rows selected.

  • Problem in release strategy in a plant PO. Strategy does not appear

    Hi:
    I have a problem with release strategy in plant PO. When we create a PO in this plant, we have no tab for release strategy, if I change the plant in PO for a different one I get this tab with all data.
    I have checked OMGS, CL20N and everything seems to be in order. I think this is a problem in plant definition, but I really donu2019t know where I can look for. This plant is a copy of an existing one, and in this plant there is no problem.
    Please, any idea?
    Thank you very much in advance.

    you can test if one or more strategies can be found. (you should one find one, otherwise SAP is not able to determine which one should be used)
    go to CL30N.
    Enter your class and class type 032, hit enter
    Enter values for the characteristics. and click button for a search in initial class.
    I dont think it has something todo with plant customizing. Classification just takes the values that are in your PO and searches for a strategy  which has to be in table T16FS.

  • Incorrect link for "Oracle9i Release 2 for Windows Server 2003 (32-bit)

    Hi. Go to here http://www.oracle.com/technology/software/products/oracle9i/index.html
    Then, under "Oracle9i Release 2 (9.2.0.1)", try to download "Oracle9i Database Release 2 Enterprise/Standard/Personal/Client Edition for Windows Server 2003 (32-bit). It just gives you a patch. It's not the correct link. Where is the full CD images!
    Compare this to the 64-bit version under "Oracle9i Release 2 (9.2.0.2). This does have 2 big CD images.
    Can you fix the link? I need the software for Windows Server 2003 (32-bit). Thanks.

    Yes, it's a little confusing but it's all in the release notes on that page. Basically, you need to install 9.2.0.1 for WinNT/2000 first and then apply the patch to bring it up to v9.2.0.3 for Windows 2003.

  • SQL+-MULTI TABLE QUERY PROBLEM

    HAI ALL,
    ANY SUGGESTION PLEASE?
    SUB: SQL+-MULTI TABLE QUERY PROBLEM
    SQL+ QUERY GIVEN:
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
    = &PATIENT_NUM;
    RESULT GOT:
    &PATIENT_NUM =1
    no rows selected
    &PATIENT_NUM=2
    no rows selected
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    ACTUAL WILL BE:
    &PATIENT_NUM=1
    PATIENT_NUM 1
    PATIENT_NAME BBBB
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 5
    HMTLY_RBC_NORMAL 4.6-6.0
    &PATIENT_NUM=2
    PATIENT_NUM 2
    PATIENT_NAME GGGG
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     42
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
    PATIENT.
    TABLE1:PATIENTS_MASTER1
    COLUMNS:PATIENT_NUM, PATIENT_NAME,
    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BBBB
    GGGG
    KKKK
    PPPP
    TABLE2:TESTS_MASTER1
    COLUMNS:TEST_NUM, TEST_NAME
    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HAEMATOLOGY
    DIFFERENTIAL LEUCOCYTE COUNT
    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE     
    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HAEMATOLOGY
    HAEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6-6.0
    4.6-6.0
    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
    NORMAL_VALUE,
    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUCOCYTE COUNT
    DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    THANKS
    RCS
    E-MAIL:[email protected]
    --------

    I think you want an OUTER JOIN
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
    outer join marks became stupid emoticons or something. attempting to fix

Maybe you are looking for