943,912 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 973
  • MS SQL RSS
Nov 14th, 2008
0

Transfer of data

Expand Post »
Hii Group,

This is samuel Like to hav a small suggestion from you hope u ppl do.
"I would like to copy dat from one table to another of the same database in a give
timestamp,I mean when system time equals to the feild time then the entire data should
be transfered Will it be possible in MySql?
."


To be more specific:

1.The Tables doesnt have same structure.

Hope it is clear.

So,all the Querie may be simple but please kindly explain me the proccess to do so.

Thanks in Advance.
SAM
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008
Nov 14th, 2008
0

Re: Transfer of data

MS SQL Syntax (Toggle Plain Text)
  1. SELECT INTO
is your friend
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 16th, 2008
0

Re: Transfer of data

Hi

Thanks for the reply ...I wrote a procedure which copies the data from one table to other but no idea regarding when and where it should be invoked in order to tansfer at the given timestamp.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008
Nov 16th, 2008
0

Re: Transfer of data

if you need some help post your schema and what the timestamp requirements are
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 21st, 2008
0

Re: Transfer of data

Hi,

Sorry For the delayed reply.

The functionality db of my appplication is around two tables
both of different structures.

Table1chedule
Table2:Out


Schedule(id,recipient,Text,TimetoSend)
Out(id,recipient,text,...........)

Ok SO the Table Schedule is populated before and when ever the "Timetosend " equals to that of system time then the selected rows whose feild value(TimeToSend)
should be copied to Table Out


I would like to know how to solve this minor task

when I googled a bit I found "mysql.event" ,Can I Use the same here.... if so please let me know how to do so.


Thanks in Advance.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008
Nov 21st, 2008
0

Re: Transfer of data

>>select into

I think it is used in SQL Server.
is it possible in Mysql?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008
Nov 21st, 2008
0

Re: Transfer of data

event i believe is only only available in 5.1.6

select into with my sql is an insert statement with a select

MS SQL Syntax (Toggle Plain Text)
  1. INSERT INTO Out(recipient, Text)
  2. SELECT recipient, Text FROM Schedule WHERE TimeToSend = curdate();

i would suggest timetosend be <= curdate(), you'll never get a match exactly on times most likely unless you are going by date only
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 22nd, 2008
0

Re: Transfer of data

Hi, Thanks fo rthe reply right now I odnt have nay problem with my statements..

yes u r right mysql.event is available for 5.1.6 or gretaer than that

I wrote a procedure schedule() in that proc i used the "insert into command " ..
when i created an event using

"create event transfer on schedule every 1 second
do call db.schedule();"

it works fine ... but i have a minor probvlem here ..
when my system reboots .. the event doesnt work automatically ..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: SQL database backup
Next Thread in MS SQL Forum Timeline: Joining two tables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC