I have some troubles when I attempt execute delete statement with datetime parameter:
- Code: Select all
EXEC ('create table testtable (id int, dt timestamptz)') AT testPGNP
Command(s) completed successfully.
- Code: Select all
INSERT INTO testPGNP.testPGNP.[public].testtable(id,dt)
SELECT 1, GETDATE()
UNION ALL
SELECT 2, GETDATE()
(2 row(s) affected)
- Code: Select all
SELECT * FROM testPGNP.testPGNP.[public].testtable WHERE dt<GETDATE()
id dt
----------- ----------------------
1 2009-12-04 10:03:06.00
2 2009-12-04 10:03:06.00
(2 row(s) affected)
- Code: Select all
DELETE FROM testPGNP.testPGNP.[public].testtable WHERE dt<GETDATE()
OLE DB provider "PGNP" for linked server "testPGNP" returned message "ERROR: bind message supplies 2 parameters, but prepared statement "975626f7afaf86e09b88b0a45573b957" requires 1
".
Msg 7320, Level 16, State 2, Line 1
Cannot execute the query "DELETE FROM "testPGNP"."public"."testtable" WHERE "dt"<?" against OLE DB provider "PGNP" for linked server "testPGNP".
or
- Code: Select all
DECLARE @DT DATETIME
SET @Dt = GETDATE()
DELETE FROM testPGNP.testPGNP.[public].testtable WHERE dt<@Dt
OLE DB provider "PGNP" for linked server "testPGNP" returned message "ERROR: bind message supplies 2 parameters, but prepared statement "975626f7afaf86e09b88b0a45573b957" requires 1
".
Msg 7320, Level 16, State 2, Line 4
Cannot execute the query "DELETE FROM "testPGNP"."public"."testtable" WHERE "dt"<?" against OLE DB provider "PGNP" for linked server "testPGNP".
