-
Sekhar Chitta
- PowerBuilder
- Tuesday, 11 March 2025 06:45 PM UTC
I'm having issues with calling stored procedures from Powerbuilder.
I'm using Powerbuilder 2017 R3 app and the database is MS SQL server. We are using ODBC driver to connect.
The datawindows are using Stored Procedures as Datasource and some of the stored procedures are having date as input arguments
While retrieving the datawindow, Powerbuilder is prepending the date value with ODBC format - d for date, t for time and ts for timestamp.
For example, the date value is being sent as @from_date = {ts '1900-01-01 00:00:00.000000'}. It also has the fractional seconds upto 5 decimal places.
SQL server isn't recognizing the value and is failing. I get the error
Select Error: SQLSTATE = 22008
[Microsoft][ODBC SQL Server Driver][SQL Server]Conversion failed when converting date and/or time from character string.
The DBParm already has the needed settings:
staticbind=0,TrimSpaces=Yes,DisableBind=1,StripParmNames=Yes,CallEscape=No,PBNewSPInvocation=Yes
I also set the PBDateTime parameter in PBODB170.ini to MSSQLSERVER_DATETIME
Any ideas what else I need to try to resolve the issue?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.