Precompilers and OCI (MOSC)

MOSC Banner

Error - ORA-01861: literal does not match format string

edited Jun 18, 2015 10:02AM in Precompilers and OCI (MOSC) 7 commentsAnswered

I modified my OCIBindPos test program a bit to execise some cases.

I'm doing a

drop table arraytest;
create table arraytest (field1 varchar2(20), D FLOAT, L LONG, T DATE ,M INTEGER)
;
select * from arraytest;
quit;

and when running the following code on it, I'm getting:

#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <stdio.h>
#include <string.h>
#include <oci.h>
#include <ocidfn.h>

#define BIGBUF 100000

char bigdata[BIGBUF];
void checkerr (OCIError * errhp, sword status);

const char insertSQL[] = "insert into arraytest values ( :1, :2 ,:3, :4,:5)";


char *strColVal[] = { "ABC", "111.1", bigdata, "2009-07-17-16.05.31", "56"};

#define MAXBINDS 5
#define NITERS 1
int
main (int argc, char **argv)
{
  int rc = 0,i;
  int status = 0;
  int rowsProcessed = 0;
  int fd;
  struct _stat fstatus;
  char *sid = NULL;
  char *user = NULL;
  char *pwd = NULL;
  char *table = NULL;
  OCIEnv *pEnv = NULL;
  OCIError *pError = NULL;
  OCISvcCtx *pSvc = NULL;
  OCIStmt *pStmt = NULL;
  //OCIBind *pBind = NULL;
  OCIBind

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center