If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Help needed with PLSQL script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-12, 07:30
Divian Divian is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
Red face Help needed with PLSQL script

When importing info I get two separate sets of data. One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees. The one thing thats constant is their id no's.

I need to cleanup the data using a plsql script to join everything from the one table with the other and then deleting the redundant info.

eg.
PERID | MINID|MINEMP | MAXID|MAXEMP
---------------|----------|----------|----------|---------
8105105584089 | 585|8970006 | 6825|08970006
8709270203084 | 594|8960063 | 6834|08960063
8704150399086 | 599|8947065 | 6839|08947065
Reply With Quote
  #2 (permalink)  
Old 01-13-12, 11:39
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
Quote:
When importing info I get two separate sets of data
OK.

Quote:
One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees.
This month: there are "o" (a letter "o") in these data
Next month: there are "0" (number zero) in these data

How do they make duplicates? I presume that "this month's o" is, actually, "this month's zero", right?

Quote:
The one thing thats constant is their id no's.
If you say so.

Quote:
Your eg. table
I don't see relation between this table and "sample" data you posted.

You never mentioned PERID; what are MINID and MINEMP and MAXID and MAXEMP doing here? What do these MIN and MAX mean? I see that MAXEMP = '0' || MINEMP. That would probably be "this month" vs. "next month".

If that sample table is what you currently have, what would you want to get as a result? Someone smarter than me will probably know what to do, but I don't. Perhaps, if you could provide test case (which includes CREATE TABLE and INSERT INTO several sample records that represent your current situation, as well as required output) it would be easier to assist.
Reply With Quote
  #3 (permalink)  
Old 01-17-12, 02:13
Divian Divian is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
plsql

Thanks for the feedback. Let me try and explain in differently. The data I have has got zero's in the employee no on certain months and no zero's the other.
Although its the same client because the id no and the other details stays the same the application sees it as two due to the employee no as a user is created on employee no's. The perid is the personal id the max and min id's and emp is the different rowids and employee numbers I get when running a select statement based on personal id's. I need a way to add the maxid to the minid per client and delete the maxid which will be the one with the zero's.

Hope this will help.
Reply With Quote
  #4 (permalink)  
Old 01-17-12, 09:43
cis_groupie cis_groupie is offline
Registered User
 
Join Date: Jun 2004
Posts: 597
Quote:
One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees. The one thing thats constant is their id no's.
Are you saying that there is one id no per employee? In which case, why are you bothering with emp no? (Or is 'id no' & 'employee no' the same thing?).

Either way, I'm confused, and I suspect many others are & will remain so until you provide the info requested by Littlefoot.
__________________
90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.
Reply With Quote
Reply

Tags
littlefoot

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On