Solved

ODBC Oracle with CString Probelm

Posted on 2004-04-05
5
280 Views
Last Modified: 2013-11-20
hello.
I am using oracle database ,and
mfc,odbc method to
execute my command.

I want to insert into mytable
,the field is LONG type data_type .
I want to insert a CString.
when the CString length <4000,
it's ok.
but when It's length come to >4000.
It won't work.
how can I resovle ,thx.

0
Comment
Question by:oopilix
  • 3
  • 2
5 Comments
 

Author Comment

by:oopilix
ID: 10763082
can anyone help me??:
0
 
LVL 2

Expert Comment

by:alligatorsql
ID: 10765322
Hello,

we use OCI and when we want to save string that are greater than 4000 bytes, we use a piecewise operation. That
means, that Oracle will save the long string in 4000 bytes blocks. Is there a aquivalent operation in ODBC ?

Best regards
Manfred Peter
0
 

Author Comment

by:oopilix
ID: 10771739
thx,
but I din't use OCI before,
and
how do you use it in OCI,
I can't imagine  I can't insert into one
field with different data;

as u see:
Insert into xxx(x) values(...
Insert into xxx(x) values(...

what will it become..
0
 
LVL 2

Accepted Solution

by:
alligatorsql earned 25 total points
ID: 10773054
Hello,

That`s true.
OCI is a low level api and you use C functions to put the datas to the table.
Piecewise operation means that you call the oci function for inserting datas more that ones
For example:

CString sVeryLongString = "ABCD";
CString sVeryLongString1;="EDFG";

OCI_PREPARE_BUFFER(sVeryLongString);
OCI_PREPARE_BUFFER(sVeryLongString1);

OCI_EXECUTE ...

The question is, can you use piecewise operation with ODBC ?

Best regards
Manfred Peter

So, the question is,
0
 

Author Comment

by:oopilix
ID: 10773153
oh,thank you
I will find the OdBC method ,and
try it.
 
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now