Home All Groups Group Topic Archive Search About
Author
16 Sep 2005 4:00 PM
Ron
We have a sqlserver 2000 database with stored procedures, I am trying to call
the stored procedure from my desktop using java. The stored procedure will
execute some selects to get some values it needs before doing an insert. The
insert fails because a field cannot be null. The tables for the select and
the insert are in the same database. I have done some debugging and it
appears that the select statements are not functioning correctly as the value
is null
Example

Select @p_Seed = TVSeed From ISCIManager Where CliFlag = @p_CliFlag and
Product = @p_Product

When this run the value of @p_Seed = null;

I can do the selects in my java class, pass in the values and the insert
will work

Any ideas. I am new to sqlserver.

Author
16 Sep 2005 4:04 PM
Jerry Spivey
Ron,

How about appending:

AND TVSeed IS NOT NULL

HTH

Jerry
Show quote
"Ron" <R**@discussions.microsoft.com> wrote in message
news:74DF2727-2619-45B8-BDB6-F14755C8FFA5@microsoft.com...
> We have a sqlserver 2000 database with stored procedures, I am trying to
> call
> the stored procedure from my desktop using java. The stored procedure will
> execute some selects to get some values it needs before doing an insert.
> The
> insert fails because a field cannot be null. The tables for the select and
> the insert are in the same database. I have done some debugging and it
> appears that the select statements are not functioning correctly as the
> value
> is null
> Example
>
> Select @p_Seed = TVSeed From ISCIManager Where CliFlag = @p_CliFlag and
> Product = @p_Product
>
> When this run the value of @p_Seed = null;
>
> I can do the selects in my java class, pass in the values and the insert
> will work
>
> Any ideas. I am new to sqlserver.
>
Author
16 Sep 2005 5:04 PM
Ron
do not think this will help. Thre field TVSeed dos not allow null. So when I
run the insert, it error because the value in TVSeed is then used in the
insert statement. If I run the same select statement in my  java class, I get
the correct value. Is there anythin special I need to do in my jdbc
connection string so the stored procedure will execute the select statements?

Show quote
"Jerry Spivey" wrote:

> Ron,
>
> How about appending:
>
> AND TVSeed IS NOT NULL
>
> HTH
>
> Jerry
> "Ron" <R**@discussions.microsoft.com> wrote in message
> news:74DF2727-2619-45B8-BDB6-F14755C8FFA5@microsoft.com...
> > We have a sqlserver 2000 database with stored procedures, I am trying to
> > call
> > the stored procedure from my desktop using java. The stored procedure will
> > execute some selects to get some values it needs before doing an insert.
> > The
> > insert fails because a field cannot be null. The tables for the select and
> > the insert are in the same database. I have done some debugging and it
> > appears that the select statements are not functioning correctly as the
> > value
> > is null
> > Example
> >
> > Select @p_Seed = TVSeed From ISCIManager Where CliFlag = @p_CliFlag and
> > Product = @p_Product
> >
> > When this run the value of @p_Seed = null;
> >
> > I can do the selects in my java class, pass in the values and the insert
> > will work
> >
> > Any ideas. I am new to sqlserver.
> >
>
>
>

AddThis Social Bookmark Button