Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:11:39+00:00 2026-05-23T04:11:39+00:00

Good morning, I have a question regarding default values and NULL values in Sybase

  • 0

Good morning,

I have a question regarding default values and NULL values in Sybase ASE 12. To make a long story short: I have inherited a very old Sybase database as well as the PowerBuilder front end that sits on top of it. One of the tables in question contains several columns that have default values as well as the not null constraint. Thus, whenever no value (note: not a NULL value) is supplied, PowerBuilder creates the appropriate insert / update statement and simply does not pass a value for these empty fields, which are then automatically assigned the default value by the database. Gravy.

Now, the problem: It was decided to add auditing to the entire application via the front end (a bad idea, I know, but not my choice). A function was written to abstract the process of auditing but the problem arises from the fact that it sees no user entry as a NULL values and generates an insert statement into the audit table (also defined with the not null constraint), supplying the literal NULL for these empty columns. Sybase then sees the literal NULL and, as you all know, treats the NULL as a value and not ‘no entry’.

So the question: is it possible to default a NULL entry to a default values from the database side? I have considered triggers, but I am hoping I will get lucky and there will be some form of table-level construct that I can make use of.

Thank you for your time and consideration.

References:
A good example of the issue in question
http://www.sybaseteam.com/null-not-nothing-difference-between-null-nothing-sybase-t-390.html

See table 7-1, halfway down the page.
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@ebt-link;pt=20741?target=%25N%15_19279_START_RESTART_N%25

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:11:39+00:00Added an answer on May 23, 2026 at 4:11 am

    I think you need to make your auditing function smarter. It should only log the columns the user changed. This is easy to determine with getitemstatus. You can loop through the columns using the form of getitemstatus that takes an integer column number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning. I have an XML file which contains lists of warning and errors
Good morning, Apologies for the newbie question. I'm just getting started with ASP.NET internationalization
Good Morning, I have created an ASP.NET 3.5 webform that allows users to search
Good Morning All, I have loaded over 1,300 blurbs into my client's database with
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't
Good morning all, I'm sure this is a gimme, but I have no idea
hi dear friends and good morning The following question may be complicated and critical
Good morning. I currently have this little rule in my .htaccess RewriteEngine On RewriteBase
Good morning! I Have an issue with a wysiwyg editor that saves html to
Good morning. I have several pages with content that correspond to some products details.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.