user1410331
user1410331

Reputation:

ORA-00936: missing expression

Can you help me know what maybe the error in my sql?ORA-00936: I'm having missing expressionerror but I cannot find the error.

CREATE TYPE T_ordRef AS OBJECT (
   Ordi REF T_Ordinateur
);
CREATE TYPE T_ordRefs AS TABLE OF REF T_ordRef ;

INSERT INTO THE (SELECT INSTALLESUR FROM LOGICIEL WHERE NUMERO='1')
VALUES (T_ORDREFS( T_ORDREF(SELECT REF(v) 
FROM ORDINATEUR v WHERE v.NUMSERIE='1') ));

Error:

Erreur à la ligne de commande : 81, colonne : 34 Rapport d'erreur : Erreur SQL : ORA-00936: missing expression 00936. 00000 - "missing expression" *Cause:
*Action:

Upvotes: 0

Views: 2674

Answers (1)

Daniel Hilgarth
Daniel Hilgarth

Reputation: 174299

You are missing a / after the lines that create the types:

CREATE TYPE T_ordRef AS OBJECT ( Ordi REF T_Ordinateur );
/  -- important!

CREATE TYPE T_ordRefs AS TABLE OF REF T_ordRef ;
/  -- important!

Additionally, your insert into is completely wrong, as you are not allowed to have a select in the part that is reserved for the column names.
Unfortunately, I can't correct it, because I don't even understand what it is supposed to do.

Upvotes: 2

Related Questions