Re: Connector/C++ v 8 and binding parameters
Posted by:
Luis Silva
Date: January 25, 2020 05:04AM
Hi Walter,
For binding, you need to do it using prepared statements:
For :
create table newtable(f0 int, f1 varchar(1024));
insert into newtable VALUES(1,"1");
insert into newtable VALUES(2,"2");
insert into newtable VALUES(3,"3");
Code:
sql::PreparedStatement *pstmt = conn->prepareStatement("select f1 from newtable where f0 > ? ");
//Bind position (starts in 1)
pstmt->setInt(1, 1);
sql::ResultSet *res = pstmt->executeQuery();
Hope it helps!
Cheers,
Luís
Subject
Views
Written By
Posted
644
January 24, 2020 12:02PM
Re: Connector/C++ v 8 and binding parameters
332
January 25, 2020 05:04AM
334
January 25, 2020 05:37AM
330
January 27, 2020 01:05AM
284
January 28, 2020 06:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.