Home » Developer & Programmer » Precompilers, OCI & OCCI » Issue with Host Variable Usage in Pro*C (10g , Unix)
Issue with Host Variable Usage in Pro*C [message #418278] Thu, 13 August 2009 16:20 Go to next message
saumyab
Messages: 1
Registered: August 2009
Junior Member
I have a program in PRO*C which is done in C++.

So I declare the HOST Variable under the DECLARE section e.g.

EXEC SQL BEGIN DECLARE SECTION;
int daysToCheck;
EXEC SQL BEGIN END SECTION;


Then my code based on the login assigns certain value to it
daysToCheck=5

This query doesnt give me right result in my code

update XYZ set fresh_ind='YES' where creation_time > (sysdate -:daysToCheck)

But If I hardcode the value the query runs properly

update XYZ set fresh_ind='YES' where creation_time > (sysdate -5)

Can you you help as my logic cannot afford to have a hardcoded entry.
Re: Issue with Host Variable Usage in Pro*C [message #418297 is a reply to message #418278] Thu, 13 August 2009 23:35 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Nothing wrong in what you posted.

Regards
Michel
Previous Topic: pro*c problem
Next Topic: Error when updating (-2118)
Goto Forum:
  


Current Time: Sun Dec 04 13:06:59 CST 2016

Total time taken to generate the page: 0.14722 seconds