Home » Developer & Programmer » Precompilers, OCI & OCCI » [ORA-01480] Error while assigning value to a variable
[ORA-01480] Error while assigning value to a variable [message #350047] Tue, 23 September 2008 23:04 Go to next message
prashas_d
Messages: 66
Registered: February 2007
Member
Hi All,

I am writing a code in Proc as

<code>
#define SMSDUN_LANGID_LEN 10

-- other statements
EXEC SQL BEGIN DECLARE SECTION
char dbLanguageId[SMSDUN_LANGID_LEN + 1];
EXEC SQL END DECLARE SECTION

-- other statements

EXEC SQL EXECUTE
BEGIN

SELECT LANGUAGE_ID -- Length of this column is 10
INTO :dbLanguageId
FROM CUSTOMERATTRIBUTES
WHERE CUSTOMER_REF = :dbCustomerRef
AND ROWNUM < 2 ;

END;
END-EXEC;
</code>

While executing the above command, it is giving error as "ORA-01480: trailing null missing from STR bind value".

Its working in some oracle versions but not in other.

Can someone please let me know where exactly the problem is.

Thanks in advance,
prashas_d.
Re: [ORA-01480] Error while assigning value to a variable [message #350060 is a reply to message #350047] Wed, 24 September 2008 00:00 Go to previous message
sabbir_ru
Messages: 6
Registered: August 2008
Junior Member
Terminate the string with a null character.

[Updated on: Wed, 24 September 2008 00:02]

Report message to a moderator

Previous Topic: OCCI Compilation Error
Next Topic: Problems with calling Package variables
Goto Forum:
  


Current Time: Sat Dec 03 14:00:41 CST 2016

Total time taken to generate the page: 0.07069 seconds