Re: esql/c
Posted in 1992
Topics: High Availability & Replication, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
}$include sqlca;
}
}$char x[10];
}$char y[15];
}$char z[11];
}
}
}$declare foo_curs cursor for
} select x,y,z
} into $x,$y,$z
} from foo_table
} where "conditions exist"
} order by x,z;
}
}$open foo_curs;
}$fetch foo_curs;
}
}while (sqlca.sqlcode)
}{
} printf("%-10s %-15s %-11s \\n", x,y,z);
} fetch foo_curs;
}}
}$close foo_curs;
I believe that what you need to do is to have the ``into $x,$y,$z'' clause
on the fetch statement, not the declare statement. This would give you:
$declare foo_curs cursor for
select x, y, z
from foo_table
where "conditions exist"
order by x, z;
$open foo_curs;
$fetch foo_curs into $x, $y, $z;
Hope this helps,
jeffl
----
Jeffrey F. Lawhorn American TriTech/ISG
Programming Manager C, C++, and Database Consulting
jeffl@isg.com 450 B Street 16th Floor
sdsu!isg100!jeffl San Diego, CA 92101 (619) 234-3405 x274