Question : Migrating Informix ESQLC to Oracle Pro*C - Informix Proprietary Functions...

Hi, Currently tasked with migrating Informix ESQLC files to Oracle Pro*C and have a few questions. First, we use a lot of proprietary Informix functions within our embedded ESQLC code such as:

rstrdate( ), rtoday( ), rjulmdy( ), etc.

Any pointers on how to convert these in Oracle Pro*C?

Another thing I'm struggling with understanding is the Oracle date datatype. In Informix, we use type long in our embedded sql C code for any host variables dealing with dates for the Informix tables.

But in Oracle, I'm under the impression that dates aren't communicated back and forth as long, but as char? Or can we still specify host variables as type long?

Advice appreciated,
Thank you
Karen

Answer : Migrating Informix ESQLC to Oracle Pro*C - Informix Proprietary Functions...

you'll have to write them yourself.  There's aren't corresponding pro*c versions of those.

if you are using long, I'm assuming your dates are just "day" level resolution.
Oracle dates always have a time component as well.

If you store your dates as numbers, you should be able to pass the numeric value in pro*c just as you would in esqlc

in pro*c it is common practice to pass dates by converting them to strings so you can pass the date and time component  something like this...

void print_current_db_datetime()
{
   char my_date_str char[20] = "";

   exec sql select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') into :my_date_str from dual;

   printf(my_date_str);
}





Random Solutions  
 
programming4us programming4us