Solved

ODBC Oracle with CString Probelm

Posted on 2004-04-05
5
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 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