| 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 ifthe 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. BEGINif (@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 endend |
|
|
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"] |
 |
|
|
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 |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-04-05 : 11:58:42
|
jim65, we are not sure what you want Srinika |
 |
|
|
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. |
 |
|
|
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 |
 |
|
|
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 needbegin 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"] |
 |
|
|
jim65
Starting Member
35 Posts |
Posted - 2006-04-05 : 12:34:05
|
| Thanks, you guys,if @My_auto_DueDate is nullcan I ask to wait untill My_auto_DueDate is not null? |
 |
|
|
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"] |
 |
|
|
jim65
Starting Member
35 Posts |
Posted - 2006-04-05 : 12:56:26
|
| got it, Thanks a lot |
 |
|
|
|