Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Runtime Segmentation fault - core dumped

449438Aug 26 2005 — edited Sep 1 2005
Hi,

When I compiled my Pro C and C source code, it didnt give me any error. And when I run the program it come out

Segmentation fault -core dumped \

Can anyone help me to see what's the problem and how do I solve?

Here's the codings:-

....
/* Declare a host structure tag. */
struct
{
char orderid[LENGTH40];
char orderlogdate[LENGTH20];
char businessunit[LENGTH10];
} order_rec;

struct
{
short orderid_ind;
short orderlogdate_ind;
short businessunit_ind;
} order_rec_ind;
....

int main()
{
....

EXEC SQL DECLARE c1 CURSOR FOR
SELECT orderid, orderlogdate, businessunit FROM pfp_order;

EXEC SQL OPEN c1;

* Initialize the number of rows. */
num_ret = 0;

* Array fetch loop - ends when NOT FOUND becomes true. */
EXEC SQL WHENEVER NOT FOUND DO break;

for (;;)
{
EXEC SQL FETCH c1 INTO :order_rec:order_rec_ind;

* Print however many rows were returned. */
print_rows(sqlca.sqlerrd[2] - num_ret);
num_ret = sqlca.sqlerrd[2]; /* Reset the number. */
}
....


Thank you.

Regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2005
Added on Aug 26 2005
12 comments
1,623 views