Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

MaxDB fetch into problem with concatenated data in oracle mode with embedde: msg#00256

db.maxdb

Subject: MaxDB fetch into problem with concatenated data in oracle mode with embedded SQL statment in C/C++ programs

Dear Reader,

Within my C/C++ program y tried to do get some concatenated data output
within a cursor by using the next query:

exec sql declare Cursor_Ocupaciones cursor for
select rpad(to_char(cod_programa),10,' ') ||
rpad(rtrim(tabla,' '),20) ||
rpad(to_char(orden),10,' ')
from guf_ocupaciones;

The columns "cod_programa" and "orden" are defined as number(10).
The column "tabla" is defined as varchar2(100).

The output of the fetch is send to the host variable "query_out",
defined as char[1000], and initialised before each fetch with nulls.

The first problem consists that after de obtained concatenated data, the
rest of the output buffer (query_out) is filled up to de end with
blanks, and de last charter +1 (out of the buffer size) with the "@"
character. I think the output buffer should contain only the obtained
data ended with a null character.

The second problem is that if I try to do the same with dinamic SQL
(prepare, declare, open and fetch), first the open fails (-2010),
indicating that the size indicated in the "rtrim" function on the column
"tabla" should be at least de real column size. When I put the size at
100 (real column size), the program executions end in a core dump.

The same query tested in the sql client (websql and sqlcli) seems to
works fine.

Best regards

Elbertus Lochtenberg
Project Manager
Teleserver S.A.
Mobile: +34628270643

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo