Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > Question regarding bcp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-08, 10:41
neerajrathi2 neerajrathi2 is offline
Registered User
 
Join Date: Sep 2007
Posts: 6
Question regarding bcp

Hello,
We use bcp to populate data in tables. Tables have partition for each week.
Problem is sometime by error we get Future's data. So while bcp throws error
that
"one or more Rows do not belong to any partitions" and then it aborts bcp
command.
because of none of records in file get loaded.

My question is there any way to stop this so that bcp will ignore that record
but process other records.
I tired -m option of bcp but got same result.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 07-09-08, 13:19
mike_bike_kite mike_bike_kite is online now
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
Could you create a transfer table that has the same fields as the main table but no partitioning. Then BCP into this new table rather than the existing table. Then select the good data out from the transfer table and insert it into your existing table. Obviously you’d want to report any bad data and you’d want to clear the transfer table before BCP’ing into it each time.

How much data do you hold? Is the partitioning by date necessary? - I thought the aim of partitioning would be to split queries across multiple partitions but all your data access would still be on the one partition assuming people are mostly interested in the latest data.

EDIT: I assume you're on Sybase ASE 15 where it allows you to split partitions by value - I haven't used this before so take this with a pinch of salt - just add an extra partition that takes the data outside your current range i.e.
Code:
date < current_min on my_new_segment date > current_max on my_new_segment
As I say I can't find much info on partitioning by value. I assume there isn't a syntax like "else on my_new_segment" that you could add at the end. It seems odd they wouldn't provide for that.

Mike

Last edited by mike_bike_kite : 07-09-08 at 15:18. Reason: new thought :)
Reply With Quote
  #3 (permalink)  
Old 07-10-08, 04:19
neerajrathi2 neerajrathi2 is offline
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks Mike for your Help.

Actually changing partition and other system leve details is not in my hand. Its just that our DBA has designed database and we have to use it.

My program collects data and fires bcp.Many times it gets error like some conversion has failed or data got rejected because of duplicate key(we have uniq key indexes built on all tables.). But in all of these case it ignores faulty record and load other records in file. It never happened that entire file got rejected because of single bad record in file.

I was just looking for some way to stop this happning in future.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On