Home » Developer & Programmer » Precompilers, OCI & OCCI » Data is wrong for char
Data is wrong for char [message #416073] Thu, 30 July 2009 06:15 Go to next message
suaiko9999
Messages: 2
Registered: July 2009
Junior Member
hi...i have a code as below, when i run the .pc file, i cannot get the account number that i wanted.

	strcpy(connectstr, dbid);
	EXEC SQL CONNECT :connectstr;
	
	int ret=1;
				
EXEC SQL EXECUTE
BEGIN 
SELECT COUNT(1) ACCOUNT_NO
INTO : S_ACCOUNT_NO
FROM account_T
WHERE ACCOUNT_NO = 1000000073;
END;
END-EXEC;

/*-------------- end PL/SQL block -----------------*/
printf("Number\n");
printf("%d\n", sqlstmt.arr, ACCOUNT_NO);

exit(0);
	


any idea on this? thanks alot.
Re: Data is wrong for char [message #416083 is a reply to message #416073] Thu, 30 July 2009 07:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How could we know from what you posted?
Does your code compile?
Are you able to connect?
Is there any 1000000073 account?
Where is defined S_ACCOUNT_NO?
Is there any error?
And so on.

Regards
Michel
Re: Data is wrong for char [message #416085 is a reply to message #416083] Thu, 30 July 2009 07:20 Go to previous messageGo to next message
suaiko9999
Messages: 2
Registered: July 2009
Junior Member
hi sorry...i'm new in Pro*C. the code already compile and basically in my main() i need to retrieve the data for the account number 1000000073 and there's data in the table. There is no error, but basically i got the wrong data. The output results should be 1000000073.
Re: Data is wrong for char [message #416094 is a reply to message #416085] Thu, 30 July 2009 07:47 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
The output results should be 1000000073.

If so you have not the correct query.

Regards
Michel
Previous Topic: How do I loop through a recordset in OCI
Next Topic: passing parameters in a dynamic query
Goto Forum:
  


Current Time: Sun Dec 04 00:15:42 CST 2016

Total time taken to generate the page: 0.21453 seconds