Get weired table row reflections. How do I get rid of it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patilanjana
    New Member
    • May 2007
    • 7

    #1

    Get weired table row reflections. How do I get rid of it?

    Hi

    Dynamic isql programming.

    I am trying to present the query results. I get the desired results. But I also get greenish extra blank rows before my populated rows.

    I hope you are understanding what I mean.

    Thanks
    Anjana.
    ----------------------------------------------------------------------

    [code=oracle]

    set serveroutput on
    set echo off
    set markup html entmap off

    declare
    n number;
    nparts number;
    snparts number;

    begin
    dbms_output.dis able;

    dbms_output.put _line('<table border=1>');
    dbms_output.put _line('<tr>');
    dbms_output.put _line('<th>');
    dbms_output.put _line('SNUM');
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line('SNAME');
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line('STATUS') ;
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line('CITY');
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line('TOTAL QTY');
    dbms_output.put _line('</th>');
    dbms_output.put _line('</tr>');
    dbms_output.put _line('<tr>');
    for x in (select * from s order by s#)
    loop
    select sum(qty) into snparts from spj where s#=x.s#;


    dbms_output.put _line('<th>');
    dbms_output.put _line(x.s#);
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line(x.sname);
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line(x.status) ;
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line(x.city);
    dbms_output.put _line('</th>');
    dbms_output.put _line('<th>');
    dbms_output.put _line(snparts);
    dbms_output.put _line('</th>');
    dbms_output.put _line('</tr>');


    end loop;
    dbms_output.put _line('</table>');

    end;

    [/code]
    Last edited by amitpatel66; Feb 8 '08, 09:18 AM. Reason: code tags
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Could you give the sample data indicating your blank lines??
    Is it something like few blank rows in a table that you are generating??

    Comment

    • subashsavji
      New Member
      • Jan 2008
      • 93

      #3
      Try this May be helpful to you.....
      [code=oracle]

      DECLARE
      n NUMBER;
      nparts NUMBER;
      snparts NUMBER;
      BEGIN
      --dbms_output.dis able;
      dbms_output.put _line('<table border=1>');
      dbms_output.put _line('<tr>');
      dbms_output.put _line('<th>');
      dbms_output.put _line('empno');
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line('ename');
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line('job');
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line('mgr');
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line('Total_sa l');
      dbms_output.put _line('</th>');
      dbms_output.put _line('</tr>');
      dbms_output.put _line('<tr>');
      FOR x IN (SELECT * FROM emp where deptno=&deptno ORDER BY empno)
      LOOP
      SELECT SUM(sal) INTO snparts FROM emp WHERE deptno=x.deptno ;
      dbms_output.put _line('<th>');
      dbms_output.put _line(x.empno);
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line(x.ename);
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line(x.job);
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line(x.mgr);
      dbms_output.put _line('</th>');
      dbms_output.put _line('<th>');
      dbms_output.put _line(snparts);
      dbms_output.put _line('</th>');
      dbms_output.put _line('</tr>');
      END LOOP;
      dbms_output.put _line('</table>');
      END;
      /
      [/code]

      and this also
      [code=oracle]


      SELECT xmlelement("Nam e",first_nam e), xmlelement("id" ,id), xmlelement("Dat e", start_date)
      FROM employee;

      [/code]
      Last edited by amitpatel66; Feb 8 '08, 10:33 AM. Reason: code tags

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Subashsavji,

        Inspite of telling you so many times, you are repeatedly not using CODE TAGS for the source code.

        You have also been requested to use CODE TAGS by PM, but I think you are not taking this seriously.

        This will be last time I am requesting you to use the CODE TAGS, else I will need to give you official warning for not using CODE TAGS.

        If you dont know about the guidelines of this forum, Check POSTING GUIDELINES

        MODERATOR

        Comment

        • patilanjana
          New Member
          • May 2007
          • 7

          #5
          Originally posted by amitpatel66
          Could you give the sample data indicating your blank lines??
          Is it something like few blank rows in a table that you are generating??
          Thank you for the response. There are no blanks rows in the table.

          Lets take just one row of data,

          'S1', 'SAM', 10,'Delhi', 500

          Anjana

          Comment

          • patilanjana
            New Member
            • May 2007
            • 7

            #6
            Originally posted by amitpatel66
            Subashsavji,

            Inspite of telling you so many times, you are repeatedly not using CODE TAGS for the source code.

            You have also been requested to use CODE TAGS by PM, but I think you are not taking this seriously.

            This will be last time I am requesting you to use the CODE TAGS, else I will need to give you official warning for not using CODE TAGS.

            If you dont know about the guidelines of this forum, Check POSTING GUIDELINES

            MODERATOR
            Did you mean to say,

            Code:
             actual code
            . If yes, I will adhere to it next time. Sorry.

            Anjana

            Comment

            • patilanjana
              New Member
              • May 2007
              • 7

              #7
              I haven't learned xml yet. Programming it in isql, Can you help me with it?

              Thank you.

              Anjana

              Comment

              • amitpatel66
                Recognized Expert Top Contributor
                • Mar 2007
                • 2358

                #8
                Originally posted by patilanjana
                Did you mean to say,

                Code:
                 actual code
                . If yes, I will adhere to it next time. Sorry.

                Anjana
                Hi Anjana,

                Thats right. CODE tags need to be used every time source code is post in this forum

                MODERATOR

                Comment

                Working...