250x250
Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- myBatis
- oracle
- Exception
- ubuntu
- Tomcat
- MSSQL
- Thymeleaf
- 오픈소스
- git
- Python
- Open Source
- 문서
- maven
- Source
- Eclipse
- error
- AJAX
- STS
- IntelliJ
- JavaScript
- MySQL
- 설정
- PostgreSQL
- jpa
- spring
- Core Java
- JDBC
- Spring Boot
- Docker
- SpringBoot
Archives
- Today
- Total
헤르메스 LIFE
[PostgreSQL, MariaDB] 다건 Insert ( Multi Row Insert ) 본문
728x90
이 기능은
PostgreSQL
Maria DB
기능입니다.
PostgreSQL 에서 다건 Insert 를 찾아봤습니다.
개발환경
PostgrSQL : 14.1
https://www.postgresql.org/docs/current/sql-insert.html
INSERT
INSERT INSERT — create new rows in a table Synopsis [ WITH [ RECURSIVE ] with_query [, ...] ] INSERT …
www.postgresql.org
일반적인 Insert 문
INSERT INTO users (name, email) VALUES ('John', 'john@example.com');
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com');
다건 Insert 문 ( PostgreSql 11 버전 이후에서 된다고 합니다. )
INSERT INTO users (name, email) VALUES
('John', 'john@example.com'),
('Alice', 'alice@example.com'),
('Bob', 'bob@example.com');
Excel 을 읽어서 String 으로 변경
public String convString(Cell cell) {
String returnValue = "";
switch( cell.getCellType() ) {
case STRING:
returnValue = cell.getStringCellValue();
break;
case NUMERIC:
returnValue = String.format( "%.0f", cell.getNumericCellValue() );
break;
case BOOLEAN:
returnValue = cell.getBooleanCellValue() ? "Y" : "N" ;
break;
case FORMULA:
returnValue = cell.getCellFormula().toString() ;
break;
default:
returnValue = cell.getStringCellValue();
}
return returnValue;
}
postgresql 오류: 캐시된 계획에서 결과 형식을 바꾸지 않아야 함
오류가 나는데 해결은 못하고 있음.
plan_cache_mode 관련 검색이 되는데, 확실치 않음.
ALTER DATABASE [DB명] SET plan_cache_mode = force_generic_plan728x90
'Database' 카테고리의 다른 글
| [MariaDB] MariaDB Tool - DBeaver (0) | 2024.05.05 |
|---|---|
| [Oracle] Ubuntu Linux 에 SQL Developer 설치 (0) | 2024.04.08 |
| [MongoDB] MongoDB 명령어 기본 (0) | 2023.12.05 |
| [MongoDB] Mongo Database 샘플 데이터 로드 (0) | 2023.11.07 |
| [Docker] Docker 에 MongoDB설치하기 (0) | 2023.11.04 |