General information
Category:
Coding, syntax & commands
>>I have 2 tables, one parent and one child, a one to many relationship
>>
>>parent is having - code and description fields
>>child is having - code, date & quantity fields
>>
>>i'm issuing this command
>>
>>sele parent.code, parent.description, child.date, child.quantity from parent, child where parent.code=child.code to file myfile
>>
>>& it gives me a output in a text file, where each and every parent field is repeated, in front of its child record...
>>
>>is there a way i can get parent field once and below that child records...(i don't want the repetition of parent fields and output should be transfered to txt file.)
>>
>>
>>any help will be highly appreciated, (i don't want to use the report designer only with help of sql or any other command).
>>
>>thanks in advance...
>
>You can generate text file using low-level functions
>nHnd=fcreate("output.txt")
>select parent
>scan
> =fputs(nHnd,parent.code+parent.description) && you should handle data types
> select child
> scan for child.code=parent.code
> =fputs(nHnd,child.date+child.quantity) && you could separate fields
> endscan
>endscan
Mr Edward, thanks for you reply and routine, but Is there any way I can use select only & get the desired output ??, Don't you think scan...endscan,fcreate etc. will be very slow..
Pls advs.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only