how to build sql server 2008 datetime object and insert it using perl DBI

房东的猫 提交于 2019-12-24 00:39:45

问题


How can i build a sql server 2008 datetime object with perl and insert it using the dbi module to specific table could someone provide example


回答1:


If using ODBC:

my $sth = $dbh->do(q/insert into mytable (mydatetimecol) values(?)/; $sth->execute(q/{ts 'yyyy-mm-dd hh:mm:ss'}/);

The datetime can also have '.mmm' on the end for milliseconds.

If not using ODBC it will depend on what DBD you are using.



来源:https://stackoverflow.com/questions/3044445/how-to-build-sql-server-2008-datetime-object-and-insert-it-using-perl-dbi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!