Trouble when get a field in Date type
Hi all,
Please look thru my code:
string user="myaccount", passwd ="z", db = "server";
Environment * env = Environment::createEnvironment (Environment::DEFAULT);
Connection * conn = env->createConnection (user, passwd, db);
Statement *stmt = conn->createStatement("select a_date from test_tab a_date is not null");
ResultSet *rs = stmt->executeQuery();
Date d;
while(rs->next())
d = rs->getDate(1);
stmt->closeResultSet(rs);
conn->terminateStatement(stmt);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
When I create Environment object with DEFAULT options, I can not run d = rs->getDate(1);
but when I change to OBJECT, it works. Why? Oracle's guru still use DEFAULT in their example :-(
I use Windows 2000, MS Visual C++ 6.0
Please help me
thanks
If your other two checks are correct and only if you want to
know the program or function module please check following things.
1. Each Message type will having a posting program, genarally it will be a function module.
2. This function module will be attached to a Process code.
3. You can check the the process code name in the Partner profiles.
4. After knowing your process code, please check WE41 and WE 42 for the function module name.
5. From this you can debug and find out.
Points please if this info is helpful..............
Thanks,
Similar Messages
-
Adding fields with data type "TIMS" to the BP transaction
hi all,
This is Anil regarding the addition of fields to the BP transaction.
here my problem is for BP transaction I could not find any BADI or screen exit to add the fields. Even EEWB tool does not allow us to cretate the fields with data type "TIMS". so could you please suggest any other way to add these fields to BP?
when I enter the values to the time fields in BP transaction, they must reflect in
BUT000 table also?
Regards,
Anil .In the physical layer, Column Properties change the data type to int.
If still problem exists, In the Business Model, write a case statement like
case when column1=1 then 1 end
and apply count aggregation on the new calculated column,add the column to presentation table, use that new calculated column for report.
- Madan -
How to Transfer Database Table Field to Data Type in XI
Dear All,
Dear All,
I am working on scenario to transfer data(Database Table) from Non SAP System to SAP system through XI.
While Defining "Data Type" in XI i want to create Data Type as of Database table in my(Oracle Database).There is any direct method to import Database Table field into "Data Type" in XI.
thanks,
RPHi;
Edit plus is a tool using which you can edit your file and make changes to it.
You can download it from net ,just search for it on google.
this will help you to get in the field names of the table by editing the file .
Mudit -
How to set a default date for a custom field of Date type in project server 2010.
hi,
can somebody help me.
How Can i set the default date for a custom field of date type in project server 2010 ?Dear Rohan,
You can set default value to custom field thru Lookup table. Assign lookup table to custom field and set default value to some lookup value (Note: check the “Choose a value to use as a default when adding new item” checkbox).
Regards,
Avinash kumar | Blog:http://avigr8.wordpress.com | If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. -
How to set focus on field having data type other than character(eg. NUMC)
Hello all,
I have developed one screen having table control inside. In table control suppose if numeric type field is blank(eg. Employee number of data type NUMC), system should throw error message and should put cursor focus on that perticular filed. In the same table control for fields of data type 'CHAR', I have done this using 'SET CURSOR FIELD' .
Please, suggest me how to set cursor focus on the fileds of data type other that character(eg. NUMC)Have you tried it? SET CURSOR FIELD ... works fine for type 'N' fields in a table control. The restriction is 'character-type' and 'flat'. Type 'N' (or NUMC-like) fields are both.
-
Downloaded music apps o.k. Says login failed when I put in user and password. No trouble when getting any other apps.
Sounds like you may have deleted something you shouldn't have. Boot to an OS X DVD or a bootable backup, and using Disk Utility, do a repair disk, and while there repair permissions. Disconnect any peripherals, and reboot. If you get the same startup behavior, do a safe boot, by holding the shift key down when booting. If that works, try a normal boot. If neither step helps, you may need to relaod your operating system.
-
Whts the signifacnce of MANDT field wid data type CLNT in DB table ??
nybody pls explain in details?
Whts the signifacnce of MANDT field wid data type CLNT in DB table ??
why fields ( ex- Kunnr - CUSOMER NO. ) is repeated in many tables, but not as a Primary Key , so whts d need to include dis field in many tables? we can fetch the sem field from a single Table?/Hi sager
MANDT is field for client , means it describes the parcular data is for perticular CLIENT.
with this field you can contain data for multiple client is one table, that is the advantege.
and read some basic tutorial .
Thanks & Regards
Prashant Gupta -
Problem to get ResultSet when it is used a Date type in the query condition
hello ,
I having a bit of nightmare getting a ResultSet how result of one simple Query for a table when the condition WHERE involve a Date type.
To change the String value in a date to use in the query condition, I tried both:
String strDate = "dd/mm/yyyy";
(1.) java.sql.Date sqlDate = new java.sql.Date(strDate.getTime() )
(2.) SimpleDateFormat formatter = new SimpleDateFormat(strDate) ; sqlDate = formatter.parse(strDate);
and finally I use this code to get the ResultSet:
sql = "SELECT * FROM myTable Where (idCli = " + cd_Cli + " And dateReg = " + sqlDate + ")";
statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
resultSet = statement.executeQuery(sql);
boolean ok = resultSet.last();
totNumberOfRegistration = resultSet.getRow();
But In both the cases I get a empty resultSet.
I shoul like if someone would look my code to say me where it is the mistake...
thank you
tonyMrsangelo
P.S. I tryed using PrepareStatement too to get the ResultSet, but in that case I couldn't use the ResultSet because executing the statement resultSet.last() I get the error: "Result set type is TYPE_FORWARD_ONLY"In a database like Oracle, you need to use a function like TO_DATE; other databases may have something similar.
However, the proper way to do this is to use a PreparedStatement. Then you can say
PreparedStatement ps = conn.prepareStatement("update SOMETABLE set SOME_DATE=? where SOME_ID=?");
ps.setDate(1, new java.sql.Date(someJavaUtilDate.getTime()));
ps.setInt(2, theId);
ps.executeUpdate(); -
Error when trying to set a date type edit field
Hi all
I have an edit text field in a form which is bounded to a date type
database field using dbDataSource.
When i try to set the edit text field value with Today's date by code.
I recieve an error message that the value which
i'm trying to set is not legal. the error number is [131-183].
I use the following code to set the edit field:
If oEditText.Value.Trim = String.Empty Then
Dim strDate As String
Dim sboBob As SAPbobsCOM.SBObob =
oCompany.GetBusinessObjec(SAPbobsCOM.BoObjectTypes.BoBridge)
rs = sboBob.Format_DateToString(Microsoft.VisualBasic.Today)
strDate = rs.Fields.Item(0).Value.ToString().Trim()
Try
oEditText.Value = strDate
Catch ex As Exception
SBO_Application.MessageBox("error setting
current date: " & ex.Message)
End Try
End If
My question is how can i set the edit field with a valid value?Hi!
When writing to EditText.Value you must always use the B1 "DB-Format" as String.
The following examples are assuming (it's a must!) that the EditText-Fields are bound to a corrosponding DataSource (Type Date, Price etc...)
MyDateEditTxt.Value="20080207"
MyPriceEditTxt.Value="1341.79"
The best of it: It's Windows and SBO-GUI-Language independent.
EditText.String must always be written with the format of the actual Language of the SBO-GUI, which can be changed by the user....
You may also have a look at my statements regarding these problems near the end of this thread:
[How to pass date value to an UDF;
Cheers,
Roland -
Im getting an error when running a procedure that includes this code.
I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql
DECLARE @retval AS DECIMAL(12,2)
DECLARE @MonthVal VARCHAR(20), @SpreadKeyVal INT
DECLARE @sqlcmd AS NVARCHAR(150)
DECLARE @paramdef NVARCHAR(150)
SET @MonthVal = 'Month' + CAST(@MonthNumber AS VARCHAR(2) );
SET @SpreadKeyVal = @SpreadKey; --CAST(@SpreadKey AS VARCHAR(10) );
SET @sqlcmd = N' SELECT @retvalout = @MonthVal FROM dbo.CourseSpread WHERE CourseSpreadId = @SpreadKeyVal';
SET @paramdef = N'@MonthVal VARCHAR(20), @SpreadKeyVal INT, @retvalout DECIMAL(12,2) OUTPUT'
--default
SET @retval = 0.0;
EXECUTE sys.sp_executesql @sqlcmd,@paramdef, @MonthVal = 'Month4',@SpreadKeyVal = 1, @retvalout = @retval OUTPUT;
SELECT @retval
DECLARE @return_value DECIMAL(12,2)
EXEC @return_value = [dbo].[GetSpreadValueByMonthNumber]
@SpreadKey = 1,
@MonthNumber = 4
SELECT 'Return Value' = @return_value
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for:
https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
>> I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql <<
This is so very, very wrong! A column is an attribute of an entity. The idea that you are so screwed up that you have no idea if you want
the shoe size, the phone number or something else at run time of this entity.
In Software Engineering we have a principle called cohesion that says a model should do one and only one task, have one and only one entry point, and one and only one exit point.
Hey, on a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, your mindset is that level of sillyity and absurdity.
Do you know that SQL is a declarative language? This family of languages does not use local variables!
Now think about “month_val” and what it means. A month is a temporal unit of measurement, so this is as silly as saying “liter_val” in your code. Why did you use “sp_” on a procedure? It has special meaning in T-SQL.
Think about how silly this is:
SET @month_val = 'Month' + CAST(@month_nbr AS VARCHAR(2));
We do not do display formatting in a query. This is a violation of at the tiered architecture principle. We have a presentation layer. But more than that, the INTERVAL temporal data type is a {year-month} and never just a month. This is fundamental.
We need to see the DDL so we can re-write this mess. Want to fix it or not?
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Problem using SELECT-OPTIONS in an InfoSet with a field of data type UNIT.
I have created a simple InfoSet that links MARA with MARM. In the 'Selections' section of the InfoSet I have a variable named 'ZMEINH' defined as
Description: UOM
Selection Text: UOM
Format FOR: MARM-MEINH
EXTRAS: DEFAULT 'PAC' OPTION EQ SIGN I.
When I ran a query to allow selections on the MEINH field, instead of 'PAC' being the default, there was "***" showing in the UOM selection and if I attempted to execute the query it gave me a message that "Unit *** is not created in languague EN'. If I overide the "***" and enter 'PAC', I get the list of records that I expect.
I assume this is because MEINH has a data type of "UNIT".
How can I do a conversion so I can define a default value 'PAC' for MARM-MEINH in the infoSet that will carry through to any queries I created.
Thank you very much for any help.
Richard SalisburyThank you both for you help!
In our T006 there actually is a PAC and not a PAK. The T006A had as DE-PAK though.
I had this same type of language problem when trying to match an "order type". German is the "base" language in our system so maybe that means that raw data is stored with the German constant?
Anyway, I changed it to PAK and it works. When under a time schedule, that is what counts.
Thank you again for the quick response!
Richard Salisbury -
Problem in using a structure with a field of data type 'RAW STRING'
Friends
I have written a ZBAPI that imports a structure which has 5 fields. I have defined this in the IMPORT tab of Tr.Code <SE37>. One of the field of this structure is of data type 'RAW STRING'.
When I try to activate this BAPI, I get an error message as follows:
Function Module ZBAPI_ADD_CONFIG_DNA
"ZDAMPER_CON_DNA" Must be a flat structure. You cannot use internal table
strings, references, or structures as components.
Where ZDAMPER_CON_DNA is the table name that I am using.
FOR TESTING PURPOSE, WHEN I CHANGE THE DATA TYPE FROM 'RAW STRING' TO JUST A CHAR OF LENGHT 5, IT WORKS FINE.
Here is the source code of the simple BAPI that i am trying to activate.
FUNCTION ZBAPI_ADD_CONFIG_DNA.
""Local Interface:
*" IMPORTING
*" VALUE(CONFIG_DNA_DATA) TYPE ZCONFIG_DNA_STRUCTURE
*" EXPORTING
*" VALUE(MESSAGE) TYPE ZRETURNMESSAGE
tables: ZDAMPER_CON_DNA.
ZDAMPER_CON_DNA-CONFIG_ID = CONFIG_DNA_DATA-CONFIG_ID.
ZDAMPER_CON_DNA-STRING_NAME = CONFIG_DNA_DATA-STRING_NAME.
ZDAMPER_CON_DNA-STRING_FORMAT = CONFIG_DNA_DATA-STRING_FORMAT.
ZDAMPER_CON_DNA-STRING_VALUE = CONFIG_DNA_DATA-STRING_VALUE.
ZDAMPER_CON_DNA-OBJECT_NAME = CONFIG_DNA_DATA-OBJECT_NAME.
INSERT ZDAMPER_CON_DNA.
MESSAGE-SUBRC = sy-subrc.
if sy-subrc = 0.
MESSAGE-RETURNMESSAGE = 'SuccessfullyInserted'.
else.
MESSAGE-RETURNMESSAGE = 'Insert Failed'.
endif.
=============
ANY KIND OF FEED BACK WILL BE HIGHLY APPRECIATED.
THANKS
RAMHi ram,
there is no data element exists with the name RAW STRING ,
but check one of these names..
Data element Short text
C2S_RAWSTRING C2-Server: Data Element of Type Rawstring
N2_RAWSTRING Byte String of Variable Length
QISRDRAW_STRING Data in Format RAW Character String
RCF_RAWSTRING Rawstring
RPAP_TEMPLATE_RAWSTRING Blob of Template File
RSRAWSTRING Raw String
RSRD_RAWSTRING Binary Content in the Broadcasting Framework
SWH_RAWSTRING Workflow: Data Type RAWSTRING
WDR_RAWSTRING Byte Sequence of Variable Length
<REMOVED BY MODERATOR>
venkat.
Edited by: Alvaro Tejada Galindo on Mar 7, 2008 5:15 PM -
On load, getting error: Field in data file exceeds maximum length
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
I'm trying to load a table, small in size (110 rows, 6 columns). One of the columns, called NOTES is erroring when I run the load. It is saying that the column size exceeds max limit. As you can see here, the table column is set to 4000 Bytes)
CREATE TABLE NRIS.NRN_REPORT_NOTES
NOTES_CN VARCHAR2(40 BYTE) DEFAULT sys_guid() NOT NULL,
REPORT_GROUP VARCHAR2(100 BYTE) NOT NULL,
AREACODE VARCHAR2(50 BYTE) NOT NULL,
ROUND NUMBER(3) NOT NULL,
NOTES VARCHAR2(4000 BYTE),
LAST_UPDATE TIMESTAMP(6) WITH TIME ZONE DEFAULT systimestamp NOT NULL
TABLESPACE USERS
RESULT_CACHE (MODE DEFAULT)
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 80K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
I did a little investigating, and it doesn't add up.
when i run
select max(lengthb(notes)) from NRIS.NRN_REPORT_NOTES
I get a return of
643
That tells me that the largest size instance of that column is only 643 bytes. But EVERY insert is failing.
Here is the loader file header, and first couple of inserts:
LOAD DATA
INFILE *
BADFILE './NRIS.NRN_REPORT_NOTES.BAD'
DISCARDFILE './NRIS.NRN_REPORT_NOTES.DSC'
APPEND INTO TABLE NRIS.NRN_REPORT_NOTES
Fields terminated by ";" Optionally enclosed by '|'
NOTES_CN,
REPORT_GROUP,
AREACODE,
ROUND NULLIF (ROUND="NULL"),
NOTES,
LAST_UPDATE TIMESTAMP WITH TIME ZONE "MM/DD/YYYY HH24:MI:SS.FF9 TZR" NULLIF (LAST_UPDATE="NULL")
BEGINDATA
|E2ACF256F01F46A7E0440003BA0F14C2|;|DEMOGRAPHICS|;|A01003|;3;|Demographic results show that 46 percent of visits are made by females. Among racial and ethnic minorities, the most commonly encountered are Native American (4%) and Hispanic / Latino (2%). The age distribution shows that the Bitterroot has a relatively small proportion of children under age 16 (14%) in the visiting population. People over the age of 60 account for about 22% of visits. Most of the visitation is from the local area. More than 85% of visits come from people who live within 50 miles.|;07/29/2013 16:09:27.000000000 -06:00
|E2ACF256F02046A7E0440003BA0F14C2|;|VISIT DESCRIPTION|;|A01003|;3;|Most visits to the Bitterroot are fairly short. Over half of the visits last less than 3 hours. The median length of visit to overnight sites is about 43 hours, or about 2 days. The average Wilderness visit lasts only about 6 hours, although more than half of those visits are shorter than 3 hours long. Most visits come from people who are fairly frequent visitors. Over thirty percent are made by people who visit between 40 and 100 times per year. Another 8 percent of visits are from people who report visiting more than 100 times per year.|;07/29/2013 16:09:27.000000000 -06:00
|E2ACF256F02146A7E0440003BA0F14C2|;|ACTIVITIES|;|A01003|;3;|The most frequently reported primary activity is hiking/walking (42%), followed by downhill skiing (12%), and hunting (8%). Over half of the visits report participating in relaxing and viewing scenery.|;07/29/2013 16:09:27.000000000 -06:00
Here is the full beginning of the loader log, ending after the first row return. (They ALL say the same error)
SQL*Loader: Release 10.2.0.4.0 - Production on Thu Aug 22 12:09:07 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Control File: NRIS.NRN_REPORT_NOTES.ctl
Data File: NRIS.NRN_REPORT_NOTES.ctl
Bad File: ./NRIS.NRN_REPORT_NOTES.BAD
Discard File: ./NRIS.NRN_REPORT_NOTES.DSC
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table NRIS.NRN_REPORT_NOTES, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
NOTES_CN FIRST * ; O(|) CHARACTER
REPORT_GROUP NEXT * ; O(|) CHARACTER
AREACODE NEXT * ; O(|) CHARACTER
ROUND NEXT * ; O(|) CHARACTER
NULL if ROUND = 0X4e554c4c(character 'NULL')
NOTES NEXT * ; O(|) CHARACTER
LAST_UPDATE NEXT * ; O(|) DATETIME MM/DD/YYYY HH24:MI:SS.FF9 TZR
NULL if LAST_UPDATE = 0X4e554c4c(character 'NULL')
Record 1: Rejected - Error on table NRIS.NRN_REPORT_NOTES, column NOTES.
Field in data file exceeds maximum length...
I am not seeing why this would be failing.HI,
the problem is delimited data defaults to char(255)..... Very helpful I know.....
what you need to two is tell sqlldr hat the data is longer than this.
so change notes to notes char(4000) in you control file and it should work.
cheers,
harry -
Info on CCM 2.0 characteristics - Fields length, data types & Desc
Dear All,
Does anybody know how or where I can get information about CCM 2.0 standard characteristics data structure?
Or maybe the table name that holds this information?
I need the following info:
1. List of all Standard CCM 2.0 Characteristics
2. Characteristics Data types (i.e Char)
3. Characteristice Field lengths
I have looked into the SAP help for CCM 2.o and the on SAP Servicemarketplace under instguides&IBC....could not find every thing I wanted.
Regards,
GraceHi Grace,
you can look in tables
/CCM/C_CHAR
/CCM/C_CHAR_ALS
/CCM/C_CHAR_ASPT
/CCM/C_CHAR_TXT
/CCM/C_CHR_ALIAS
and
/CCM/C_DTYPE
/CCM/C_DTYPE_HDR
/CCM/C_DTYPE_T
/CCM/C_DTYPE_TXT
/CCM/C_DTYPE_VL
/CCM/C_DTYPE_VLT
in CCM to get the standard charcateristics and their default settings.
Chris -
PROBLEM WITH FIELD WITH DATA TYP FLTP
HI FRNDS
I AM HVNG A REQUIREMNT TO CALCULATE THE BREAKDOWN DURATION .
ACTUALY IN TRANSACTION IW32 WE CAN C THIS FIELD AS EAUSZT . BUT THIS IS COMIGN UP FROM THE STRUCTURE RIWO00 . SO IN TABLE QMIH I CAN C A FIELD AUSZT WHICH IS ALSO THE BREAK DOWN DURATION BUT I AM SEEING THE VALUE TO BE IN A DIFFRNT FORMAT AS FLTP CAUZE THIS FIELD IS OF DATA TYPE FLTP . CAN ANY BODY TELL ME HOW CAN I RETRIEVE MY REQUIRED DATA FROM THIS FIELD . I MEAN IS THERE ANY FUNCTION MODULE TO EXTRACT MY DATA .
THANX
ROHITi think it give u value in sec.
var = var / 3600
u get value in hr
ex--
data: var type AUSZT value '2.1600000000000000E+04'.
data: var1 type p.
var1 = var / 3600.
write:var1.
kishan negi
Maybe you are looking for
-
Aminated gifs only showing the last frame on the 2nd time of viewing
I have 2 animated gifs and on pressing a button i am changing between the 2 on te first click the animated gif runs sucessfully and clicking the button again the 2nd animated gif runs sucessfully. However when i go to run the first animated gif again
-
HT1688 my notes are deleting by themselves. What's going on?
Just recently my notes on my iphone 4s have been deleting not all of them at once but so far about 4 or 5 have been deleted. What can I do to retrieve them? They are very important to me.
-
Using types in pro*c/c++
HI all, I am trying to use oracle object types in pro*c/c++ program. Below are the detailes. objects being used OBJ_BACKGROUND_JOB , OBJ_BACKGROUND_JOB_ARRAY. ott infile : inpfile CASE=SAME TYPE OBJ_BACKGROUND_JOB TYPE OBJ_BACKGROUND_JOB_ARRAY ott co
-
Hello Guys! I'm having the following error in the RWB, > Component monitoring > Adapter Engine ..> Result of self-test Internal error: system status for cluster nodes 477459051 not available can you send me help about this Error? Thanks in advance. N
-
Safari in Win7 is FASTER than in Snow Leopard
And this running Windows from Parallels! When I load a page in Safari I check the network usage with iStat menus. It's often (but not always) stuck at 0.2-0.3KB/s. Or 0.0KB/s for few seconds. A page takes ages to load. Opening the same page in Window