Skip to content

Commit a4efdac

Browse files
committed
Enhancing example for resolving long INSERT statements.
1 parent 01f9a2e commit a4efdac

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/content/docs/d1/build-with-d1/import-export-data.mdx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,28 @@ Before:
176176
```sql
177177
INSERT INTO users (id, full_name, created_on)
178178
VALUES
179-
('01GREFXCN9519NRVXWTPG0V0BF', 'Catlaina Harbar', '2022-08-20 05:39:52'),
180-
('01GREFXCNBYBGX2GC6ZGY9FMP4', 'Hube Bilverstone', '2022-12-15 21:56:13'),
179+
('1', 'Jacquelin Elara', '2022-08-20 05:39:52'),
180+
('2', 'Hubert Simmons', '2022-12-15 21:56:13'),
181181
...
182-
('01GREFXCNF67KV7FPPSEJVJMEW', 'Riane Zamora', '2022-12-24 06:49:04');
182+
('1000', 'Boris Pewter', '2022-12-24 07:59:54');
183183
```
184184

185+
Break into multiple `INSERT` statements.
186+
185187
After:
186188

187189
```sql
188190
INSERT INTO users (id, full_name, created_on)
189191
VALUES
190-
('01GREFXCN9519NRVXWTPG0V0BF', 'Catlaina Harbar', '2022-08-20 05:39:52');
192+
('1', 'Jacquelin Elara', '2022-08-20 05:39:52'),
193+
...
194+
('100', 'Eddy Orelo', '2022-12-15 22:16:15');
195+
...
191196
INSERT INTO users (id, full_name, created_on)
192197
VALUES
193-
('01GREFXCNBYBGX2GC6ZGY9FMP4', 'Hube Bilverstone', '2022-12-15 21:56:13');
198+
('901', 'Roran Eroi', '2022-08-20 05:39:52'),
199+
...
200+
('1000', 'Boris Pewter', '2022-12-15 22:16:15');
194201
```
195202

196203
## Next Steps

0 commit comments

Comments
 (0)