Formatting SQL query as of iSQL*PLUS query output format through PL/SQL

This is my procedure through which i m sending an e-mail. In my e-mail i want to show output from error log query. I can show it in simple text but i want the output for the error log to be formatted as the query result is formated in iSQLPlus.
In simple words instead of the message i want to send the query result which is formatted as iSqlPlus query output. Thankx in advance. Please provide a simple solution that iSqlPlus engine recieves my any given query and gives the formatted output for that query in the e-mail
DECLARE
conn utl_smtp.connection;
v_log number;
BEGIN
conn := demo_mail.begin_mail(
sender => '<sender-email>',
recipients => '<recipient-email>',
subject => 'HTML E-mail Test',
mime_type => 'text/html');
</h1>
-- This method will be used for oracle error reporting');
demo_mail.write_text(
conn => conn,
message => '<h1>Hi! This is a <i>test msg</i>);
demo_mail.end_mail( conn => conn );
END;

oe@ORA102>
    select * from
    (select rownum r1, p.promo_id, promo_name from promotions p where rownum <5)
    full outer join
    (select rownum r2, w.warehouse_id from warehouses w where rownum <4)
   on (r1 = r2)
oe@ORA102>/
        R1   PROMO_ID PROMO_NAME                   R2 WAREHOUSE_ID
         1          1 everyday low price            1            1
         2          2 blowout sale                  2            2
                                                    3            3
oe@ORA102>But there should be "some connection" between the result sets, otherwise the resulting result set become unpredictable / meaning less.
I am joining on ROWNUM, Do you want every row from emp related to every row from stocks (like a cartesian join)?
Trying to understand the requirement.
vr,
Sudhakar B.

Similar Messages

  • Chr(10) not working in isql *plus

    Hi,
    Im using oracle 9i. i executed the following statement in sql * plus,
    select 'sankar'||chr(10)||'naraya" from dual
    the output is ,
    sankar
    naraya
    but when i execute the same statement in iSQL *Plus
    the output is
    sankar naraya
    i need the first output in isql * plus. What to do?

    Hello Sankar,
    Here you go
    This can be resolved by modifying the preferences in the iSQL*Plus session to choose a text output format rather than the default HTML format. 
    Select the Preferences button at the top right and then select the Set system variables option to make preference-setting changes. 
    Move down the alphabetical list of settings until you find the Markup HTML area, as shown in Figure 10. 
    Within this area, set the Preformat option to On.
    Clicking OK and OK saves the setting and returns you to the work screen.Here is the link for your reference.
    http://www.dmacc.edu/instructors/rebullard/iSQLPlus%20Users%20Guide.doc
    Cheers!!!
    Bhushan

  • Executing a procedure - Works on Isql Plus but not SQL Developer??

    Hi folks.
    I am playing around with some design and structure stuff, mostly just passing values around procedures. I have one procedure (procedure1) which takes a sysdate and then passes it to another procedure (procedure2) which takes the parameter and does a dbms_output.put_line.
    Both objects are valid, and compile correctly. I use
    exec procedure1;
    in iSql Plus and it works perfectly. It prints the dates out and all.
    However if I use the exact same command in SQL Developer it gives me error "ORA-00900: invalid SQL statement"
    I don't understand why this happens?? The code executes perfectly in one but not the other...

    Remember that SQL*Plus commands don't work in the worksheet. So, this would fail
    exec my_procIn the worksheet you have to declare an anonymous block....
    begin
        my_proc;
    end;
    /If you right-click on the procedure in the Navigator and select Run then SQL*Dev will throw up a harness for you. Very handy if you want to get DBMS_OUTPUT, set variables, etc.
    Cheers, APC
    http://radiofreetooting.blogspot.com

  • SQL*Plus/iSQL*Plus login as DBA

    I just installed 10g Enterprise on a Windows platform and am a bit confused to why I cannot log into SQL*Plus/iSQL as a DBA. I can login as one of the user accounts then use 'connect' to login as dba in SQL*Plus or at the Windows command prompt. I cannot do this, however, in iSQL*Plus. One of the threads on this forum pointed me to using JAZN after installing OC4J. I am in the process of doing this, but I need to understand something apparently fundamental: why should I have to perform another install when the Universal Installer installed iSQL and all the features that came with it? Didn't the 10g download give me the tools necessary to administer its application's accounts? The OC4J download page states that this tool should not be used to replace an existing 10g installation.
    Moreover, why iSQL knows about the 'users' authorization level, but not 'system?' I can see the users and groups in the Enterprise Manager, but no features to set WebDBA users as iSQL*Plus requests.
    Your comments would be much appreciated.

    Hi,
    in order to use iSQL*Plus as DBA, you have to perform additional configuration. See
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch2.htm#BCEIHEJF
    By the way: Get used to a different tool like SQL*Plus linemode or SQL Developer, because iSQL*Plus disappears in future versions.
    Kind regards
    Uwe

  • Issue with Saving the Query output data in Excel format

    Hi,
    Recnetly we had upgraded from 4.6c to ECC 6.0.
    In ECc 6.0 environment, when user try to export the query output , we are getting only XML option to save the data.
    But user want to save the data in EXcel format, he was able to do that in 4.6C.
    pleas eprovide some inputs, on this issue.
    Thanks,
    Sanketh.

    I cannot for the life of me imagine, why a link to a post in the 'Business One Forum' where one uses ODBC to transfer query-data to MicroSoft Excel is of relevance to the OPs question, even if the same is not a security issue.
    Never mind. [note 40155|https://service.sap.com/sap/support/notes/402155] deals with various symptoms in the ALV-Excel combination as as of release 4.6C. There are various others, mostly in components BC-SRV-ALV and BC-ABA-LI - also: I remember that when we upgraded from 4.5B to 4.7C there was an issue with Excel-templates -> the solution was in the release notes somewhere. So, in addition to SMP you might want to check the release notes and/or upgrade guide for solutions.
    And yes, moderators ... this is not a security issue, this should go to ECC-Applications/Upgrade.

  • The quality of iSQL PLus

    Just a quick question to all of you out there, using iSQL Plus: are you not disappointed in what Oracle have made? I mean, Oracle have been betting on the Java technology for 4 - 5 years, however, they have not used it to make a superior "platform-independent-run-anywhere" version of the classic SQL Plus tool. Does this not seem strange to you all that after all these years they release a "platform independent" version of SQL Plus that has LESS features than the original - and is far less user friendly (I never thought that possible until now)???
    Am I the only one who is amazed by this? I feel that Oracle should be making a new version of SQL PLus in Java - with all the "bells and whistles" that we have come to expect from a "Windows environment"
    What do you all think? I would like to know.
    regards,
    Unknown

    Hi Alison,
    I have "revealed" myself! I am the "Unknown" who posted the initial query. Thanks for your reply - very informative. I appreciate your point of view regarding speed issues, however, I do feel that you (read Oracle) have made the wrong decision in terms of which technology to use for rewriting SQL Plus.
    I guess the problem in the past for ORacle has always been to cater to the "lowest common denominator", as the Oracle RDBMS runs on ALL platforms. Therefore SQL Plus never could be a particulary "advanced" tool in terms of functionality and user-friendliness. But that's just the way it had to be.
    These days, there is Java which can (theoretically) run on all platforms (that support Java). Yes, Java does not run as fast as C++ etc. etc. - I don't want to get into that discussion - however, I have been working with HTML, Java and Oracle RDBMS for 4 - 5 years, and Java has really come of age in that time.
    Through my work and own personal experience, I have discovered a fact about websites (read HTML) that hasn't changed over the years - it is extremely limited in terms of functionality and user-friendliness. HTML is not - for me - an acceptable technology to write GUI's for applications/data entry systems nor RDBMS tools such as SQL Plus.
    So, given this to be true (I believe this to be so), then what other choices are there? Well, there's Flash and Director. Both very impressive technologies, however, they only can work on Windows and Macintosh. There is also Java, which is also a very impressive technology, albeit with its own set of limitiations. Nevertheless, Java has an advanced API for writing GUIs and it runs on Windows, Linux, Unix, Mac, and presumably other platforms.
    For me - Java is the logical choice of technology for rewriting SQL Plus. It gives you the ability to write "user friendly" Windows like applications, which will run on all platforms. Now, I am not saying that there wouldn't be issues/problems with Java; of course there are. Just like any other technology. You have to weigh up the pros and the cons before embarking on designing/developing an application. However, in this case, I feel the pros far outweigh the cons.
    Now, unlike alot of other system designers/developers, I actually "eat what I serve" - I use Sun's Forti (written entirely in Java) as my Java RAD tool, I use TogetherSofts "TogetherJ" as my design tool for Java (also written in Java), I use a Java based interface for the version control software we use here at work.... in fact, the one thing I am missing is a good Oracle tool written in Java. I currently use Quest's SQL Navigator, however, its quality is decreasing.
    Anyway, I am digressing! My point is simple - Java will enable you to write a highly functional RAD tool for Oracle to replace the prehistoric and particularly un-user friendly tool SQL Plus. YES - you are right - it most probably won't load as fast as a web page, but once it is loaded it will run quickly. I strongly suggest that the iSQL Plus team take a look at Sun's Forti (very impressive tool - no, the MOST impressive tool I have seen for Java) as well as Quest Software's SQL Navigator. I think the iSQL Plus team would get alot of good ideas and inspiration from them.
    There is, of course, another problem here - and that is datababe connectivity. Unfortunately, Oracle have been increasing the size of their JDBC drivers ever since day one, to the point that it is PROHIBITIVE to download them to an applet. I'm sure the JDBC team have a bazillion excuses for this, however, I am personally not buying it. For me, the exhorbitant size of the drivers is a sign of badly designed code. Regardless of my personal views, the size of the JDBC drivers mean that it is not feasible to write a SQL Plus applet which download the JDBC drivers. The only solution is to use CORBA and/or RMI.
    Okay! That's probably enough from me for now!!! Please don't take this as "Oracle bashing" - I have invested alot of time into Java and Oracle, and I am more than happy to be of some assistance, however small. You asked about what features I thought were missing - well, look at Forti and SQL Navigator. That will give you some idea of what I expect. But, to summarise, I consider the following features to be necessary:
    1. Code to be displayed in multi-colours (user definable). Such a simple thing, yet SO useful
    2. SQL results to be displayed in a tabular/grid-like format, with copy/paste functionality plus porting to text files.
    3. In-built stored procedure editor - like in SQL Nav. Very nice.
    4. Debug functionality
    5. Tuning module - for DB tuning
    6. Some kind of Tree Navigator window, which allows one to traverse all database objects (see SQL Nav)
    7. Ability to generate DDL scripts from current DB objects (see SQL Nav)
    8. Ability to define one's own shortcut keys (see Forti - very very sexy)
    Alison, please feel free to email me at [email protected] if you wish to discuss this futher and/or post a reply to this "disccussion"
    yours sincerely,
    Alexander Day

  • Anyway to supress the coulmn names in the query output from SQLPLUS

    Hi,
    I am using sqlplus to run a script which returns the results with column names.
    Is there anyway to omit the column names from the query output from sqlplus?
    I would like to have only results with out their column names in the output.
    Thanks in advance!!

    Hi,
    Maybe your LINES(IZE) isn't set ?
    SCOTT>set lines 130
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    STATUS   MACHINE                                                          MODULE
    INACTIVE PFAE3\VPC4894-03                                                 TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03                                                 SQL*Plus
    2 rows selected.
    SCOTT>As an alternative to setting linesize, you can format columns:
    SCOTT>set lines 80
    SCOTT>col status for a8
    SCOTT>col machine for a30
    SCOTT>col module for a30
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    STATUS   MACHINE                        MODULE
    INACTIVE PFAE3\VPC4894-03               TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03               SQL*Plus
    2 rows selected.
    SCOTT>Regards
    Peter

  • ISQL*PLUS dynamic reports - how to pass connect string in the URL

    When we run dynamic reports thru ISQL*PLUS, does anyone know how
    to pass the connect string info in the URL
    The following is the code from ISQL*PLUS users guide but it
    dosen't show how to pass the connect string
    when I tried to pass hr/your_secret_password@dbserver for userid
    I got an error msg
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <HTML>
    <HEAD>
    <TITLE>iSQL*Plus Dynamic Report</TITLE>
    </HEAD>
    <BODY>
    <H1>iSQL*Plus Report</H1>
    <H2>Query by Employee ID</H2>
    <FORM METHOD=get ACTION="http://host.domain/isqlplus">
    <INPUT TYPE="hidden" NAME="userid"
    VALUE="hr/your_secret_password">
    <INPUT TYPE="hidden" NAME="script"
    VALUE="http://host.domain/employee_id.sql">
    Enter employee identification number: <INPUT TYPE="text"
    NAME="eid" SIZE="10">
    <INPUT TYPE="submit" VALUE="Run Report">
    </FORM>
    </BODY>
    </HTML>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Thanks
    Jay

    The form you use should work when your change
    "hr/your_secret_password" to a valid username, password
    and connect identifier like "hr/hr@MYDB". Don't forget to
    configure MYDB in your tnsnames.ora file on the machine that has
    the iSQL*Plus server.
    What was the error you got?
    The full URL syntax did seem to go missing from the 9.0.1 doc.
    See below for the full syntax. This should be appearing in a
    forthcoming FAQ.
    - CJ
    What syntax can I use to run an iSQL*Plus Dynamic Report?
    You can run a dynamic report by entering the report URI in the
    location field of your browser, or by making the report server a
    link or the action for an HTML form. The iSQL*Plus 9i Release 1
    documentation has examples of these.
    The general syntax for running a dynamic report is:
    {uri}?[userid=logon&]script=location[&param...]
    where uri
    Represents the Uniform Resource Identifier (URI)
    of the iSQL*Plus Server, for example:
    http://host.domain/isqlplus
    where logon
    Represents the log in to the database to which you
    want to connect:
    {username[/password][@connect_identifier]}
    where location
    Represents the URI of the script you want to run.
    The syntax is:
    http://[host.domain/script_name]
    The host serving the script does not have to be
    the same as the machine running the iSQL*Plus server.
    where param
    Specifies the named parameters for the script you
    want to run.
    Named parameters consist of varname=value pairs.
    iSQL*Plus will define the variable varname to equal value prior
    to executing the script e.g.
    ...script=http://server/s1.sql&var1=hello&var2=world
    This is equivalent to the SQL*Plus commands:
    SQL> define var1=hello
    SQL> define var2=world
    SQL> @http://server/s1.sql
    iSQL*Plus, SQL*Plus and SQL keywords are reserved
    and must not be used as the variable names (varname). Note also,
    that since variables are delimited by the ampersand character,
    there is no requirement to enclose space delimited values with
    quotes. However, to embed the ampersand character itself in the
    value, it will be necessary to use quotes.
    For compatibility with older scripts using the &1
    variable syntax, varname may be replaced with the equivalent
    variable position as in:
    ...script=http://server/s1.sql&1=hello&2=world
    Note the & is the URL parameter separator and not
    related to the script's substitution variable syntax.
    Commands and script parameters may be given in any
    order in the dynamic report URI. However, please note that if any
    parameters begin with reserved keywords such as "script" or
    "userid" then it may be interpreted as a command rather than a
    literal parameter.

  • Message from iSQL*Plus team

    This forum is for iSQL*Plus, the web-based interface to SQL*Plus. The iSQL*Plus development team will monitor this forum on a best effort basis, and help you with any problems or questions you might have. If you find any bugs, this is the place to tell us about them.
    We are also interested in hearing your comments on the interface, and what you would like to see in future versions.
    Any questions you have on SQL*Plus and the SQL language will probably not be answered by the iSQL*Plus development team, although other forum members may want to post replies and answers. Oracle Metalink -- http://metalink.oracle.com/ -- is the dedicated forum for SQL*Plus and the SQL language. Note that you must purchase a support contract to log on to Oracle Metalink.
    iSQL*Plus Download
    http://technet.oracle.com/software/tech/sql_plus/software_index.htm
    SQL*Plus FAQ
    http://technet.oracle.com/support/tech/sql_plus/htdocs/sql_plus_faq.htm
    Alison
    iSQL*Plus Team

    hi alison,
    I have installed iSQL*Plus and it works fine with normal queries.
    I have tried it with different versions of oracle
    7.1.6.2.0
    8.0.4.0.0
    8.1.5.0.0
    8.1.6.0.0
    8.1.7.0.0
    There are some problems also which i noticed when we were working with it.
    It is unpredictable sometimes, i.e., the same query which works once may give problems some other times. restarting the browser solves the problems some times
    But the major problem was that if the user closed the browser window without logging off the session will not end on the server and after such many improper shutdowns the number of sessions on the server piles up.
    But if the user logs off properly then the session is closed.
    It is a nice tool and may become a necessary tool in future.
    vinayak

  • How to get query output data

    Hi,
    I have created procedure to analyze tables. I tried to get output but its not displaye in a proper way. I want to output as like as a query output.
    create or replace procedure tablestats
    as
    begin
    for cur in (SELECT OWNER,TABLE_NAME, NUM_ROWS, BLOCKS, AVG_ROW_LEN,TO_CHAR(LAST_ANALYZED, 'MM/DD/YYYY HH24:MI:SS')FROM DBA_TABLES WHERE OWNER='SCOTT') LOOP
    dbms_output.put_line(cur.owner||' '||' '||cur.table_name||' '||cur.NUM_ROWS||' '||cur.BLOCKS||' '||cur.AVG_ROW_LEN);
    DBMS_STATS.GATHER_TABLE_STATS('scott',cur.table_name);
    end loop;
    end;
    Output came lke this:
    SQL> exec tablestats
    SCOTT  DEPT 4 4 20
    SCOTT  EMP 14 4 38
    SCOTT  SALGRADE 5 4 10
    SCOTT  SERVICE 8 5 12
    SCOTT  BONUS 0 0 0
    PL/SQL procedure successfully completed.
    Acually i want output like..
      1* SELECT OWNER,TABLE_NAME, NUM_ROWS, BLOCKS, AVG_ROW_LEN,TO_CHAR(LAST_ANALYZED, 'MM/DD/YYYY HH24:MI:SS') Last_Analyzed FROM DBA_TABLES WHERE OWNER=
    'SCOTT'
    SQL> /
    OWNER                          TABLE_NAME                       NUM_ROWS     BLOCKS   AVG_ROW_LEN   LAST_ANALYZED
    SCOTT                          DEPT                                             4                   4                 20                   11/27/2013 19:10:44
    SCOTT                          EMP                                            14                   4                 38                    11/27/2013 19:10:44
    SCOTT                          SALGRADE                                   5                   4                 10                    11/27/2013 19:10:44
    SCOTT                          SERVICE                                      8                   5                 12                     11/27/2013 19:10:44
    SCOTT                          BONUS                                        0                    0                  0                      11/27/2013 19:10:44
    Please help me.
    Thanks,

    Hi,
    As John said, PL/SQL doesn't give you any of the nice formatting features that front end tools, like SQL*Plus, provide.  If you want headers, you have to say exactly what they are, and write them yourself.  If you want the columns to line up, you have to decide how long they will be and pad them yourself.  It's a lot of work.
    Why not let PL/SQL do the things that only PL/SQL can do, and let SQL*Plus do the things it does well?  Have your procedure  or function return a cursor, which you can then diplay in SQL*Plus, or write a piplined function, that you can use in queries where SQL*Plus can format the results.
    The query you posted can eaisly be done directly from SQL*Plus, of course.  I assume you posted a very simple example, becuase your question is just about display.  If you don't absolutely need PL/SQL, don't use PL/SQL.  What I said above applies if you really do need PL/SQL.

  • Oracle 10g - iSQL*Plus URL issue

    Hello:
    I'm trying to run a sql script file via my browser and I'm receiving the following error message:
    SP2-0920: HTTP error 'URL access is disabled in iSQL*Plus ' on attempt to open URL
    In my HTML file, my SQL script is located on c:\demo\script.sql. In the A HREF portion of my HTML, I am not sure whether I am referencing my script.sql correctly. I'm wondering if this could be the cause of the error message.
    This is the HTML file I am running on my browser:
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <!--Run Employee Report-->
    </body>
    </html>
    If anyone can help me out that would great. Thank you in advance.
    Message was edited by:
    fullfocus
    Message was edited by:
    fullfocus
    Message was edited by:
    fullfocus
    Message was edited by:
    fullfocus

    Sorry it took so long but I finally had a chance to get back to this. This is what I did. My test.html file is located in the d:\sql directory but it could be located anywhere. It looks like this:
    <HTML>
    <HEAD>
    <TITLE>iSQL*Plus Dynamic Report</TITLE>
    </HEAD>
    <BODY>
    <!--H1><em>i</em>SQL*Plus Report</H1>
    Run Employee Report
    </BODY>
    </HTML>
    ora9i is the name of my machine -- a Windows XP Pro SP2 installation.
    The script.sql file is:
    set pagesize 200
    select *
    from emp_details_view
    order by last_name, employee_id
    This file is located in the $ORACLE_HOME\Apache\Apache\htdocs directory which on my machine is d:\oracle\ora92\Apache\Apache\htdocs. The file has to be there because the HTTP Server configuration file d:\oracle\ora92\Apache\Apache\conf\httpd.conf has a configuration parameter called DocumentRoot which tells the HTTP Server where to look for documents. You can change the location where it will look by using symbolic links or aliases but for the sake of simplicity, I left the parameter alone.
    To get the script to run, these are the steps I took:
    1. In IE7, click File --> Open and browse to the location on your hard drive where the test.html file is located and click on Open and then OK.
    2. This should present you with a page that says
    iSQLPlus Report
    Run Employee Report
    This comes from the formatting I used in my html file above.
    3. Click on Run Employee Report
    4. This will take you to the iSQL*Plus login page where you will be asked to enter a Username, Password and Connection Identifier. The username should be a user who has access to the HR schema and the connection identifier can simply be the name of your Oracle SID. If you have Oracle installed on your local machine, you can leave this field blank.
    5. If everything is working, the script.sql will run and the next page will have the results of running the script which will be everything in the emp_details_view.
    Tom

  • How to Align Query output in vertical grids in Classic Reports

    HI all,
    I have a requirement to display query output in a vertical grid.
    For example, If my query output is :
    SQL, PL/SQL, Forms,Reports, XMLP, APEX etc then output should be displayed in following format:
    1. SQL 2. PL/SQL 3. Forms
    4. Reports 5. XMLP 6. APEX
    Thanks in Advance!!
    Regards,
    Vamsi

    866010 wrote:
    Thanks for the response!!
    SQL: select * from emp
    where 1=1
    and emp = 1 ;
    We want to display emp details from the above query in the following format:
    EMP No : 1 Ename: XXX Manager_Id: 2
    Job: Consultant Sal: 1000 Commission: 5
    We want a break after three columns.Create a custom named column template and base the tabular form report on this: {message:id=10399762}
    Please read the FAQ and forum sticky threads (if you haven't done so already), and update your forum profile with a real handle instead of "866010".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Problems with report using isql*plus

    Hi there,
    As the title of this topic illustrates, i'm having trouble dumping relevant data from columns of different tables. Using isql*plus, I have three tables appropriatly related. A 'course' table, 'student' and 'next_of_kin' tables. I have many students enrolled on various courses but only a hanfull of courses offer the module option 'Database Systems'. I have no 'module' table but i know the three course names which provide the module option. I intend on producing a report hich lists all students enrolled on the courses which provid the module option 'Database Systems'. I have attempted the report but i keep getting a 'cartesian product' displaying all next_of_kin names instead of the appropriate. Also i am struggling to come up with the right WHERE statement to depict only the three courses which provide the module option 'Database Systems' as defined by 'courseNo' in both 'course' and 'student' tables.
    Here is the most recent attempt:
    --set echo off*
    --set pagesize 24*
    --set feedback off*
    --set linesize 78*
    col A format 99999999 heading 'Student No'
    col B format A15 heading 'Student Name'
    col C format A15 heading 'Course Name'
    col D format 99999999 'Course No'
    col E format A10 heading 'Next-of-Kin'
    break on A skip 1 on B
    TTitle 'Business Studies 1 Option BT300'
    BTitle 'Prepared By : Richard Stroud / 20527796'
    Select student.StudentNo "Student No",
    student.fName || ' ' || student.lName "Student Name",
    course.title "Course Name",
    course.courseNo "Course No",
    next_of_kin.fName || ' ' || next_of_kin.lName "Next-of-Kin"
    From student, course, next_of_kin
    where course.courseNo = '12885545'
    order by studentNo
    --clear columns*
    --TTitle off*
    --BTitle off*
    --set feedback on*
    --set pagesize 24*
    --clear breaks*
    Any help towards this toipic will be GREATLY appreciated

    According to my little knowledge - i don't think Oracle is an AIDB. It is only RDBMS or rather you can call it Advanced RDBMS.
    Now, you are thinking that since you have provided the relavant table here - so Oracle should automatically pic the single records. Since you have define every logic including the concept of primary key, foreign key in your table.
    But, question is - did you apply the relationship in your join between the tables.
    What does a primary key, foreign key do inside a table? Is it automatically select the unique rows from the join tables - when you didn't mention the join criterion.
    If you think that - then you are wrong. My advice is - kindly go through the JOIN Concept.
    Then start your coding. This is very dangerous way to start. Learn the basics at least.
    So, what Senti suggested has a very much valid point.
    Regards.
    Satyaki De.

  • Central Management server - executed a query but how to send the query output in the form of mail?

    Hi All,
    i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.
    basically query is checking the rows count from couple of user tables in servers.
    issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers
    could you please suggest how can i achieve this?

    Copy to what?
    SELECT COUNT(*) FROM sys.objects
    Running the above statement returns two columns (server name and count)
    All the servers SS2005  and onwards , then use
    EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'name', 
         @recipients = '[email protected]', 
         @query = 'SELECT COUNT(*) FROM sys.objects', 
         @subject = 'Count rows'
    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

  • To download the query output to falt file

    Hi all,
    i have a query which i know will give more than 65k records as the output for a selection.
    i cannot run this query in excel due to its limitation.
    if i run on web i cannot download this as downloading is happening to excel file only.
    The customer ideally wants to download the query result to a text file(csv,tab-delimited etc) which inturn it will upload to MS-Access.
    How do i achieve this?
    SAP has given response use try using these options:
    1.open interfaces to receive the output of a query via the MDX language.
    2.open hub tool as it is designed for big amounts of data.(i suppose this is not possible as i want to download query output not the data target contents)
    how do i achieve my scenario with option 1?
    Are there any alternatives??
    Any useful help will be rewarded.
    Regards,
    Dhanya.

    hi vivek,
    thnks for the useful reply.
    i have some problem with my ID,hence loggin in through my coleague's ID.
    i will assign u points as i get logged in.
    I did as u said by downloading it to unconverted format.
    the file got download to a text file.where the output has
    1.header rows(10 lines almost)
    2.the values r coming in single quotes e,g:
    '144000023073      'TAAS SETTLEMENT CONV 738 '19333000   '30.09.2006          '0.000
    how can i remove all this?
    Regards,
    Dhanya
    I

Maybe you are looking for

  • Error while loading Purchasing Cube.

    Hi All, I am loading the data to Purchasing Group Cube "0PUR_C04" with the data source 2LIS_02_SCL. The laod fails saying that "The material MB0214363L does not exist or is not activated" When I checked the same material in R/3 I could see it as the

  • I had my hard drive redone and reinstalled itunes losing all of my music. How do i get my 300 plus songs back on my pc for hearing pleasure?

    I am worried that i have lost all songs which i purchased through the store. I cant access the music but in the account history i am able to see that i did buy and download into my library. would like to know how i can get all music and movies back w

  • Cannot create complib - no BeanInfo generated!

    Hello, I�m trying to create a complib following the steps on http://wiki.java.net/bin/view/Javatools/CustomComponentLibraries. When I run the build.xml file, I get an error in the targets gen-component, gen-taglib, gen-beaninfo: Exception in thread "

  • IE6 div spacing issue

    Ok, I've been searching the net for days now trying to figure this out. I've tried several fixes, including setting vertical-align, display:block, and margin & padding properties on the divs. The issue is that I'm creating a box that has a rounded to

  • Profile during a n homogu00E9neous system copy

    Hi, I have done an export of database ( with R3load process ) and i have donne an intallation of a new SAP system with the exported base ( homogenenous copy ) . Bu when i launch RZ10 i always can  see the reference to the old profile files. Is there