Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 question for stored procedures

Author  Topic 

jim65
Starting Member

35 Posts

Posted - 2006-04-05 : 11:42:40
I have the part of the code in the stored procedures. when the stored procedures exected. I don't know if
the value My_auto_DueDate has been assigned by used defined function (dbo.udfDueDate_HistoryRecord)before
runing next step the dbo.asp_InsertReportingRequirement_History_by_frequency.

BEGIN

if (@FreqID=1)
begin
select @My_auto_DueDate = dbo.udfDueDate_HistoryRecord(@FYE,@duedays,@FreqId, getdate() )
exec dbo.asp_InsertReportingRequirement_History_by_frequency @RptReqID,@My_auto_DueDate
end


end

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-04-05 : 11:53:31
so you want to do what?

Go with the flow & have fun! Else fight the flow
Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Go to Top of Page

jim65
Starting Member

35 Posts

Posted - 2006-04-05 : 11:56:34
I am not sure if
select @My_auto_DueDate = dbo.udfDueDate_HistoryRecord(@FYE,@duedays,@FreqId, getdate()
has not finished.
then go to
exec dbo.asp_InsertReportingRequirement_History_by_frequency @RptReqID,@My_auto_DueDate
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-05 : 11:58:42
jim65, we are not sure what you want

Srinika
Go to Top of Page

jim65
Starting Member

35 Posts

Posted - 2006-04-05 : 12:10:51
line 1
@My_auto_DueDate = dbo.udfDueDate_HistoryRecord(@FYE,@duedays,@FreqId, getdate()
line 2
exec dbo.asp_InsertReportingRequirement_History_by_frequency @RptReqID,@My_auto_DueDate

my question was. if line 1 has not been finished (I mean didn't get value @My_auto_DueDate)
then line 2 has been executed. so Line 2 can not get value @My_auto_DueDate as input.
I don't if it is clear or not. Thanks.


Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-05 : 12:21:05
if I understand u,
u want to make sure the variable @My_auto_DueDate is assigned with the value from the function, before ur line 2

-- U may use a print @My_auto_DueDate
-- U may insert that to a table (u created for testing purposes and drop it later)


Srinika
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-04-05 : 12:28:48
[code]
select @My_auto_DueDate = dbo.udfDueDate_HistoryRecord(@FYE,@duedays,@FreqId, getdate()
if @My_auto_DueDate is null -- or some other check you need
begin
exec dbo.asp_InsertReportingRequirement_History_by_frequency @RptReqID,@My_auto_DueDate
end
[/code]


Go with the flow & have fun! Else fight the flow
Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Go to Top of Page

jim65
Starting Member

35 Posts

Posted - 2006-04-05 : 12:34:05
Thanks, you guys,
if @My_auto_DueDate is null
can I ask to wait untill My_auto_DueDate is not null?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-04-05 : 12:46:12
hold your horses

sql statement execution isn't a multi-threaded model operation.

so you will wait until dbo.udfDueDate_HistoryRecord completes and returns a value.
returned value check is for you to handle.
then you can execute another statement.

Go with the flow & have fun! Else fight the flow
Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Go to Top of Page

jim65
Starting Member

35 Posts

Posted - 2006-04-05 : 12:56:26
got it, Thanks a lot
Go to Top of Page
   

- Advertisement -