Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying records
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00431007
Message ID:
00431014
Views:
13
Hi!
select phone_number, 74 as location_id ;
  from phone_numbers ;
  where location_id = 26
  into cursor tempcursor nofilter

* in tempcursor you now have all phones of Baltimore, but with location_id for Washington DC
* let copy these data into phone_numbers
select phone_numbers
append from (dbf("tempcursor"))
use in tempcursor
HTH.

>In my phone_number table I have phone numbers and location_id.
>I have about 500 phone numbers with a location_id for Baltimore.
>what i need to do is copy all of the phone numbers for baltimore into the table again except have the location_id match the one for Washington DC.
>So that both cities will have the same phone numbers in the table.
>I can not figure out how to do this.
>I have tried:
>
>insert into phone_numbers
>select phone_number, location_id *but i need to insert washington's id
>from phone_numbers
>where location_id = 26 *baltimore's id
>
>insert into phone_numbers(phone_number, location_id)
>values(phone_number, 74) *can't use a field as a value
>where location_id = 26
>
>i just can't figure out how to do it, any ideas?
>Thanks,
>Ryan
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform