473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Repeat of row parameter

My data are like this:

catalog no. Deptcode Respcode Projections
02397360101 34 346103 12
------do---------- 33 336001 1
------do---------- 36 366001 4
------do---------- 31 316001 7

02173212532 35 356103 8
------do---------- 34 346001 8
------do---------- 36 366001 5
------do---------- 32 326001 6

It should be arranged like this:

Cat no. Dept code Resp code projections

02397360101 34 346103 12
02397360101 33 336001 1
02397360101 36 366001 4
02397360101 31 316001 7

02173212532 35 356103 8
02173212532 34 346001 8

……And so on

How to repeat the cat no. in all rows till the begining of data of next cat no.? please suggest.
Sep 10 '11 #1
3 1332
Stewart Ross
2,545 Expert Mod 2GB
If the field values marked '------do----------' are real values of some kind (not just some sort of shorthand you used for the purposes of posting example data) then your data is completely unnormalised and not suitable for processing via a relational database. It looks like something that may have come from a manually-entered spreadsheet, with all the attendant problems that manual data entry will bring.

Although it is possible to process the data record by record using recordset processing to replace the '------do----------' values with the last known catalogue number, I could not as it stands recommend any form of processing being applied to the data as you have shown it (if I am interpreting your question correctly).

I would instead advise you to go back to the source of the data and see whether you can get hold of it without the data loss represented by the substitution of '------do----------' for the catalogue number.

-Stewart
Sep 10 '11 #2
Dear Stewart,

field below the cat no. are empty field i use --do-- for posting example data as you have rightly mentioned it. actually these data base is of projections given by different users department with different responsibility code. so, for a cat no. many users department can give their projections.
I hope this will clarify further i you will be able to solve the problem.
-csrathore
Sep 12 '11 #3
NeoPa
32,556 Expert Mod 16PB
Bearing in mind that data stored in any RDBMS is not held in the order it was entered unless specifically programmed to do so, how do you think it's possible, from the information you've given, to determine which value of [Catalog No] to use for any specific record? By completely leaving out any explanation of how you want the logic to determine this, you have implied that you want it done in that way which is not possible.

So, unless you include the whole question in your question, we are in no position to suggest any solution.
Sep 12 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

49
by: Mark Hahn | last post by:
As we are addressing the "warts" in Python to be fixed in Prothon, we have come upon the mutable default parameter problem. For those unfamiliar with the problem, it can be seen in this Prothon...
6
by: Lewis Veale | last post by:
I have an Access 2000 front-end pointing at a SQL Server backend, with around 80 linked tables and views. I frequently need to point the front-end at different versions of the back-end, and achieve...
3
by: Douwe | last post by:
I try to build my own version of printf which just passes all arguments to the original printf. As long as I keep it with the single argument version everything is fine. But their is also a version...
0
by: Simon Gare | last post by:
Hi, I need to calculate a total based on fields in a repeat region, these values are stored in an SQL db, all are numeric and written in ASP. fields are TOTAL_COST VAT ...
9
by: sashang | last post by:
Hi I'd like to use metaclasses to dynamically generate a class based on a parameter to the objects init function. For example: class MetaThing(type): def __init__(cls, name, bases, dict,...
8
by: ml1n | last post by:
Hi, I'm not really sure how to explain this so maybe some example code is best. This code makes a list of objects by taking a list of ints and combining them with a constant: class foo: def...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 This the ObjectDataSource in my UserControl, <asp:ObjectDataSource ID="odsMessage" runat="server" SelectMethod="ExecuteMessage" TypeName="AH.MyNetwork.BLL.Network.Message">...
4
by: roundcrisis | last post by:
Hi there: I m trying to do something (check values) if one of the parameter in a procedure is used, for example let say I have the following procedures: index(int a, string specialParam,...
7
by: =?ISO-8859-2?Q?Gregor_Kova=E8?= | last post by:
Hi! Is it possible to use parameter markers like this: 1.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%?%' If I now set parameter 1 to '' (empty string) I don't get any rows back, but if I run:...
21
by: Martin Geisler | last post by:
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkjlQNwACgkQ6nfwy35F3Tj8ywCgox+XdmeDTAKdN9Q8KZAvfNe4 0/4AmwZGClr8zmonPAFnFsAOtHn4JhfY =hTwE -----END PGP...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.