Re: OCI UPDATE QUERY

From: Alex <azp74_at_hotmail.com>
Date: 13 Jun 2002 00:52:33 -0700
Message-ID: <dca1064b.0206122352.60be9e2f_at_posting.google.com>


Hi everyone

I should have said I had already tried this and I couldn't get it to work - Oracle didn't like the placeholders having different names from the variables (ORA-01036) - which is weird because I believe that you could use different names in Oracle7 ...

I've got around the problem by using OCIBindByPos and just having a counter which keeps track of which column I'm on ... not quite as elegant perhaps but does the trick!

Alex
PS - Al - I've put a response to your OCISample query.

> Hi Alex,
>
> I would use different names for the placeholders, like this
>
> OCIStmtPrepare(stmtHandle, errorHandle, stmt,
> (ub4)strlen((char*)"update table1 set sec = :sec_new where sec = :sec_old"),
> OCI_NTV_SYNTAX, OCI_DEFAULT);
>
> OCIBindByName(stmtHandle, &bindHandle, errorHandle,
> (text*)":sec_new", -1, &input2, (sword)sizeof(input2), SQLT_INT, 0, 0, 0,
> 0, 0, OCI_DEFAULT);
>
> OCIBindByName(stmtHandle, &bindHandle, errorHandle,
> (text*)":sec_old", -1, &input3, (sword)sizeof(input3), SQLT_INT, 0, 0, 0,
> 0, 0, OCI_DEFAULT);
>
> Hope it helps.
> I posted a question named OCI Sample yesterday. Please have a look at it.
>
> Al
Received on Thu Jun 13 2002 - 09:52:33 CEST

Original text of this message