Home » Developer & Programmer » Precompilers, OCI & OCCI » Write to file using Pro*C
Write to file using Pro*C [message #94368] Wed, 08 September 2004 09:56 Go to next message
Messages: 503
Registered: July 2000
Senior Member
I have a procedure that would retrieve some table info based on which computes the sum of transactions for different types of transactions. I want to prepare a summary transaction report that would give the total transactions for each transaction type. Can someone sugest a pro*C proram to perform this task. I'd like to format the report using pro*C. I've never done a pro*C before and would like to take your help in this regards.

Thanks in advance
Re: Write to file using Pro*C [message #94369 is a reply to message #94368] Thu, 09 September 2004 00:26 Go to previous messageGo to next message
Kaustubh Deshpande
Messages: 32
Registered: March 2004

For writing to a file from pro*c, you can declare pointer of FILE type, associate it with file on disk and then using "fprintf" , you can write all the statements into that file. formatting will be done same as you do in printf using %d, %11s ... like that.

Re: Write to file using Pro*C [message #94576 is a reply to message #94368] Thu, 17 February 2005 05:00 Go to previous messageGo to next message
Messages: 15
Registered: February 2002
Junior Member
i need a c program to check whether a given substring is present in the main string? i need your help as soon as possible.
Re: Write to file using Pro*C [message #110311 is a reply to message #94368] Sat, 05 March 2005 09:48 Go to previous message
Messages: 5
Registered: March 2005
Junior Member
Hi Sandhya

Please use the standard string library function

this is relevant information found for my
linux box C compiler library

- Function: char * strstr (const char *HAYSTACK, const char *NEEDLE)
This is like `strchr', except that it searches HAYSTACK for a
substring NEEDLE rather than just a single character. It returns
a pointer into the string HAYSTACK that is the first character of
the substring, or a null pointer if no match was found. If NEEDLE
is an empty string, the function returns HAYSTACK.

For example,
strstr ("hello, world", "l")
=> "llo, world"
strstr ("hello, world", "wo")
=> "world"

Best Regards
Amit Joshi
Previous Topic: How to connect to oracle using 'C'
Next Topic: linkage error
Goto Forum:

Current Time: Sun Aug 09 04:22:48 CDT 2020