Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 27th, 2006, 05:26 AM
gregallw gregallw is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 2 gregallw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 7 m 6 sec
Reputation Power: 0
DTS from firebird to sql

Hi,
I am having a problem, primarily because I don't know what I am doing, so please be gentle with me!

I have an application running on firebird, a table on which has a date field, but defined as an integer. I have another application running SQL, on another machine. I need to move data from the firebird database to the SQL database based on date being yesterday. In the DTS wizard the following statement transfers the data I need:

Select * from transack
where tr_date = 20060926

If I copy the whole table across to SQL, (all dates) the following SQL script returns only yesterday:

select * from transack
where tr_date = CONVERT(CHAR(8), CURRENT_TIMESTAMP -1 , 112)

The same script, however, in the DTS wizard returns an 'unspecified error'

Anybody able to schedule some light?

Regards,
Greg

Reply With Quote
  #2  
Old September 27th, 2006, 05:39 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 14 h 16 m 7 sec
Reputation Power: 279
Quote:
Originally Posted by gregallw
I have an application running on firebird, a table on which has a date field, but defined as an integer.
Doesn't sound like a good idea, why don't you try to fix it?
Quote:
Originally Posted by gregallw
... In the DTS wizard the following statement transfers the data I need:

Select * from transack
where tr_date = 20060926
This statement is run in Firebird, isn't it?
Quote:
Originally Posted by gregallw
...
select * from transack
where tr_date = CONVERT(CHAR(8), CURRENT_TIMESTAMP -1 , 112)
This statement is run in MsSQL, isn't it?
Quote:
Originally Posted by gregallw
... The same script, however, in the DTS wizard returns an 'unspecified error'
That's because sql syntax is different between Firebird and MsSQL, you'd better find out proper syntax for Firebird, build a view in it and extract from that view, generally I wouldn't embed sql statements in DTS packages.
Quote:
Originally Posted by gregallw
...Anybody able to schedule some light?
Light can be scheduled like a cron job?
Hope this helps, feel free to ask for clarifications.

Reply With Quote
  #3  
Old September 27th, 2006, 09:05 AM
gregallw gregallw is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 2 gregallw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 7 m 6 sec
Reputation Power: 0
pabloj,
Thanks for the reply.
Yeah, not a great idea, but not my app, all I can do is get the data off, and use it for my purposes(which is then to re-transform it into something else, but thta's another story!)

Makes sense what you say about the different syntax. Strictly speaking the staement is running in SQL, but against the firebird data, so it doesn't understand the syntax.
I really need to do all this from the SQL machine, as I have control of it, but not the other one, so unless I am not quite understanding you, your suggestion is not really an option.
I can take the whole table across, but that involves moving about 3000000 line items, and I only need about 200 of them at any given time.

Meant to say 'shed', been a long day.

Regards,
Greg

Reply With Quote
  #4  
Old September 27th, 2006, 09:20 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 14 h 16 m 7 sec
Reputation Power: 279
Quote:
Originally Posted by gregallw
... Strictly speaking the staement is running in SQL, but against the firebird data, so it doesn't understand the syntax. ...
No, it's sent to Firebird and executed there, you'll have to use firebird's syntax.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > DTS from firebird to sql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT