Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

missing data from query results

Status
Not open for further replies.

liorza

Programmer
Mar 3, 2004
27
US
Hi guys,
can someone explian why the csi_id information is missing when I am runing
select * from csi where csi_id in (20,23,24);

see bellow:

mysql> desc csi;
+--------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+----------------+
| CSI_ID | bigint(20) | | PRI | NULL | auto_increment |
| NAME | varchar(100) | | UNI | | |
+--------+--------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

mysql> select * from csi where csi_id in (20,23,24);
+--------+--------------------------------------+
| CSI_ID | NAME |
+--------+--------------------------------------+
|
| 23 | 3100-Concrete Forms and Accessories
| 3200-Concrete Reinforcement
+--------+--------------------------------------+
3 rows in set (0.00 sec)

mysql> select csi_id from csi where csi_id in (20,23,24);
+--------+
| csi_id |
+--------+
| 20 |
| 23 |
| 24 |
+--------+
3 rows in set (0.00 sec)

mysql>

Thanks Lior
 
Is that exactly how it appears on your terminal?

If so, then you probably have some strange characters in the NAME field in one or more of the records which cause the terminal to act like that.

Try running the query using a GUI client.

-----
ALTER world DROP injustice, ADD peace;
 
Tony,
1.Is there a gui tool that comes with Mysql?
2.What kind of characthers could cause something like that?

Also I can add that I have loaded the data to the table from a text file.

My issue is that I am not getting the correct data when I quering this query from Java. The output in the terminal is a proof that something is wrong.

let me know what you think.
Thanks,
Lior
 
Issue resolved.
The problem was with the command I use to load the data in

now I have used

load data local infile "c:/archismo/dev/scripts/csi.txt" into table csi lines terminated
by "\r\n";

This resolved it.

Thanks Tony for your help.

Lior
 
MySQL Control Centre is a good GUI front-end for MySL. It's free from the MySQL website.

-----
ALTER world DROP injustice, ADD peace;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top