[Q] Using viewCriteria for Date type

To Query data, I used ViewCriteria.
But it works well for Varchar2, Number type.
But it does not work for Date type.
for example
If I set variables like the below, it works,
attrName = "OrdName";
attrValue = "Nick";
But, If I set variables like the below, it does not work
attrName = "AppDate";
attrValue = "04.5.12";
ViewCriteria vc = order.createViewCriteria();
ViewCriteriaRow vcr = vc.createViewCriteriaRow();
vcr.setAttribute(attrName, attrValue);
vc.addElement(vcr);
order.applyViewCriteria(vc);
order.executeQuery();
Can I solve this problem ?

using a custom expression in the view criteria, ex.
vcr.setAttribute("DateField", "LIKE TO_DATE('" + dateField.toString() + "', 'yyyy-mm-dd')");
similarly, you can use other expressions to remove the default BC4J problems w/ dates (>, <, between) - At least I know you can't use = to get it to work right.
The default handling of BC4J is to say = TO_DATE(whatever you put in the value portion) where it needs to be LIKE to work properly - for some reason - probably a patch is available for it.

Similar Messages

  • Problem in using OCIBindByName  for date type column

    Hi,
    Can you please guide me about my following problem?
    I am trying to fetch the data from system table "FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$" in Oracle Express edition 10.2.0.3 database, using the OCI library on Windows with C++
    This table has a TIMESTAMP column of date type.
    I've the following query as below:
    select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > to_date('31/OCT/12 23:59:59', 'DD-MON-YY HH24:MI:SS') order by TIME_STAMP asc;
    For this, first I am preparing the query as below:
    select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > :PKVAL order by TIME_STAMP asc;
    Before calling OCIExecute(), I am setting the PKVAL buffer to following value:
    "to_date('31/OCT/12 23:59:59', 'DD-MON-YY HH24:MI:SS') "
    & calling the OCIBindByName function with data type as SQLT_DATE.
    But when the OCIExecute is called, my program crashes with access violation
    Can you please guide me what is the correct way to pass the date value in query to OCI? How do we bind the date values?
    Thanks in advance for your time and help.
    Best Regards.

    I had a similar problem. TO_DATE doesn't appear to function w/ BindByName or BindByPos.
    You are going to have to bite the bullet and use an actual date.
    Here's an example (I am using two dates in my query):
    int main (int argc, char **argv, char **envp)
    static text invalidQuery = (text )"SELECT f1.my_val, COUNT(f1.my_val) invalid_count, (SELECT COUNT(*) FROM my_db_table f2 WHERE f2.my_val = f1.my_val AND f2.foo_dt = :1 ) total_count FROM my_db_table f1 WHERE f1.foo_dt = :1 AND ( (f1.vld_bar_sw IS NULL OR f1.vld_bar_sw = 'N') OR (f1.vld_foo_sw IS NULL OR f1.vld_foo_sw = 'N') ) group by my_val order by my_val asc";
    OCIDate boundDateVal;
    sb2 inputYear;
    ub1 inputMonth;
    ub1 inputDay;
    char inputYearStr [] = "0000";
    char inputMonthStr [] = "00";
    char inputDayStr [] = "00";
    /* I get and validate the date as input, but you can set it however you'd like */
    inputYear = (sb2) (atoi (inputYearStr));
    inputMonth = (ub1) (atoi(inputMonthStr));
    inputDay = (ub1) (atoi(inputDayStr));
    /* Allocating Date*/
    OCIDateSetDate ( &boundDateVal, inputYear, inputMonth, inputDay );
    OCIDateSetTime( &boundDateVal, 0, 0, 0);
    returnVal = OCIBindByPos(invalidStmt, &firstInputBindHPtr, myErrorHandle, (ub4) 1,
    (dvoid *) &boundDateVal, (sword) sizeof(boundDateVal),
    SQLT_ODT, /*dty OCIDate*/
    (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT);
    if ( !(returnVal == OCI_SUCCESS || returnVal == OCI_SUCCESS_WITH_INFO) )
    displayErrors (returnVal, myErrorHandle, "OCIBindByPos-contactDate 1 ");
    cleanup();
    exit(1);
    }//if
    returnVal = OCIBindByPos(invalidStmt, &secInputBindHPtr, myErrorHandle, (ub4) 2,
    //(dvoid *) &InputArguments.contactDate, (sword) sizeof(InputArguments.contactDate),
    (dvoid *) &boundDateVal, (sword) sizeof(boundDateVal),
    SQLT_ODT, /*dty OCIDate*/
    (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT);
    if ( !(returnVal == OCI_SUCCESS || returnVal == OCI_SUCCESS_WITH_INFO) )
    displayErrors (returnVal, myErrorHandle, "OCIBindByPos-contactDate 2 ");
    cleanup();
    exit(1);
    }//if
    }//main
    ** I have had issues w/ OTN not correctly translating certain characters, so hopefully the above example is readable or you can figure out which characters may be missing.

  • Domain for data type in Oracle 8i database

    Hi Sir,
    Does Oracle database supports domain creation for data type.
    for example, can I create a domain called shorttext which is VARCHAR2(50). Then when I specify a data type for a column in table, then I just declare the column as domain.
    eg. address SHORTTEXT;
    --where SHORTTEXT is a domain.
    How is this implemented in Oracle database and supported by front end tools like Oracle Developer 6.0.
    Hope someone can provide some clear explanation on this.
    Thanks.

    The ordimagesignature is not something you can see or hear. It is strictly binary metadata about the image, used only to compare images to each other.
    What are you trying to do?
    Larry

  • ADF View Object query to use Oracle  LONG data type

    Hi,
    I'm using a view object that uses Oracle LONG data type.The following exception is thrown
    *"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
    I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
    Please suggest me a way
    Thanks in Advance
    Felix

    Thanks for your reply Arun,
    I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
    In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
    Thank you all guys who have seen this post.
    Regards,
    Felix

  • Date type-specific Customizing missing for date type ACTActPln

    Hi all.
    I'm using a Web Service obtained by copying the CRM 7.0 built-in WS APPTACTCRTRC.
    I'm using it to create Appointments using an Adobe Interactive Form.
    It goes everything fine (a Date is created in the system, with all the input data properly set) excepted the dates...
    The WS uses two TIMESTAMPS, TIMESTAMP_FROM for StartDateTime and TIMESTAMP_TO for EndDateTime, whereas the GUI transaction to create Dates accepts dates and times in separated fields.
    Going in Debug I can see that the execution ends with the following error, referred to the involved entity (CRM_APPOINTMENT):
    Date type-specific Customizing missing for date type ACTActPln
    CRM_APPOINTMENT uses date profile 0000000001 with three possible date types: ORDERACTUAL, ORDERPLANNED and ORDERPROPOSED and I cannot find anywhere date type ACTActPln (just to add it in customizing).
    Is anyone able to enlight me?
    Thank you in advance!
    Alessandro
    PS I've years of experience in Java programming but I'm quite new to the SAP world. Maybe the problem is not a problem at all, but it seems to me as such. Even if it has a trivial solution, please let me know. Thx!

    Hi,
    Well I was about to write that you should enter date in decimal format. but you already did that as mentioned in How to set a date in a Form where the bound date format is a decimal?
    In response to following from above thread (copied for others to understand my response)
    Hi all.
    I'm successfully using the LiveCycle Designer and I've managed to remotely create Appointments using a CRM Web Service (a mere copy of APPTACTCRTRC).
    The only problem I'm encountering is that I'm not able to set the dates/times (start and end of the appointment).
    Dragging each of the two fields from the WSDL based Data Connection I obtain a Decimal Field limited to 15 digits.
    How can I write a date and time in such a field?
    I've tried with a retroverse date as YYYYMMDDHHmmss (for example, 20100301124500) but it does not work
    (the appointment is indeed created, but with the start date and time fields filled with
    the current date/time and the end date and time fields filled with the current date and time plus 10 minutes).
    The retroverse date above is only 14 digit long, so, maybe, this is the problem.
    But, given the field definition, I'm not able to fill a blank space between the date and the time.
    I'm not able to put a dot either.
    What should I do?
    Any suggestions?
    Thank you in advance.
    Alessandro
    15 digit in UTC time format here is fraction of second so you should enter 201003011245000 (add one more zero).
    14th Oct 2010 16:00 should be written as 201010141600000, so just try it and and see if it works, I guess if you do not supply end time then by default it will be starttime + 10 min but this is just guess.
    Regards,
    Gourav

  • Conversion Exit for data type FLTP

    Can someone suggest me a conversion Exit for data type FLTP?

    Hi,
    CHAR_FLTP_CONVERSION
    FLTP_CHAR_CONVERSION
    Have a look at the function module documentation.
    Regards,
    Reema.
    PS. pl. award points to useful answers.

  • Use of segment, data-type or segment not supported in this position

    A message sent to adapter "FILE" on send port "SendPort1" with URI "D:\Shared Files\Coparn\%MessageID%.xml" is suspended.
    Error details: Unable to read the stream produced by the pipeline.
    Details: Error: 1 (Segment level error)
    SegmentID: TDT
    Position in TS: 2
    15: Use of segment, data-type or segment not supported in this position.
    Im getting the error while trying to generate COPARN EDI file using BizTalk.
    When I checked all the elements are occurring in the correct positions with accepted values only. Kindly assist.
    Regards, Vivin.

    There seems problem with your Pipeline component ,I would suggest to debug the Pipeline component to verify the exact issue you are facing.
    There is similiar thread for thsi issue which can provide you the guidance .
    http://social.msdn.microsoft.com/Forums/en-US/f80c870c-a4f9-4d65-9d3c-d43d7f060557/biztalk-console-error-message-unable-to-read-the-stream-produced-by-the-pipeline?forum=biztalkediandas2
    Thanks
    Abhishek

  • External definition and used them as Data Type Templates

    hi all
    how to Develop external definition and used them as Data Type Templates .
    Thank u
    Swari

    HI
    External Definitions: If a definition of the message structure exists in wsdl, xsd, dtd formats, we can use it in the integration repository by importing it as an external definition.
    External Definations:
    An external definition enables you to import a local WSDL, XSD, or DTD file to the Integration Repository and specify which parts of the schema to extract as the description for a message. You can use these extracted message schema as:
    Output or input messages in message interfaces
    Source or target structures for message mappings
    There is a series of standard schema for describing the message structure at runtime. WSDL (Web Service Description Language), XSD (XML Schema Definition Language), or DTDs (Document Type Definitions) are often used to describe message schema. If a description of the message structure already exists in one of the above formats, you can use it in the Integration Repository by importing it as an external definition rather than re-entering it manually using the data type editor.
    Have a look at
    http://help.sap.com/saphelp_nw04/helpdata/en/43/ce49ef1019087ae10000000a1553f6/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/d4c23b95c8466ce10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/26/9e97b0f525d743882936c2d6f375c7/content.htm
    cheers

  • Help with Multi point chart plot hile using the waveform data type..

    Currently I have two channels being transfered into the AI C-Scan block (by means of a build array) in hopes to display the outputs on a chart as well as an output file. As an outout I am using the waveform data type, as I hear this is the way to go. Problem is that I have the the Waveform chart directly connected to the waveform out put the the AI C-SCAN block but nothing is being displayed on the chart. Although the time is updated on the chart it is listed as the year 1903. I do have data these channels as the there are digital outputs for these channels. Perhaps I should use the AI CONFIG and AI READ clocks rather than this AI C-SCAN. Any ideas...

    Christian,
    Please see the Real-Time Chart shipping example for LabVIEW. This example describes how to set the base time of the chart so that the time and date are correct.
    You may want to autoscale the Y-axis as your data may be out of range of your chart and that is why nothing is seen.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Problem importing two service interfaces using the same data types

    Hi,
    I've been playing around with BPM for a while. Now I wanted to add a custom service interface to my starting event. I created the interface in ESR of CE 7.11. After importing I get this error message and I can't use the interface:
    Cannot change XsdSimpleTypeDefinition AcademicTitleCodeContent by importing the document http://sap.com/xi/APPL/SE/Global::src/wsdl/TestInterface.wsdl, because it is already defined in the document http://sap.com/xi/APPL/SE/Global::src/wsdl/rootwsdl_CustomerERPByIDQueryResponse_InService.wsdl in this project. Importing into another project might be possible.
    Of course the problem is clear, but how can I achieve importing two service interfaces that use the same data type without changing the xsd source?
    Thanks in advance,
    Mane

    Sorry for the late answer, but I am really busy at the moment.
    Unfortunately I can't the Interface and data types are already changed.
    But this happened various times. Each time I already had imported a SAP Enterprise Service into NW BPM that contains a bunch of inline data types. While creating my own interface I referenced one of those data types that are stored in a SAP namespace. After import the error message appeared.
    In the wsdl of the created interface there is a import statement for the namespace where the referenced data types origin from. Additionally there is a namespace definition xmlns:p1="SAPnamespace". In the element the type is "p1:ReferencedType". Could this maybe cause the error, because one time it is with this leading p1 in my created wsdl and once without in the SAP Service wsdl?
    Thanks and I am looking forward to next EhP of NW BPM,
    Mane

  • [Access 2010] Change default formats for data types

    Whenever I import data, the default format for Boolean data types is "-1,0." I know how to subsequently change this format to "Yes/No," but I'd like to change the default
    setting to "Yes/No." Is this possible?
    Thanks in advance.

    Hi,
    I found you post the same question in other place and got the advice. I agree with Mr. Kees suggestion. The data type is a build-in default setting with Access, we can't change it. We may try the workaround via VBA to test.
    http://forums.cnet.com/7723-6129_102-627633/access-2010-change-default-formats-for-data-types/#message5617496
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Have a good time.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Can I use JDeveloper for Data mining

    Can I use JDeveloper for Data mining, instead of using stand-alone data miner.
    Secondly, if I can, do we require to create another schema and run all the required scripts for data miner or it is not necessary.
    Thanks in advance.

    ODM 9i provided a JDeveloper Pluggin called DM4J. In ODM 10g, this was replaced by the standalone Oracle Data Miner GUI. In 10g, you can use the API in JDeveloper, but there is no support via wizards or viewers.
    However, models that you create via the API through JDeveloper could be used in Oracle Data Miner for testing, scoring, and model detail viewing.

  • Possible? Using External Definitions for data type/message type definitions

    Hi all,
    i want to use external definitons in my own data type definitions. Is that possible? And if yes, how?
    I imported many definitions via a mass import. Now I also want to use these definitions for further interfaces (than the imported ones). The most convenient would be of course to just use them as a custom created type. Can I somehow "convert" an external definition to a data type/message type?
    KR
    Felix

    Hello Felix,
          The External defination which you has been imported that cant use in DT and MT but yeah you can use this in Service interface.
    you cant modify that External defination if you want to do that then 1st of all modify it and then reimport it as an another external defination.
    and creating service interface with this ED you can use it in your message mapping .
    i hope this will help to you to clear your doubt.
    Monica

  • Issue when SelectOneChoice is used with Domain data type in JDev 11.1.2.0.0

    Hi,
    I am facing one issue while working with SelectOneChoice along with Custom Domain data type. Sample app to simulate the issue is available at http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Issue Details.
    Base view object’s attribute is of type CustomString, for which another static VO’s attribute is attached as LOV. LOV attribute is of type String. Because of this data type mismatch between LOV VO attribute and Base VO attribute, while working in screen, initially we were facing Class cast exception.
    Cannot convert <<LOV Attr. Val.>> of type class java.lang.String to class model.domain.common.CustomString This is not only for this type of SelectOneChoice but also for InputText field whose underlying VO attribute is of type CustomString (i.e. any Custom Domain type)
    On raising this in Jdeveloper forum, I came to know that adding a default oracle converter against the UI Component will take care of converting to respective data type. After added the converter for InputText and SelectOneChoice components, this issue got resolved. This was our lesson while working in Jdeveloper version 11.1.1.3.0. Converter we used,
    <f:converter converterId="oracle.genericDomain"/> When we try the same scenario in Jdev Version 11.1.1.4.0, without having the oracle converter itself, SelectOneChoice started working fine!! (i.e. it is able to set the base attribute with LOV attribute’s value but with proper base attribute’s domain data type). Anyhow, converter is required for InputText.
    When we try the same scenario in Jdeveloper new version 11.1.2.0.0, it started giving class cast exception when we don’t have oracle converter for SelectOneChoice. But by adding it, though it didn’t give such class cast exception message, though a selection is made in SelectOneChoice, VO attribute has not been updated with the new value. Instead it is updated with null value (Checked the setter method of view row impl by having break point) . Because of this, after a selection is made, when we try to read the attribute value from VO on button click, VO attribute always returns null.
    We have also tried our own converters but there is no change in the behavior.
    The above misbehavior can be tested either by having SOP programmatically or by refreshing the SelectOneChoice by giving its id as Partial trigger to itself with autosubmit set to true, so that the selected value will be reset to null irrespective of the selection made.
    For convenience, Issue details with Sample application is shared. Shared link : http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Shared folder contains
    1. Sample App developed on Jdev 11.1.1.4.0 to ensure it didn’t give this error.
    2. Sample App developed on Jdev 11.1.2.0.0 to simulate this error.
    3. Error details in a document.
    Can anybody have a look at this and tell me why this misbehavior and is it a bug? If so, any workaround available to continue the development?
    Thanks in Advance.
    Raghu
    Edited by: Raguraman on Sep 10, 2011 10:31 AM

    Sorry for the late reply John and Frank. Ya i did. Thank you.
    One more detail:
    I tested the behavior in Jdeveloper 11.1.2.0.0. The recent surprise is Select One Choice is behaving perfectly when it used in Grid layout and fail to work when it is form layout. I am getting surprised why behavior of component varies based on the way it refers the binding.
    for form layout,
    value=#{bindings.
    for grid layout,
    value=#{row.bindings.
    The bug details (#/title) are Bug 12968871 - RUNTIME CONVERSION FAILURE WHEN USING CUSTOM DOMAIN OBJECT VALIDATION IN EO
    Edited by: Raguraman on Sep 12, 2011 8:23 PM
    Edited by: Raguraman on Sep 12, 2011 8:31 PM

  • Unicode Migration using National Characterset data types - Best Practice ?

    I know that Oracle discourages the use of the national characterset and national characterset data types(NCHAR, NVARCHAR) but that is the route my company has decide to take and I would like to know what is the best practice regarding this specifically in relation to stored procedures.
    The database schema is being converted by changing all CHAR, VARCHAR and CLOB data types to NCHAR, NVARCHAR and NCLOB data types respectively and I would appreciate any suggestions regarding the changes that need to be made to stored procedures and if there are any hard and fast rules that need to be followed.
    Specific questions that I have are :
    1. Do CHAR and VARCHAR parameters need to be changed to NCHAR and NVARCHAR types ?
    2. Do CHAR and VARCHAR variables need to be changed to NCHAR and NVARCHAR types ?
    3. Do string literals need to be prefixed with 'N' in all cases ? e.g.
    in variable assignments - v_module_name := N'ABCD'
    in variable comparisons - IF v_sp_access_mode = N'DL'
    in calls to other procedures passing string parameters - proc_xyz(v_module_name, N'String Parameter')
    in database column comparisons - WHERE COLUMN_XYZ = N'ABCD'
    If anybody has been through a similar exercise, please share your experience and point out any additional changes that may be required in other areas.
    Database details are as follows and the application is written in COBOL and this is also being changed to be Unicode compliant:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    NLS_CHARACTERSET = WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET = AL16UTF16

    ##1. while doing a test convertion I discovered that VARCHAR paramaters need to be changed to NVARCHAR2 and not VARCHAR2, same for VARCHAR variables.
    VARCHAR columns/parameters/variables should not by used as Oracle reserves the right to change their semantics in the future. You should use VARCHAR2/NVARCHAR2.
    ##3. Not sure I understand, are you saying that unicode columns(NVARCHAR2, NCHAR) in the database will only be able to store character strings made up from WE8MSWIN1252 characters ?
    No, I meant literals. You cannot include non-WE8MSWIN1252 characters into a literal. Actually, you can include them under certain conditions but they will be transformed to an escaped form. See also the UNISTR function.
    ## Reason given for going down this route is that our application works with SQL Server and Oracle and this was the best option
    ## to keep the code/schemas consistent between the two databases
    First, you have to keep two sets of scripts anyway because syntax of DDL is different between SQL Server and Oracle. There is therefore little benefit of just keeping the data type names the same while so many things need to be different. If I designed your system, I would use a DB-agnostic object repository and a script generator to produce either SQL Server or Oracle scripts with the appropriate data types or at least I would use some placeholder syntax to replace placeholders with appropriate data types per target system in the application installer.
    ## I don't know if it is possible to create a database in SQL Server with a Unicode characterset/collation like you can in Oracle, that would have been the better option.
    I am not an SQL Server expert but I think VARCHAR data types are restricted to Windows ANSI code pages and those do not include Unicode.
    -- Sergiusz

Maybe you are looking for

  • PTP - Change to stock type field status configuration in Purchase Order

    When creating or changing a PO for direct material - or even during goods receipt, the stock type field which by default is "X - Quality Inspection" can be changed to "Unrestricted Use" by the purchasing personnel.  This is not in line with QA requir

  • Hyper-V VM can't start with VHD attached, error 0x80070422

    Hi, i'm in a big trouble with Hyper-V on a Windows 2008 R2 server. Hardware is a HP Proliant DL360 G7. Role are DC, Hyper-V (yes, i know it's not recommended), AV client is Kaspersky Endpoint Security 10.2, and everything was working fine for more th

  • How to put a delay between Sender Adapter processing ?

    Hi, I'm using FTP type and I schedule the sender each 1hour. In that time, plenty of file has been added into the source folder. The files are like this <file_name_###>.txt where the ### are a incremental number. PI can takes all of them in order tha

  • How can I View the Digital Booklet for my Albums?

    I have a few albums in my library with digital booklets, but have never been able to view them.  I am working on Windows 8 right now, and have the updated version of iTunes. Anyone have a solution?

  • Air print compatability

    does my officejet 6500a support air print, i'm thinking of getting an ipad air and would like to know before i do if it will work with my printer