Re: from Oracle ProC to ESQL/C
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Agostino Brunamontini wrote: > > Hi, > > I'm converting some Oracle ProC programs to ESQL/C. > (I'm using OnLine and ESQL/C 7.1) > > c1 and c2 are two fields of type datetime year to second. > > The following are two ProC statements: > > 1. stmt="select * from table where \\ > c1 = to_date(?, 'dd-mm-yy') and \\ > c2 = to_date(?, 'hh:mm:ss')" > prepare sel_stmt from stmt > > 2. stmt="insert into table (c1,c2) values \\ > (to_date(?, 'dd-mm-yy'), to_date(?, 'hh:mm:ss'))" > prepare ins_stmt from stmt > > Is there anything similar in ESQL/C? > > Is there any particular "problem/s" in migrating ProC to ESQL/C? > > Please e-mail to me. > > Thank you very much. > > Agostino Brunamontini > Telecom. Rome. > e-mail: abrunamo@aconet.it Ciao Agostino, I've both been working with Oracle and Informix. Functions like 'to_date' and 'to_char' and others are not available in the Informix-SQL 'slang'. You'll first have to convert character-string dates and load them into datetime host-variables before you can use them in SQL statements. For these conversions, you can use ESQL/C functions like: dtcvasc or dtcvfmtasc (See chapter 6 of ESQL/C programmer's Manual) Good Luck and arriverderci Hal VandenAssem