Type of Database field
Hi all,i have a problem;
Can i know the type of a database field; for example date,character,integer?
How can i retreive that?
By Simon
You can know the type of column by using getColumnTypeName method on the ResultSetMetaData
You can get the ResultSetMetaData from the resultset using getMetaData() method
Hope this helps !
Similar Messages
-
Store values of different data types into single database field
Hi Friends,
I have to store values of different data types(character, numeric, date, time, text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report.
Appreciate any ideas, examples, suggestions.
Thanks
JBHi,
Try like this:
data: txt1 type string,
var1(1) type c,
var2(1) type n,
var3 like sy-datum,
var4 like sy-uzeit.
parameters: a type c,
b type n,
c like sy-datum,
d like sy-uzeit.
concatenate a b c d into txt1.
write txt1.
var1 = txt1+0(1).
var2 = txt1+1(1).
var3 = txt1+2(8).
var4 = txt1+8(8).
write: / var1,
/ var2,
/ var3,
/ var4.
Regards,
Bhaskar -
How can I read the data type of a field in an MS Access database
I need to be able to determine if a field in an Access database is of a certain data type, and if it isn't, to change it to what it should be.
I can't seem to find any way of reading the data type of any field in any table - can anyone give me a metod of getting this info?
Thanks
..BobDoes <cfdbinfo> work for Access DBs?
You might be better off asking this on a MS Access forum. It's more of an Access issue than a CF one.
Adam -
Impact of changing data type of a field in Database table
Hi All,
I need to change the data type of a field(which is not a key field and it has no dependency with any other field) from NUMC to CHAR by maintaining the same length. Please let me know if there will be any impact in doing this. Hope the following things need to be taken care:
- Take backup of entire data in the table before doing the change
- After changing the data type, I need to set the option 'Save Data' and then 'Activate and Adjust Database' in 'Database Utility'.
- Use 'Where Used List' to check the related objects.
Please let me know if there is any impact or any thing else need to be taken care apart from the above things.
Thanks in advance.
Regards
Vidhya.Hi,
even if the length is same there would be no impact.
just v need to adjust the database in the database utility.
check the table maintenence generator also. if not reflected there u need to delete it and create it again.
reward if useful,
teja -
Database fields importing as wrong data type
I am using Crystal Reports 2008, connecting to an Oracle 9i database.
Some of our database tables have a field with data type of SDO_GEOMETRY. I know this is an unsupported data type in CR, so the field list in the field explorer skips over it when I import tables using the Database Expert. However, it doesn't skip over the data type, giving each field below the SDO_GEOMETRY field the wrong type. To illustrate:
Field Name Type (Size)
GEOLOC SDO_GEOMETRY (1)
ID NUMBER (22)
NAME STRING (25)
DESC STRING (200)
CR 2008 will skip GEOLOC, assign ID as String (2000)how it interpreted SDO_GEOM in ver. XIName as Number, and Desc as String (25). I also noticed this behavior in CR XIR2. Has anyone else run into this? The workaround I've found is to write a SQL command; but is there a setting or hotfix out that fixes the bug?Hello,
I would recomend using a stored procedure to connect to the data and assign a Crystal-valid data type to each field so that there won't be a chance for this sort of issue to happen when pulling in data.
-Sean -
Update sql server database field of type datetime using jsp
I'm working in a jsp applicaion which use SQL server 2000 as database. I need to update database field with current time, so I used a bean for that in which I used following method:
public java.sql.Time getSqlTime(){
Calendar cal=Calendar.getInstance();
cal.setTime(new Date());
java.sql.Time sqlTime=new java.sql.Time(cal.getTime().getTime());
return sqlTime;
when I print the time on a page using this method works properly, but I update a database field of type datetime, it takes correct time but updates with '01/01/1900 12:26:46 PM' like that. I need only time , how can I correct this?
Thank youpublic java.sql.Time getSqlTime(){
Calendar cal=Calendar.getInstance();
cal.setTime(new Date());
java.sql.Time sqlTime=new
java.sql.Time(cal.getTime().getTime());
return sqlTime;
}to get the Time for current time, you can just simply do
java.sql.Time sqlTime = new java.sql.Time(System.currentTimeMillis());I dun know about SQL server 2000... but thinked that you should declare you
field as time rather as datetime. -
Database fields empty after creating a new (Crystal) Report in MSY
Hello,
I have some issues to use Crystal Reports in Mobile Sales Maintenance (MSY). The situation is as follows
My example is based on this standard report, which is working
Report Name: BPartnerActivities
Reporting Tool: Crystal Reports
Category: Standard reports
Subcategory: Lists
Report Type: Report
Data Source: Business Content provider
Business Content Provider: BPActivities
My requirement is to build a new report, which is based on the standard "BPartnerActivities" Report. If I use the "copy" functionality, I get an working Copy of the standard report. However, I need to modify the Business Content Provider, but I do not want to make the modifications on the standard content provider "BPActivities".
I am now forced to used the "copy" functionality to create a copy from "BPActivities" for my own Content Provider "My BPActivities copy", which I want to use in a new report.
Issue:
I cannot modify the defined Business Content Provider after using the "copy" functionality and hence forced to create a new report from scratch to be able to set a different Content Provider.
I create my own report "MyBPartnerActivities" based on the standard report "BPartnerActivities" using the same settings and assign my new business content provider.
If I use the "Design Report" or "Modify Report" button, the Crystal Report designer pops up. Now the problem, the Crystal Report designer does not offer me any data below "Database fields".
In the standard report, the "Database fields" has a child element "BOACTIVITY-ttx" with several field options. My own created report from sratch does now have anything?!
Why my report does not offer my any data or is there anything additional to do?
Another Test
I tried to create another report using the standard content provider "BPActivities", but I have still the same issue.
In addition I recongized that the "browse data" fuctionality does not work on the fields in the standard report. The path to the database file does not exist. It starts with "C:\WINNT\...", but my system has "C:\WINDOWS\...". But the executed report is able to retriev the data?!
Unfortunately was not able to find any proper documentation, but I would really appreciate any help.
Regards,
AndreasUpdate
It looks like that the *.ttx file is not uploaded/create to/on the MSY system. The system shows the file in the Crystal Report Designer, but there is no file on the file system. The confusing thing is, that any standard report is still working and does not really complain about a missing ttx file. I think the content of the ttx file is somehow embeded to the report.
Does someone know how the system should behave? Should a ttx file be automatically created & assigned to any new report or do I have to create the file by my own every time?
Cheers,
Andreas -
Activation error while changing the data type of a field of a table
hi friends,
i am facing one problem while changing a data type of a field of a table.
i just created one table(Yqm32) .i have assigned charcter data type to one field(ztotal_count) .now i want to change this charcter data type to numeric data type.
while changing to NUMC data type activation error is comming as below.
Table is not yet classified
Field ZTOTAL_COUNT: Type change
ALTER TABLE is not possible
Structure change at field level (convert table YQM32)
Check on table YQM32 resulted in errors
Table YQM32 could not be activated
(E- Structure change at field level (convert table YQM32)
plz suggest.i need to change the data type from char to numc.
Thanks & RegardsHi Pabitra......
From the SE11 change the table as u wanted and then from menubar select
UTILITIES--> DATABASE UTILITY
It will open database utility
there u select the Activate and adjust database button.
then the database table will get adjusted.
just try it once.........
Suresh...... -
Refcursor returning image (BLOB type) from database
Hi,
Process : Invoke activity takes ID as input parameter and passes it to partner link (db adapter) which executes stored proc returning a ref cursor. SQL statement in stored proc - ref cursor has a column with BLOB type.
Problem : Unable to return an image (defiined as BLOB type in database) through refcursor in BPEL.
Error : Unable to convert XSD element Column whose JDBC type is BLOB to a corresponding XML document element.
ORABPEL-11087
XSD :
<complexType name="RowSet">
<sequence>
<element name="Row" minOccurs="0" maxOccurs="unbounded" nillable="true">
<complexType>
<sequence>
<element name="Column" maxOccurs="unbounded" nillable="true">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name" type="string" use="required"/>
<attribute name="sqltype" type="string" use="required"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
Need Solution : To get an image (of BLOB type) into BPEL using ref cursor.
Please let me know if you need any more information to get it working.
Thanks and Regards,
RakeshHi Rakesh,
There are some notes you might want to refer :
Note.423909.1 'java.lang.NumberFormatException' Signaled When Using Oracle LOB Family Column Types In ODI Datastores And Integration Interfaces:
Note.423982.1 An "ORA-17410 No More Data to Read From Socket" Error Has Been Signaled From An ODI (Sunopsis) Integration Interface:
Note.423768.1 Using Oracle Large Object (LOB) Datatype Columns In ODI Integration Interfaces:
Note.744101.1 ORA-22835 Message Signaled When Using The OdiSqlUnload Tool In ODI:
Note.424658.1 "ORA-00942" Message With Oracle Large Object (LOB) Datatype Fields In ODI Integration Interfaces:
Note.423992.1 Using Oracle LONG Datatype Columns In ODI(Sunopsis):
Note.424107.1 ODI Integration Interfaces And The Use Of Oracle Spatial Datatypes In Source And Target Datastores:
Hope this helps!
Cheers
Anirudh Pucha -
Full list of database fields not showing in Database Explorer
Good Afternoon,
After a recent upgrade to Windows 7 which included having Crystal Reports 2011 reinstalled on to the PC, I am now unable to open the full list of database fields when connecting to an ODBC.
I can open old reports and refresh them without issue, but I cannot create new reports.
Any suggestions gratefully received at this point
Thanks in advance
AndyWhat type of database are you connecting to? Is your Win7 machine 32- or 64-bit? If it's 64-bit you need to create a 32-bit odbc connection. If you're connecting to SQL Server, make sure that you have the "SQL Server Native Client" version 10 or 11 installed - the connection doesn't work well with the version 6 SQL Server ODBC driver that's installed as part of Win7.
-Dell -
How to read the source file and copy the entire content to the target Database field
Hi All,
PI system extracts the actual business content from the incoming attachment file and copy the entire format to the target Database field which is a blob data type field.
Sender Adapter: SOAP
Receiver Adapter: JDBC
JDBC Structure
Can we achived the above requirement by using UDF with out Java Mapping?
Thanks,
Mahi.Ok, in this case yo can use the conten converion of the file adapter. Therefore you first need to create a Datatype in ESR with the required structure
Then in your file adapter you need to use this datatype and its required fields:
The Datatype then can be used as usual within you mapping.
regards
Christian -
How to get 10 characters if there are 18 characters in database field
IF there are four fields in a internal table and each field have 18 character length. i should less the filed length of only 3 fields to 10 characters and should get this fields in Application layer and flat file ( out bound interface),
so can u guide me the logic how to populate the data in application layer and flat file with new field length of 3 fields and old field length of fourth field.Hi Azeez,
First declare your internal by referring database fields and fetch data from data base into this internal table.
Ex:
types: begin of stru,
f1 type <t1>-f1,
f2 type <t1>-f2,
f2 type <t1>-f2,
f2 type <t1>-f2,
end of stru.
Lets consider all the above fields have length 18 in database.
data: itab type standard table of stru.
data: wa_itab type stru.
data: lv_char(48) type c.
select f1 f2 f3 f4 from t1 into table itab.
loop at itab into wa_itab.
concatenate wa_itab-f1+0(10) wa_itab-f2+0(10) wa_itab-f3+0(10) wa_itab-f4
into lv_char.
<b>now transfer this variable (lv_char) to application server.</b>
endloop.
hope this helps.
Regards,
Phani. -
Plz.. Help me to get database field for Rate/Hour
I have the requirement to get the Rate/Hour for Actual Labor ,OT Labor and WE Labor etc.
<b>I am passing Activity types to AFVC-LARNT to get different types of Labor</b> .But i don't know the Database Table Field to get this Rate/Hour .
please suggest me from which table i have to pick Rate/Hour .Please specify the Field Name also.
<b>If it is from AFVC please suggest me the Field Name for RATE/HOUR .
Input is AUFK-AUFNR. </b>
Rewards
Anu.Hi
Activity Hours take from AFVV table passing AUFNR field of AFKO tables
Activity costs are to be taken from COST table by passing the OBJNR field which is combination of <KL><Controlling area><Cost center><Activity Type>
Take this fields related to AUFNR and pass from AUFK or AFKO..
Regards
Anji -
Database Field for Picked Quantity in Delivery
Hi All,
We want to know the Database Field for Picked quantity in a delivery. We checked the help for the field and it points to the LIPSD structure and the field PIKMG. However I could not find it in LIPS table or any other table. Could somebody please help me locate this field in the database ?
Thanks,
AmitHi, This is late response i know, but maybe someone else is looking for same and needs code for same. Please keep in mind that you also need to check if users have done LT0G return from GI are back to picking bin. In this case you need minus the TO from total picking qty.
ABAP routine:
form LIPS_PICKED using LS_LIPS type LIPS.
data: LT_VBFA type table of VBFA,
LS_VBFA type VBFA,
LS_LTAP type LTAP.
select * from VBFA into table LT_VBFA "Fetch to data from doc flow and count picked
where VBELV = LS_LIPS-VBELN
and POSNV = LS_LIPS-POSNR
and VBTYP_N = 'Q'.
clear LS_LIPS-LFIMG.
loop at LT_VBFA into LS_VBFA.
select single * from LTAP into LS_LTAP
where LGNUM = GS_SCREEN_100-LGNUM
and TANUM = LS_VBFA-VBELN
and TAPOS = LS_VBFA-POSNN
and PQUIT = 'X'. "Picked!
if SY-SUBRC = 0.
if ls_ltap-vltyp = '916'. "Source is GI area => LT0g done, it is minus!
LS_LIPS-LFIMG = LS_LIPS-LFIMG - LS_LTAP-VISTA.
ELSE.
LS_LIPS-LFIMG = LS_LIPS-LFIMG + LS_LTAP-VISTA.
endif.
endif.
endloop.
endform. "lips_picked -
How to display two database field in report
hi,
i have made a report and in that report i am displaying two fields with same data and these fields are database.In the FORM f_display_report i have given the same name in both fields.But when i going to SUM it gave me only one field SUM and other fields gives null.
give me some guidance as i have to display both fields with same data and same amount of SUM.
Thanksif i am using the database field i-e wt_qbshb then it gave me the data but when im going to sum both field it gave me sum of only one field.This the code:
ITAB:
BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the PERFROM DISPLAY REPORT:
PERFORM fill_fieldcat USING 'LIFNTN' 11 'NTN' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'LIFNIC' 16 'NIC' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'LIFNR' 10 'Vendor' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'NAME1' 35 'Name' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'STRAS' 35 'Address' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'ORT01' 35 'City' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QEKAR' 40 'Nature of Payment etc' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QSCOD' 10 'Payment Section Code' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'BUDAT' 10 'Date of Payment(dd/mm/yyyy)' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'DMBTR' 20 'Value/Amount on which Tax Collected or Deducted' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QSATZ' 10 'Rate of tax (%)' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'WT_QBSHB' 16 'Tax Amount Collected/Deducted' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'WT_QBSHB' 16 'Amount of Deposited' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'P_TAX'(001) 15 'Date of Tax Deposited(DD/MM/YYYY)' 'GI_MAIN'.
Thanks.
Maybe you are looking for
-
Exception when trying to acess a jsf application
Im using eclipse 3.3 , tomcat 5.5.2x index.jsp ======== <html> <body> <jsp:forward page="faces/ourJsf/enterAge.jsp" /> </body> </html> ============ enterAge.jsp ========= <%@ page contentType="text/html; charset=Cp1252" %> <%@ taglib uri="http://java
-
How am I using so much data with iPhone 5?
Got the iPhone 5 Friday evening and by Tuesday afternoon I went over 5 gb of data usage. That's 5gb in 4 days. How is this possible?
-
Send huge data through the network
Hi all, I need to transfer large image (around 200MB) through the network to the neighborhood PCs for processing. The time i have is very short (Say 4 seconds). Since, i need to send the image to multiple PCs, i thought UDP will be helpful. But the L
-
Hello. I'd like to use exact size in dots when making layout for my document. Ruler Guide set to "px" displays pixel values for 72dpi, but I'll print the document in 300dpi. I'd still like to measure dots exactly, is there a way to change Ruler Guide
-
ENQUEUE, DEQUEUE of objects
Hi all, i want to lock sales orders with fm ENQUEUE_EVVBAKE and DEQUEUE_EVVBAKE. This two fms work fine if i am in the same mode. I start the fm ENQUEUE_EVVBAKE from one mode and want to unlock the entries from another mode. The fm DEQUEUE_EVVBAKE ru