Returns a NULL field ?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Returns a NULL field ?

    Hi.

    I'm stuck!

    I am querying two tables in a DB using the following string

    SQLQuery = "SELECT GuestBook.*, GuestPic.PicName FROM GuestBook LEFT JOIN
    GuestPic ON GuestBook.id = GuestPic.id "

    Sometimes there will not be a value in PicName so the query only returns the
    values in the primary (left hand) table. In my script I need to test and see
    if there is a value returned for PicName.

    How do I do this ? If I check for a string using "" it fails, isEmpty fails
    as well. I think it's because the string is NULL but I've no idea. Can
    someone point me in the right direction please.

    Here is the code I'm using

    if isEmpty(rsGuestBook("PicName")) then
    Response.Write(" ")
    else
    Response.Write("<img src='" & rsGuestBook("PicName") & "'>")
    end if

    TIA

    Chris



    Chris Leonard Guest

  2. Similar Questions and Discussions

    1. #40783 [Opn->Bgs]: odbc_close always returns null
      ID: 40783 User updated by: j dot henge-ernst at interexa dot de Reported By: j dot henge-ernst at interexa dot de -Status: ...
    2. #26132 [Bgs]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      ID: 26132 User updated by: steven at pearavenue dot com Reported By: steven at pearavenue dot com Status: Bogus Bug...
    3. #26132 [Opn->Bgs]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      ID: 26132 Updated by: iliaa@php.net Reported By: steven at pearavenue dot com -Status: Open +Status: ...
    4. #26132 [Opn]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      ID: 26132 User updated by: steven at pearavenue dot com Reported By: steven at pearavenue dot com Status: Open Bug...
    5. #26132 [NEW]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      From: steven at pearavenue dot com Operating system: Redhat 9.0/Apache 2.0 PHP version: 4.3.4 PHP Bug Type: PostgreSQL...
  3. #2

    Default Re: Returns a NULL field ?

    Chris Leonard wrote:
    >
    > Sometimes there will not be a value in PicName so the query only
    > returns the values in the primary (left hand) table. In my script I
    > need to test and see if there is a value returned for PicName.
    >
    > How do I do this ? If I check for a string using "" it fails, isEmpty
    > fails as well. I think it's because the string is NULL but I've no
    > idea. Can someone point me in the right direction please.
    >
    isNull is over there ------->

    --
    William Tasso - [url]http://WilliamTasso.com[/url]


    William Tasso Guest

  4. #3

    Default Re: Returns a NULL field ?

    Doh!!

    Thanks, I really should have tried that one!


    "William Tasso" <ngx@tbdata.com> wrote in message
    news:eE$2XxOZDHA.2572@TK2MSFTNGP09.phx.gbl...
    > Chris Leonard wrote:
    > >
    > > Sometimes there will not be a value in PicName so the query only
    > > returns the values in the primary (left hand) table. In my script I
    > > need to test and see if there is a value returned for PicName.
    > >
    > > How do I do this ? If I check for a string using "" it fails, isEmpty
    > > fails as well. I think it's because the string is NULL but I've no
    > > idea. Can someone point me in the right direction please.
    > >
    >
    > isNull is over there ------->
    >
    > --
    > William Tasso - [url]http://WilliamTasso.com[/url]
    >
    >

    Chris Leonard Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139