× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Not sure if it helps, but if you specify your insert statement as:

INSERT INTO TABLE (column7) VALUES(333)

then you'd only be updating column7 with value 333 and letting the other
columns take defaults. You'd have to ensure that tables are created with
defaults that you want of course, or use ALTER TABLE to set the defaults to
what you want.

Another option is to define all columns and then use the DEFAULT keyword for
ones you don't want to update, i.e.:

INSERT INTO TABLE VALUES(DEFAULT,DEFAULT,DEFAULT...,333,DEFAULT,DEFAULT)

HTH, Elvis


Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Re: Stored Procedure: Default Values For Parameters

Thanks for the suggestions. I hadn't considered the overloading option.
However, in this case it won't work. I am building some custom apps against
ERP tables that are sometimes 100+ columns wide. I had planned on building
Insert/Update procedures for each table with default values for every column
so that when I was ready to insert records, I could only pass relevant
columns within the calling stored procedure instead of replicating the same
verbose INSERT INTO TABLE (columns list 100+ wide) VALUES (100+ wide)
statement in multiple procedures where most of the columns would not be
relevant.

In this case, 100+ procedures per table wouldn't even work because I would
have combinations as well (columns 0, 7, 13, 18, 21).

Anyway, thanks again.

RH



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.