I have an if statement with two SQL types that I am comparing with each other
The statement....
if (rowCount3 >= chval1)
rowCount3 is an SQLINTEGER
chval1 is an SQLCHAR chval1[128]
I tried if ((SQLCHAR)rowCount3 >+ (SQLCHAR)chval1)
It works some of the time...I need it to work all of the time. Someone suggested strcmp but I am clueless even after googling, any help is appreciated. Thank you.
PS I think I have to convert chval1 into an integer. How can I do that?
You have declared chval1 as a 128 byte array of chars, and so the symbol chval1 by the syntactic rules of C and C++ resolves to a character pointer to the base address of the memory allocation, not to any specific single byte character entity. If you want to specify some specific char, use chval1[whatever].