Precompilers and OCI (MOSC)

MOSC Banner

Problem with OCCI bind variables

edited Aug 9, 2010 9:16AM in Precompilers and OCI (MOSC) 9 commentsAnswered
Trying to do a simple query involving a CHAR field with bind variable using OCCI with no success:

      stmt = conn->createStatement ("SELECT state FROM city_tab WHERE city = :1");      -- with CITY declared as CHAR(15);       stmt->setString (1, 'SEATTLE');       ResultSet *rs = stmt->executeQuery();     -- yield no result whereas from SQL tool,       SELECT state FROM city_tab WHERE city = 'SEATTLE';   will give the proper result:- 'WASHINGTON'. Any idea?

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