Home » SQL & PL/SQL » SQL & PL/SQL » !!!cannot retrieve numeric type!!!
!!!cannot retrieve numeric type!!! [message #9764] |
Wed, 03 December 2003 16:54 |
Stoooodent
Messages: 2 Registered: December 2003
|
Junior Member |
|
|
Please help!!!
I connect to oracle database and everything is fine, but when I retrive data with type NUMBER i get all zeros. If it is VARCHAR or DATE everything is perfect.
What is wrong? Can you please help me?
|
|
|
Re: !!!cannot retrieve numeric type!!! [message #9767 is a reply to message #9764] |
Wed, 03 December 2003 21:06 |
Daljit Singh
Messages: 290 Registered: October 2003 Location: Texas
|
Senior Member |
|
|
Hi,
U have to provide us enough info so that we can clearly see the picture. Wht do u mean by gettina all zeros for number datatype wht is the structure of table and wht query u r using just post this info so that we can help u.
|
|
|
Re: !!!cannot retrieve numeric type!!! [message #9792 is a reply to message #9767] |
Thu, 04 December 2003 19:53 |
Stoooodent
Messages: 2 Registered: December 2003
|
Junior Member |
|
|
Sorry, ok...here is the table:
------------------------------
"CREATE TABLE flight (
FlightNum number(4),
Origin varchar2(10),
Destination varchar2(10),
Departure varchar2(10),
Arrival varchar2(10),
NumSeat number(3),
Price number(4),
primary key (FlightNum));
And some entries to test it:
INSERT INTO flight VALUES (1234, 'New York', 'Chicago', '06:12','07:35',6,146);
INSERT INTO flight VALUES (2345, 'New York', 'Dallas', '07:20','10:35',5,189);
INSERT INTO flight VALUES (3456, 'New York', 'Sacramento', '07:51','12:35',5,278);
INSERT INTO flight VALUES (4567, 'Chicago', 'New York', '06:35','07:45',6,152);
INSERT INTO flight VALUES (5678, 'Chicago', 'Dallas', '11:00','12:45',4,134);
---------------------------------------------------
Here is the fragment of ASP code I am using, I had to cut some code out to display it properly:
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")
connStr = "Driver={Oracle ODBC Driver}; Server=http://127.0.0.1; UID=system; PWD=manager"
oConn.Open connStr
oRs.Open "SELECT * FROM flight", oConn, 1, 1, 1
Do While Not oRs.EOF
varEmpNo = oRs.Fields("flightNum")
Response.Write oRs("flightnum")
oRs("origin")
oRs.MoveNext
Loop
------------------------------------------------
So when it outputs results, I can see all cities OK, but I have all ZEROS instead of flightnum....the same holds to price, or any value that has type NUMBER.
Can someone clarify what is going on here. I would greatly appreciate! Thank you guys in advance!
|
|
|
Goto Forum:
Current Time: Thu Apr 25 19:13:46 CDT 2024
|