If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > getdate() mystery

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-12, 03:23
manuavaran manuavaran is offline
Registered User
 
Join Date: Dec 2011
Posts: 27
getdate() mystery

when tried execute a stored procedure which uses getdate() function as a variable it produced error message like this
MSG 102, Level 15, State 1, Line 10
Incorrect syntax near ')'.
the query is given below

Quote:
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[INSERT_CALLBACK_67]
@PHONE ='46346',
@CALLBACKTIMEORG = getdate(),
SELECT 'Return Value' = @return_value
GO

then i rewrite the query and executed by declaring getdate() function as given below, it gave correct result

Quote:
USE [testy5]
GO
DECLARE @return_value int
DECLARE @dt DATETIME;
SET @dt = GETDATE();
EXEC @return_value = [dbo].[INSERT_CALLBACK_67]
@PHONE = '6757866',
@CALLBACKTIMEORG = @dt,
SELECT 'Return Value' = @return_value
GO

why this is happening ,i would like know the concept behind

thanks in advance
Reply With Quote
  #2 (permalink)  
Old 01-02-12, 04:00
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
according the syntax and dbo schema - this must be related to sqlserver
this forum is related to DB2 ..
probably wrong forum for you..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 01-02-12, 22:49
manuavaran manuavaran is offline
Registered User
 
Join Date: Dec 2011
Posts: 27
i have posted this same in sql forum also
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On