C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[37833] Re:Re:Re:DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다.
김요한 [phonon] 1281 읽음    2004-11-02 09:30

DBMS로 SQL server 2000을 사용한다고 가정하겠습니다.

BLOB은 'binary large object'의 약자입니다. images, movies,  files과 같은 큰 용량의 binary data를 말합니다. DBMS에 따라 명칭이 다르겠지만, MSSQL에서는 'binary', 'varbinary','image' 등의 type를 제공하고 있습니다.
아래의 표를 참조하면서 어느 data type이 적합한지 선택하시면 됩니다.

각 DB Table의 fild(row) Data type의 결정은 DB 설계시에 고려되는 사항이므로, DBA가 계시면 상의하시기 바랍니다.

Data Types Description
bigint Integer data from -2^63 through 2^63-1
int Integer data from -2^31 through 2^31 - 1
smallint Integer data from -2^15 through 2^15 - 1
tinyint Integer data from 0 through 255
bit Integer data with either a 1 or 0 value
decimal Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1
numeric Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1
money Monetary data values from -2^63 through 2^63 - 1
smallmoney Monetary data values from -214,748.3648 through +214,748.3647
float Floating precision number data from -1.79E + 308 through 1.79E + 308
real Floating precision number data from -3.40E + 38 through 3.40E + 38
datetime Date and time data from January 1, 1753, through December 31, 9999,
with an accuracy of 3.33 milliseconds
smalldatetime Date and time data from January 1, 1900, through June 6, 2079,
with an accuracy of one minute
char Fixed-length character data with a maximum length of 8,000 characters
varchar Variable-length data with a maximum of 8,000 characters
text Variable-length data with a maximum length of 2^31 - 1 characters
nchar Fixed-length Unicode data with a maximum length of 4,000 characters
nvarchar Variable-length Unicode data with a maximum length of 4,000 characters
ntext Variable-length Unicode data with a maximum length of 2^30 - 1 characters
binary Fixed-length binary data with a maximum length of 8,000 bytes
varbinary Variable-length binary data with a maximum length of 8,000 bytes
image Variable-length binary data with a maximum length of 2^31 - 1 bytes
cursor A reference to a cursor
sql_variant A data type that stores values of various data types,
except text, ntext, timestamp, and sql_variant
table A special data type used to store a result set for later processing
timestamp A database-wide unique number that gets updated every time
a row gets updated
uniqueidentifier A globally unique identifier

그럼,
좋은 하루 되세요.

곽성주 님이 쓰신 글 : : 소스는 다음과 같습니다. : ----------------------------------------------------------- : sInsertSQL = "INSERT INTO TENPRINT_CLASS (FINGER_NO, TEN_SYS_NO, FINGERCLASS_NO, FEATURE, FEATURE_LENGTH) "; : sInsertSQL += "VALUES ('1', 2049, '1', ?, '512')"; : : ADOQuery1->SQL->Text = sInsertSQL; : TParameter *tParam1 = ADOQuery1->Parameters->ParamByName("Param1"); : tParam1->LoadFromFile(sInsertFileName, ftBytes); : : ADOQuery1->ExecSQL() : ----------------------------------------------------------- : sInsertFileName 파일의 내용을 디비필드에 올리려 합니다. : 파일의 내용은 "\0 ...." 으로 시작하기 때문에 : tParam1의 내용에는 제대로 저장되지만, 디비필드에는 아무것도 저장되지 않습니다. : 제 생각에는 디비필드가 스트링필드이므로 올리면서 잘리는 듯 합니다. : "binary를 저장을 할땐 BLOB type으로 하세요."라고 하셨는데.... : 어떻게 하는 것인지... 설명 좀... 부탁..... 드립니다. : : : 김요한 님이 쓰신 글 : : : Data type이 안 맞아서 나타나는 현상입니다. : : varchar를 string/char로 받으시면 되고요, : : binary를 저장을 할땐 BLOB type으로 하세요. : : 원하시는 것을 하시려면 문자로 변환 후 저장하시면 됩니다. : : : : 엄연히, char와 binary는 다른 것이지요. : : : : 그럼, : : 좋은 하루되세요. : : : : 곽성주 님이 쓰신 글 : : : : DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 하는데 : : : : : : 안되는군요 .. : : : : : : 뭔가 올라가긴 하는데, 조회가 안되요, 왜 그럴까요?


+ -

관련 글 리스트
37811 DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다. 곽성주 868 2004/11/01
37812     Re:DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다. 김요한 1281 2004/11/01
37824         Re:Re:DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다. 곽성주 1070 2004/11/01
37833             Re:Re:Re:DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다. 김요한 1281 2004/11/02
37841                 Re:Re:Re:Re:DB에서 varchar(512)로 선언된 string field에 binary(512 Byte) 데이타를 올리려고 합니다. 곽성주 1405 2004/11/02
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.