cancel
Showing results for 
Search instead for 
Did you mean: 

Not enough values error

Former Member
0 Kudos

I am trying to create a procedure in HANA where the user enters in data and a table of mine is populated with the data, but I am getting a not enough values error. I am sure that the table has 18 columns and I am entering in 18 columns accordingly so I don't know why I am getting this error.

I was wondering if anyone knew why this was happening?

The script looks like this:

CREATE PROCEDURE "NIEM_CORE"."SP_ADDINCIDENT"

      (IN ACTIVITYTYPEID INTEGER, IN ACTIVITYDATE TIMESTAMP,

      IN ACTIVITYDESCRIPTIONTEXT VARCHAR, IN ACTIVITYSTATUS VARCHAR, IN ACTIVITYREASONTEXT VARCHAR)

      LANGUAGE SQLSCRIPT AS

BEGIN INSERT

INTO "NIEM_CORE"."ACTIVITYTYPE" VALUES

      (NIEM_CORE.SEQ_ACTIVITYTYPEID.NEXTVAL,'N/A’, ‘N/A', 'N/A’, ‘N/A'

      :ACTIVITYDATE, 'N/A', :ACTIVITYDESCRIPTIONTEXT, 'N/A', :ACTIVITYSTATUS, :ACTIVITYREASONTEXT,

      'NULL', 'NULL', 'NULL', 'NULL', 'EN',NOW(),'SUP');

     

END;

The table I'm trying to add to looks like this:

CREATE COLUMN TABLE "NIEM_CORE"."ACTIVITYTYPE"(

"ACTIVITYTYPEID" INTEGER NULL,

"ACTIVITYIDENTIFICATION" VARCHAR (40) NULL,

"IDENTIFICATIONTYPE" VARCHAR (40) NULL,

"ACTIVITYCATEGORYTEXT" VARCHAR (40) NULL,

"ACTIVITYDATEREPRESENTATION" TIMESTAMP NULL,

"ACTIVITYDATE" TIMESTAMP NULL,

"ACTIVITYDATERANGE" TIMESTAMP NULL,

"ACTIVITYDESCRIPTIONTEXT" VARCHAR (160) NULL,

"ACTIVITYNAME" VARCHAR (40) NULL,

"ACTIVITYSTATUS" VARCHAR (40) NULL,

"ACTIVITYREASONTEXT" VARCHAR (40) NULL,

"ACTIVITYDISPOSITION" VARCHAR (40) NULL,

"DISPOSITIONTYPE" VARCHAR (40) NULL,

"CASEDISPOSITION" VARCHAR (40) NULL,

"CASEDISPOSITIONTYPE" VARCHAR (40) NULL,

"LANGUAGECODE" VARCHAR (2) NULL,

"LASTMODIFIED" TIMESTAMP NULL,

"UPDATESOURCE" VARCHAR (40) NULL);

Accepted Solutions (1)

Accepted Solutions (1)

former_member184768
Active Contributor
0 Kudos

Hi Connor,

I am not sure if this is a formatting error in the post here or it is exactly what has been typed in your insert statement.

But if you look into the values below, you will find that the single quote after first N/A and at the beginning of second N/A is not a single quote which HANA would recognize. It will treat is as a char value.

'N/A’, ‘N/A', 'N/A’, ‘N/A'

hence your value for a single column will be N/A’, ‘N/A.

Likewise for the second pair of N/A, N/A values. Can you please change the single quote from to ' and also for to ' and try it.

Best way to copy the code to a simple text editor like Notepad which removes all the fancy characters and then use it.

Also as a good practice, it is advisable to use syntax like insert into table (col1, col2 .... ) values (va1, val2 ...). That helps in identifying for which column the values are incorrect.

Regards,

Ravi

Former Member
0 Kudos

Thank you, that was it!

Answers (0)