1. Oliver Margarejo
  2. PowerBuilder
  3. Wednesday, 24 April 2019 22:16 PM UTC

Hi,

We're testing using MSOLEDBSQL driver from SQL Native Client and one of the stored procedures that has a datetime parameter is excluding the "seconds" portion, when the stored proc is called from PB. It works with SQL Native Client though.

 

I've tried adding DateTimeFormat='\''yyyy-mm-dd hh:mm:ss.fff\''' to the DBParm connection string but it didn't help. Any ideas?

 

Thanks,

Oliver

Oliver Margarejo Accepted Answer Pending Moderation
  1. Thursday, 25 April 2019 16:13 PM UTC
  2. PowerBuilder
  3. # 1

Thanks for your reply Chris.

 

I've just tried now but it still doesn't work. It's still dropping the "seconds" component of the time. However, I have noticed that I have a similar SP that passes datetime parameter from PB but works as expected. It turns out this new MSOLEDBSQL driver doesn't like an OUTPUT parameter defined in the SP. So as a workaround, I had to return the needed output from the SP by adding a select statement at the very end of the SP and remove the OUTPUT parameter.

 

So the conclusion that I'm seeing is when you have a stored proc that passes a datetime from PB and that stored proc uses an OUTPUT parameter, you'll have this issue. At least that's what I'm seeing because that specific code in PB has been there for years, we just updated our driver from SQL Native Client to MSOLEDBSQL.

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 25 April 2019 16:34 PM UTC
Hi Oliver;

Thank you for that extra information & feedback. I am super glad that you have a workaround. I would still like to suggest though that you open a Support Ticket on this issue under the OLE-DB driver's handling of the OUTPUT data type declaration.

Regards .. Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 25 April 2019 15:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi Oliver;

  I think that the PB Help might be wrong in its example syntax. Can you try ..

SQLCA.DBParm = "xxxxxxxxxxxxxxx,DateTimeFormat='yyyy-mm-dd hh:mm:ss:fff'"

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.