A Peculiar Problem! 
Author Message
 A Peculiar Problem!

Dear Friends:

        I have some basic questions on Sybase and a puzzling
error!

        ------------- THE QUESTIONS ---------------

        Q1: How can I describe a table after I create it?

        Q2: How can I list all objects in the database?

        -------------- THE BUG ----------------------

        I have a source file that I am reading into Sybase
using bcp. First of all, Sybase did not like <cr> and
I had to remove all of them in the file and make it into a
one line file.

        I did create a test file which is the following:

1 AAAA 1 DDR ddr_id ddr_id_typ 1 AAAA 1 ddr ca_id ca_id_typ

        I followed it by the following command:

        bcp myDatabase..myTableName in testFileName

        In the table, all attributes are read in properly,
but for the integers. The integers are read as some huge
values. I replaced the integer by a shortint and got these
values:

  12590 AAAA   12590 DDR   ddr_id   ddr_id_typ
  12590 AAAA   12590 ddr   ca_id    ca_id_typ

        Why 1s are read as 12590, I have no idea!

        Could anybody please help me out?

Thanks in advance

-Badri



Sun, 28 Jul 1996 08:18:18 GMT
 A Peculiar Problem!

Well, 12590 is 312E hex.

312E hex is the two ascii characters "1" and "."

So, it would seem that your input is ascii but when put into
an integer field it is read in as binary. So, in order to get
an integer 1 in the ascii character in the file would have to
be an ascii(0001), which is an unprintable pair of characters.

My advice, if you're going to insist on using bcp, is to use
a format file or the -c option.

However, using an isql script tends to be cleaner and more
easily readable even though it is slower.

Topher
---
Christopher A. White          | "I once could see,
McCaw Cellular Communications |      but now, at last, I'm blind."
Kirkland, Wa                  |         -- Dream Theatre



Sun, 28 Jul 1996 18:16:28 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Peculiar Problem

2. peculiar problem in VC++ app.

3. OAS and DB - Peculiar problem!!!!!!!!!

4. Informix tools - Peculiar problem

5. Peculiar Problem

6. Peculiar Problem

7. DB2 5.2 on solaris having peculiar problem

8. How to get a peculiar type of result list

9. Peculiar DTS Transform error

10. Peculiar behaviour when redesigning table...

11. How to get a peculiar type of result list


 
Powered by phpBB® Forum Software