Ernesto
Ernesto

Reputation: 13

PL/SQL Oracle hintless error

I'm programming a function in a Oracle using the SQL Dveloper IDE. The function works just fine, and when I add this statement:

INSERT INTO bl_transaction   
VALUES(generated_id,'0','0','Y',NOW(),'0',NOW(),'0',CAST(dbms_random.value(100,100000) as integer), tuple.billing_id, tuple.created, sys_guid(), first_invgroup, 'Y', 'N', tuple.guid, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); 

The compiler give me a hintless error:

ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed

I have reviewed every possible type mismatch, number of arguments, etc.

How can I resolve this?

Upvotes: 1

Views: 108

Answers (1)

OMG Ponies
OMG Ponies

Reputation: 332571

NOW() isn't a supported Oracle function to get the current date & time -- SYSDATE is. Try:

INSERT INTO bl_transaction   
VALUES(generated_id,'0','0','Y',SYSDATE,'0',SYSDATE,'0',CAST(dbms_random.value(100,100000) as integer), tuple.billing_id, tuple.created, sys_guid(), first_invgroup, 'Y', 'N', tuple.guid, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); 

But you also have:

  • tuple.created
  • tuple.billing_id

...as values but didn't include where these are coming from.

Third, because you didn't provide a list of the columns being inserted into, we have no way of knowing if your query specifies more or less that the number of columns in the table your attempting to insert into... or an insight into the data types at each position.

Upvotes: 5

Related Questions