Oracle PL/SQL ORA-00947 Not Enough Values Error ¿À¶óŬÀº PL / SQL ¿À¶ó - 00947 ÃæºÐÇÏÁö ¾ÊÀº °ª ¿À·ù
In Oracle database, the following error message may appear when an incorrect SQL statement is used, in SQL Plus or in anywhere that send SQL queries to the databases such as stored procedure or external programs. Oracle µ¥ÀÌÅͺ£À̽º¿¡¼´Â ´ÙÀ½°ú °°Àº ¿À·ù ¸Þ½ÃÁö°¡ ³ªÅ¸³¯ ¼öÀÖ½À´Ï´Ù À߸øµÈ SQL ¹®À» »ç¿ëÇÏ´Â °æ¿ì SQL Ç÷¯½º¿¡¼ ¶Ç´Â ¾îµð¿¡¼ ±× µ¥ÀÌÅͺ£À̽º¿¡ ÀúÀå ÇÁ·Î ½ÃÀú ¶Ç´Â ¿ÜºÎ ÇÁ·Î±×·¥°ú °°Àº SQL Äõ¸®¸¦ º¸³¾ ¼öÀÖ½À´Ï´Ù.
PL/SQL: SQL Statement ignored Àº PL / SQL : SQL ¹® ¹«½Ã
PL/SQL: ORA-00947: not enough values Àº PL / SQL : ORA - 00947 : ÃæºÐÇÏÁö °ª
The reason for ORA-00947 error is when a SQL statement requires two sets of value, ie number of number of columns and its value that are specified in the SQL to be equal in number. ORA - 00947 ¿¡·¯¿¡ ´ëÇÑ ÀÌÀ¯´Â ±× ¶§ SQL ¹®À» °¡Ä¡ÀÇ SQL¿¡ ÁöÁ¤µÈ ¹øÈ£¿¡ µ¿µîÇØÁú µÎ ¼¼Æ®¸¦ ¿ ¹× °¡Ä¡ÀÇ °³¼ö, Áï ¹øÈ£¸¦ ÇÊ¿ä·ÎÇÑ´Ù´Â °ÍÀÔ´Ï´Ù. But the second part of the query which is column values contains fewer items than the first part which is the number of columns. ÇÏÁö¸¸ ¿ÀÇ °ªÀº Äõ¸®ÀÇ µÎ ¹øÂ° ºÎºÐÀº ¿À»ÀÇ ÀüÈ ¹øÈ£´Â ù ºÎºÐº¸´Ù ÀûÀº Ç׸ñÀÌ Æ÷ÇԵǾîÀÖ½À´Ï´Ù. The error may happens in all kind of SQL statements - Insert, Update or Select - and it can also occur in a WHERE or HAVING clause in which a nested sub-SELECT returns too few columns. ¼öµµ SQL ¹®À»¿¡¼ ÀϾ´Â ¸ðµç Á¾·ùÀÇ ¿À·ù - »ðÀÔ, ¾÷µ¥ÀÌÆ® ¶Ç´Â ¼±Åà - ±×°Íµµ ¾îµð°Å³ªÇÏ´Â µ¥ Á¶Ç׿¡¼ ¹ß»ýÇÒ ¼öÀÖ´Â ÁßøµÈ ÇÏÀ§ - ¼±Åõµ ¸î ¿À» ¹ÝȯÇÕ´Ï´Ù. If the SQL does not specify columns, it means that the values entered are less that the columns existed in the table in database. °æ¿ì´Â SQL ¿À» ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é, ±× °ªÀ» ÀÔ·Â ¿À» ´ú µ¥ÀÌÅͺ£À̽º¿¡¼ Å×ÀÌºí¿¡ Á¸ÀçÇÏ´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù.
For example, the ORA-00947 error will be returned if you try to execute the following SQL statements: ´ÙÀ½ SQL ¹®À» ½ÇÇàÇÏ·Á°íÇÏ¸é ¿¹¸¦ µé¾î, ORA - 00947 ¿À·ù°¡ ¹ÝȯµË´Ï´Ù :
INSERT INTO Customers (Customer_ID, Customer_Name, Birthday) VALUES (¡¯1¡Ç, ¡®My Customer¡¯); ('1 ','³» °í°´ ') (Customer_ID, Customer_Name, »ýÀÏ) °ªÀ¸·Î °í°´À» »ðÀÔ;
or ¶Ç´Â
SELECT * FROM Customers WHERE (Customer_ID, Customer_Name) IN (SELECT Customer_ID FROM Orders); * ¼Õ´ÔÀº ¾îµð¿¡ (Customer_ID, Customer_Name) (¼±Åà ÁÖ¹® Customer_ID¿¡¼) ¼±ÅÃ;
To solve the error and correct the problem, check that the number of values provided in the column values part is equal that the columns specified, or the number of columns in table, and change the SQL statement to make them equal. ¿À·ù¸¦ ÇØ°áÇÏ·Á¸é ¹®Á¦°¡ ÇØ°áµÇ¾ú´ÂÁö È®ÀÎ °ªÀº ¿ °ªÀ» ºÎºÐ¿¡ Á¦°øµÈÀÇ ¼ýÀÚ ¿, ¶Ç´Â Å×ÀÌºí¿¡ÀÖ´Â Ä÷³ÀÇ ¼ö¸¦ ÁöÁ¤ÇÏ°í ±×µéÀ» µ¿µîÇÏ°Ô SQL ¹®À» º¯°æ ÆòµîÀÌ´Ù.
You can either reduce the number of columns, or increase the number of values provided to the column to make the SQL statement equaled. ´ç½Åµµ Ä÷³ÀÇ ¼ýÀÚ¸¦ ÁÙÀÏ ¼öÀÖ½À´Ï´ÙÀ̳ª °ªÀº Ä÷³ Á¦°øÀÇ ¼ö¸¦ Áõ°¡ÇÏ°Ô SQL ¹®À» È®ÀÎÇÕ´Ï´Ù. This applies to the nested SQL statements with HAVING or WHERE clause too. ¶Ç´Â ³Ê¹« Á¶Ç×ÀÌ °®´Â ÁßøµÈ SQL ¹®À»¿¡ Àû¿ëµË´Ï´Ù. For example, the correct SQL statements should be like the following: ¿¹¸¦ µé¾î, ¿Ã¹Ù¸¥ SQL ¹®À» ´ÙÀ½°ú °°ÀÌÇØ¾ßÇÑ´Ù :
INSERT INTO Customers (Customer_ID, Customer_Name, Birthday) VALUES (¡¯1¡Ç, ¡®My Customer¡¯, ¡®08/08/1988¡Ç); (Customer_ID, Customer_Name, »ýÀÏ) °ªÀ¸·Î °í°´À» »ðÀÔ ('1 ','³» °í°´ ', '08 / 1,988ºÐÀÇ 08');
or ¶Ç´Â
INSERT INTO Customers (Customer_ID, Customer_Name) VALUES (¡¯1¡Ç, ¡®My Customer¡¯); ('1 ','³» °í°´ ') (Customer_ID, Customer_Name) °ªÀ¸·Î °í°´À» »ðÀÔ;
or ¶Ç´Â
SELECT * FROM Customers WHERE (Customer_ID, Customer_Name) IN (SELECT Customer_ID, Customer_Name FROM Orders); * °í°´À¸·ÎºÎÅÍ ¼±Åà (Customer_ID, Customer_Name) (¼±Åà Customer_ID, Customer_Name¿¡¼ ÁÖ¹®);
or ¶Ç´Â
SELECT * FROM Customers WHERE (Customer_ID) IN (SELECT Customer_ID FROM Orders); * °í°´¿¡¼ ¼±Åà () (¼±Åà Customer_ID¿¡¼ ÁÖ¹®)¿¡ Customer_ID;
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. Áß¿ä :ÀÌ ±â°è´Â "º¸Áõµµ¾øÀÌÀÖ´Â ±×´ë·Î"Á¦°øµË´Ï´Ù ÆäÀÌÁö¸¦ ¹ø¿ªÇß´Ù. Machine translation may be difficult to understand. ±â°è ¹ø¿ªÀ» ÀÌÇØÇϱ⠾î·Á¿ï ¼öÀÖ½À´Ï´Ù. Please refer to À» ÂüÁ¶ÇϽñ⠹ٶø´Ï´Ù original English article ¿ø·¡ ¿µ¾î ¹®¼ whenever possible. ¾ðÁ¦µç °¡´ÉÇÕ´Ï´Ù.
Share and contribute or get technical support and help at °øÀ¯¿Í ±â¿©Çϰųª ±â¼ú Áö¿ø°ú¿¡ µµ¿òÀÌ My Digital Life Forums ³» µðÁöÅÐ »ýȰ Æ÷·³ .
Related Articles °ü·Ã ±â»ç
- Oracle Database Import Error 3113/3114 Oracle µ¥ÀÌÅͺ£À̽º °¡Á®¿À±â ¿À·ù 3,114ºÐÀÇ 3,113
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error , ¶Ç´Â ¿À¶óŬ µ¥ÀÌÅͺ£À̽º ÆÄƼ¼Ç ºÐÇÒ Ãß°¡ ¸¸µé±â ORA - 14080 ¿À·ù¿Í ÇÔ²² ½ÇÆÐ
- How to Escape Characters in Oracle PL/SQL Queries ¾î¶»°Ô ¿À¶óŬÀº PL / SQL Äõ¸®¿¡ µîÀåÇÏ´Â Àι°À» Å»ÃâÇÏ´Â
- Manual and Clean Uninstall Oracle for Windows ¸Å´º¾ó ¹× û¼Ò¸¦ Á¦°Å Windows ¿ë ¿À¶óŬ
- ORA-00942 Table or View Does Not Exist Oracle Error ¿À¶ó - 00942 Å×À̺íÀ̳ªº¸±â´Â Oracle ¿À·ù°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù
- ORA-02449 Oracle Drop Table Error ¿À¶ó - 02449 ¿À¶óŬ µå·Ó Å×ÀÌºí ¿À·ù
- Oracle EXP-00091 Error When Export Database ¿À¶óŬ ÀÖµµ·Ï EXP - 00091 ¿À·ù°¡ ¹ß»ýÇßÀ» ¶§ µ¥ÀÌÅͺ£À̽º ³»º¸³»±â
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error ¿À¶óŬÀº ORA - 01658 ¼¼±×¸ÕÆ®¿¡ ´ëÇÑ ¿À·ù Å×À̺íÀÇ Ãʱ⠹üÀ§¸¦ ¸¸µé ¼ö¾ø½À´Ï´Ù
- Oracle JDeveloper Reviews ¿À¶óŬÀº JDeveloper ¸®ºä
- ORA-01502 Oracle Index in Unusable State ORA - 01502 ¿À¶óŬ Áö¼ö´Â ºÒ°¡´É »óÅ¿¡
































