SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Guest

    Null values in the database

    I am using an Excel spreadsheet that acts as a database for my data-driven test cases.

    My question is: How do I allow nullable columns in a table?

    Thanks!

    ------------------

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Null values in the database

    More detail.
    If by 'table' you mean a spreadsheet, then can't your column just have nothing in it for a specific row value...?

    ------------------
    Tempus fugit, Carpe Diem, et al

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Location
    Phoenix, AZ
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Null values in the database

    If I remember right if you just leave the cell in the spreadsheet blank I don't think the variable in your script will be set to NULL. I think it will just be unset and an error will return if the script trys to use the variable. If this is what you are seeing then you may need to add code to set the variable to NULL if there is nothing in the spreadsheet.

    I am not 100% sure on this. Just trying to remember from a past experience.

    ------------------

  4. #4
    Guest

    Re: Null values in the database

    Yes, by a table I meant a spreadsheet. I am using SilkTest's DB_Tester functions with an Excel spreadsheet which so far works quite well.

    My problem was that I had one (string) column with cells that sometimes contained no values and when I tried to run my testcase it would give me an error because the that particular cell didn't contain a value. I thought maybe there was some way you could set a column to be allowed to contain null values. . .

    However, I've managed to work around this problem by adding the following code to my test case:

    if (Data.sParent != NULL)
    ADOModule.ParentField.SetText(Data.sParent)


    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:12 AM.

Copyright BetaSoft Inc.