473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Database link: Wrong column length from cursor

Here's a problem

--------------------------------------------
set serveroutput on
DECLARE
CURSOR cur is select ed_no, length(ed_no) as len from
li******@pubdb.world; BEGIN
for cur_rec in cur
loop
DBMS_OUTPUT.PUT_Line
('>'||cur_rec.ed_no||'<'||to_char(cur_rec.len) );
end loop;
end;
/
-------------------------------------------

this returns
ABC <3
XYZ <3 ....

i.e. result has correct value plus six trailing spaces

Column ed_no is CHAR(3)

I have the same problem with all CHAR columns in all tables. The
column length is tripled and trailing spaces added if I define the
cursor through the database link.

However, if I login to that database directly and get rid of
"@pubdb.world" in cursor definition, everything works fine and the
code returns
ABC<3
XYZ<3

....

Any comments, suggestions, workarounds, please... This bug (I believe
it's a bug) gonna ruin a month of my work :(((

I NEED the database link and I cannot employ RTRIM() everywhere.

Regards,
Dmitry
Jul 19 '05 #1
2 3069
Dmitry Duginov wrote:
Here's a problem

--------------------------------------------
set serveroutput on
DECLARE
CURSOR cur is select ed_no, length(ed_no) as len from
li******@pubdb.world; BEGIN
for cur_rec in cur
loop
DBMS_OUTPUT.PUT_Line
('>'||cur_rec.ed_no||'<'||to_char(cur_rec.len) );
end loop;
end;
/
-------------------------------------------

this returns

ABC <3
XYZ <3


...

i.e. result has correct value plus six trailing spaces

Column ed_no is CHAR(3)

I have the same problem with all CHAR columns in all tables. The
column length is tripled and trailing spaces added if I define the
cursor through the database link.

However, if I login to that database directly and get rid of
"@pubdb.world" in cursor definition, everything works fine and the
code returns

ABC<3
XYZ<3


...

Any comments, suggestions, workarounds, please... This bug (I believe
it's a bug) gonna ruin a month of my work :(((

I NEED the database link and I cannot employ RTRIM() everywhere.

Regards,
Dmitry


Could it be someone is concatenating empty fields?
If the programmer is believing these are varchars, concatenating
not initialized (NULL) fields make no difference.
CHAR fields start off with 3 spaces. CHAR(3)||CHAR(3)||CHAR(3) yields
9 characters
--
Regards, Frank van Bortel

Jul 19 '05 #2
Dmitry Duginov wrote:
Here's a problem

--------------------------------------------
set serveroutput on
DECLARE
CURSOR cur is select ed_no, length(ed_no) as len from
li******@pubdb.world; BEGIN
for cur_rec in cur
loop
DBMS_OUTPUT.PUT_Line
('>'||cur_rec.ed_no||'<'||to_char(cur_rec.len) );
end loop;
end;
/
-------------------------------------------

this returns

ABC <3
XYZ <3


...

i.e. result has correct value plus six trailing spaces

Column ed_no is CHAR(3)

I have the same problem with all CHAR columns in all tables. The
column length is tripled and trailing spaces added if I define the
cursor through the database link.

However, if I login to that database directly and get rid of
"@pubdb.world" in cursor definition, everything works fine and the
code returns

ABC<3
XYZ<3


...

Any comments, suggestions, workarounds, please... This bug (I believe
it's a bug) gonna ruin a month of my work :(((

I NEED the database link and I cannot employ RTRIM() everywhere.

Regards,
Dmitry


Could it be someone is concatenating empty fields?
If the programmer is believing these are varchars, concatenating
not initialized (NULL) fields make no difference.
CHAR fields start off with 3 spaces. CHAR(3)||CHAR(3)||CHAR(3) yields
9 characters
--
Regards, Frank van Bortel

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bryan J Gudorf | last post by:
PDO, an open source python module for interfacing with RDBMS (SQL databases), has now reached 1.2.0! PDO provides an object oriented API, similar to that of ADO or JDBC, to python developers. PDO...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
3
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
2
by: Alex Guryanow | last post by:
Hi, I have windows app written in Borland C++ Builder 5.0. Using ODBC driver windows app connects to database on linux server. Database is created with UNICODE encoding. When pg-server is...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
0
bartonc
by: bartonc | last post by:
With one small change to the view/control: self.staticText3 = wx.StaticText(id=wxID_DBCONNECTDIALOGSTATICTEXT3, label='ODBC Data Source Name', name='staticText3',...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
1
by: Dmitry Duginov | last post by:
Here's a problem -------------------------------------------- set serveroutput on DECLARE CURSOR cur is select ed_no, length(ed_no) as len from listtext@pubdb.world; BEGIN for cur_rec in cur...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.