27/12/2007, 16:26
|
| | | Fecha de Ingreso: julio-2005 Ubicación: cancun mexico
Mensajes: 598
Antigüedad: 19 años, 4 meses Puntos: 3 | |
Re: algun error en esta insercion? SABES, DIME QUE ESTRUCTURA TIENE TU TABLA, MUCHAS VECES MIRAMOS POR EL RUMBO EKIVOCADO....... ALO MEJOR TIENES UNA OPCION QUE ESTA CAUSANDO RUIDO.. Cita: Default Column Values
When you use a full insert, any columns that are not listed have their default value inserted for the new data row, or NULL if there is no default. A column that has the AUTO_INCREMENT property is assigned the next number in sequence by default. Cita: NULL Columns
If you do not give a value for a column that has the NOT NULL constraint and also does not have a default value, the insert will fail.
Código:
If you explicitly want to use a column's default value in an INSERT statement, use the DEFAULT keyword as its value. In the following examples, you insert new record into the orders table, where the order_id column has the AUTO_INCREMENT property:
mysql> INSERT INTO orders
-> (order_id, customer_code, order_date)
-> VALUES (DEFAULT, 'MUSGRP', '2006-04-01');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO orders (customer_code, order_date)
-> VALUES ('MUSGRP', '2006-04-01');
Query OK, 1 row affected (0.00 sec)
Both formats of the INSERT statement perform the same job. You can then query the orders table to verify that the two records were inserted with sequential order_id values.
__________________ Código PHP: echo"hola mundo ver 1221332143.02";
echo"cuantos usuarios habran impreso hola mundo en el mundo.!???";
|