Default value to param

  • Thread starter Thread starter The Clansman
  • Start date Start date
T

The Clansman

Hello,
I am calling a stored procedure and if one field is empty, I want to make
this field get its default value that is set in db, how do I do that?

thanks!
 
Set a default in the sproc.

CREATE PROCEDURE X
(
var1 int = 0
)
AS

INSERT INTO ...

With Oracle, you have to put a colon before the =.

Either ignore attaching this particular param (which sets to default) or
supply default in you ADO.NET to ensure everything works as expected.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

****************************. *********************
Think outside the box!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top