ORA-01480 Error

Today I received the error ora 1480, as described below, it occurs when we run a batch process type;


berlin:/sw/oracle12c=> oerr ora 1480
01480, 00000, “trailing null missing from STR bind value”
// *Cause: A bind variable of type 5 (null-terminated string) does
// not contain the terminating null in its buffer.
// *Action: Terminate the string with a null character


The process in question is a pro*c program. The process is new, or rather is a new version of one that already existed, actually it has included new features, but some of them have introduced a bug which is what makes raised this error.

Specifically in pro*c there is a known bug in which to assign values ​​to strings of type char must include the NULL , has nothing to do with NULL used in databases, represented by lowercase omega. Specifying the same with \n or , the only thing it does is say that the chain ends, the process gets so has the array of characters, if they are 10 by definition I would take those 10, although the data is HELLO, the remaining positions from 5 to 9 (in c start counting at zero) gets it has the following memory locations normally be trash or other data streams.

An example of how you can specify is as show below;


 #include <stdio.h>
#include <string.h>

int main()
   char my_bind_1 [40];
   char my_bind_2 [100];
   /*** Method I ***/
   /* Set my bind variables to null, in this case we use \0 */
   memset(my_bind_2, '\0', sizeof(my_bind_2));
   memset(my_bind_1, '\0', sizeof(my_bind_1));
   strcpy(my_bind_1, "hello");
   strcpy(my_bind_2, my_bind_1);

   /*** Method II ***/
   /* In this case we use \n */
   strcpy (my_bind_1, "hello\n");




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s