Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Working with Oracle
»
Passing Date parameters to Oracle
Passing Date parameters to Oracle
Rate Topic
Display Mode
Topic Options
Author
Message
itwhiz
itwhiz
Posted Thursday, May 06, 2010 4:49 PM
Grasshopper
Group: General Forum Members
Last Login: Thursday, May 02, 2013 4:55 AM
Points: 11,
Visits: 45
I have defined in my DTS package several date Global Variables, these hold dates in various formats and types.
My problem is that sometimes when I run my query/task the dates do not get past to Oracle in the correct manner and I have to keep messing with the task to get it to work.
For example
Global Variables defined as
GVSysdate Date 01/05/2010
GVSysdate_Str String 01/05/2010
Various SQL statements that randomly work
Trunc(tab1.status_date) = to_date(?,'DD/MM/YYYY') (? is defined as GVSysdate_Str)
OR
Trunc(tab1.status_date) = to_date(to_Char(?,'DD/MM/YYYY'),'DD/MM/YYYY')
(? is defined as GVSysdate)
Does anybody know of a definitive method of using dates from SQL2000 to Oracle when they are defined as Global variables and are used as input parameters to tasks, as I'm wasting about 1hr perday trying to get these tasks working !
Thanks in advance
Post #917504
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
Posted Wednesday, July 14, 2010 6:44 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 3:30 PM
Points: 2,982,
Visits: 4,397
The secret is to be sure date_field and mask have matching formats
TO_DATE(date_field,mask)
like:
to_date('07/14/2010','mm/dd/yyyy') <= This is good
to_date('07142010','mmddyyyy') <= This is good
to_date('20100714','yyyymmdd') <= This is good
to_date('14/07/2010','mm/dd/yyyy') <= This is BAD
_____________________________________
Pablo (Paul) Berzukov
Author of
Understanding Database Administration
available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Post #952277
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.