473,698 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting NUMBER, DATE and VARCHAR2 database fields from Resultset to variables?

Assume a database (e.g. Oracle) field is declared as
a) NUMBER (length=10)
b) NUMBER (length=26)
c) VARCHAR2 (length=1)
d) VARCHAR2 (length=50)
e) DATE

How do I retrieve the contents from these resultset fields and put it into a (numeric) java resp Date field?

For other field types it is already clear e.g.):

ResultSet rs = executeQuery(.. ..);
....

int i = rs.getInt(1); // for INTEGER database fields
String s = rs.getString(2) // for VARCHAR database fields (not VARCHAR2 !!)
double d = rs.getDouble(3) // for DECIMAL database fields

How are the corresponding assign statements for NUMBER, VARCHAR2 and DATE ?

Sven

Nov 12 '05 #1
0 1756

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

Similar topics

0
9847
by: Sven Mayer | last post by:
Assume a database (e.g. Oracle) field is declared as a) NUMBER (length=10) b) NUMBER (length=26) c) VARCHAR2 (length=1) d) VARCHAR2 (length=50) e) DATE How do I retrieve the contents from these resultset fields and put it into a (numeric) java resp Date field? For other field types it is already clear e.g.):
1
9286
by: Mike Landis | last post by:
Hello, Has anyone a small tool or somekind of document which could help me to convert Oracle SQL scripts to SQL Server? Scripts are not very Oracle specified. Thanks, Below is a Script that I would e.g convert to MS SQLServer:
2
1963
by: John Ortt | last post by:
Hi All, I have a database in Access 97 which works fine but our company is converting from NT4 to XP Pro and in the process changing Office 97 for Office 2003. I have tried to convert the 97 database into Access 2003 but the Autoexec macro falls over on the query below. I have tried running it separayely and the computer just hangs. I realise there is a lot of code below, but I'm hoping somebody may know what they are looking for...
4
3329
by: Dan Lewis | last post by:
I've imported a ms access database into a table in a mysql database. The access database contains a field that holds date/time values in 'general date' format. These all show up at 01/01/1970 in the mysql database. I believe the field in mysql is wanting UTC and shows numbers when looked at from the sql command line (i.e. March 13, 2006, 5:31 pm is shown as 1142289086). How do I get the access data into that format so it will import...
10
19746
by: CJM | last post by:
I'm trying to call a package/procedure in oracle (from an ASP page) which requires a number of parameters. I have got this working using OO40 but unfortunately the transaction rollback function doesnt seem to do much. So I'm now trying to use ADO instead (in the hope that ADO transactions will work), however I'm getting the above error. My initial searches havent turned up any suitable suggestions - there appear to be many reasons why...
0
1526
by: kumarkanth | last post by:
My question is how do I manipulate the procedure to calculate cut-off date with in working days and it should skip weekends and holidays? I have holiday table to determine holidays Table Name : HOLIDAYMSTR HOLIDAYMSTR_ID RAW(16) PREV_UPDATED_BY RAW(16) Y LAST_UPDATED_BY RAW(16) HOLIDAY_DATE DATE ...
2
2746
dmjpro
by: dmjpro | last post by:
this is my funciton block in oracle ....... Function PIM_TEST ( param1 IN DATE DEFAULT SYSDATE, param2 IN OUT DATE) RETURN DATE IS -- -- To modify this template, edit file FUNC.TXT in TEMPLATE -- directory of SQL Navigator --
1
5187
by: SLC via DBMonster.com | last post by:
Hello I'm a newbie to this and I need help, please My question is, we currently have a IDMS db and will be converting to DB2. What are the things I should do? The IDMS has not been documented very well, and there are a number of duplicate fields. I was thinking about documenting all the tables with fields attributes, and documenting the fields to the 150 screens in this program. We also that about doing a CRUD matrix to see what it...
2
9736
by: jeanbdenis | last post by:
Hi Folks, I have been struggling with this issues for the last couple of days. I have a java application which does an update to the database every 5 mins. The data written to the database does not change much from one minute to the next. Just the timestamp. While this application runs 24/7, the error occurs once or twice a day (It's an intermittent problem which I have not been able to replicate in my dev environment) below is the...
1
1046
by: neelaseenu | last post by:
Hi there Can some one help me with this issue. I have 2 text fields which user selects the date from calender control. Now i want to retreive data from table which falls in the range of these 2 text fields here is the code i have written. When i run this form it returns the resultset with no rows.(EMPTY resultset) sdate = CDate(Forms!!) edate = CDate(Forms!!) sql = "select IncidentsResolved.Severity,count(IncidentsResolved .Severity)...
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.