Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    41

    Unanswered: Select Extra Empty Rows

    Hi

    How do you select empty rows or empty virtual rows? Not sure that I am using the right terms here but this is my problem.

    I am using a recordset to populate a grid in Visual Basic, just setting its datasource to my recordset and it creates all the columns and column headers and so on.

    The problem is that I need 3 extra empty rows in my grid to appear so that the user can enter data but these 3 rows have to appear in my select statement so that the grid will create it.

    so far my select looks like this

    SELECT A.EMP, A.NAME, A.SURNAME FROM EMPLOYEES A

    Can anyone help me please?

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    do something like

    SELECT A.EMP, A.NAME, A.SURNAME FROM EMPLOYEES A
    union all select null,null,null from dual
    union all select null,null,null from dual
    union all select null,null,null from dual

    or

    SELECT A.EMP, A.NAME, A.SURNAME FROM EMPLOYEES A
    union all select null,null,null from table_x where rownum<4

    where table_x is some table which you can guarentee to have atleast 3 rows

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •