Convert varchar to date in OBIEE-sql server database

Hi we have SQL server database,
and we need to convert varchar to to_date .
In OBIEE we use evaluate,cast etc on Oracle......Not sure about sql server..please help

i am usiing below formula in my reports-answer side:
Cast((case when "Job CV Fact"."Total Cv Sent" is not null then "DATE DIM".Date end)as Date)
below error is coming:
A general error has occurred. [nQSError: 46046] Datetime value 01/01/08 does not match the specified format. (HY000)
cast("DATE DIM".Date as date) the above error comes :)

Similar Messages

  • How can I get the data array from SQL Server Database?

    Hi,
    I can write a data array(2D)into a table of my SQL Server Database. The data array was writen to a column with image type. I know a data array is transformed a binary string when writing into database, but I dont know how to get the data array when I fetch the binary string from database.
    My question is:
    How to transform the binary string into data array? which vi's should I use? I have tried unflatten from string but failed.
    Any response is appriciated.
    Red

    happyxh0518 wrote:
    > I can write a data array(2D)into a table of my SQL Server Database.
    > The data array was writen to a column with image type. I know a data
    > array is transformed a binary string when writing into database, but I
    > dont know how to get the data array when I fetch the binary string
    > from database.
    >
    > My question is:
    > How to transform the binary string into data array? which vi's should
    > I use? I have tried unflatten from string but failed.
    In order to use Unflatten from string you first need to Flatten it
    before writing it. Also depending on the database driver, the returned
    data may actually not be binary but Hexadecimal encoded ASCII which you
    would first have to decode to binray.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • What is the best way to match back 3rd party vendor data to our SQL Server Database?

    So we have this 3rd party data that we need to match back to our database. We have determined that the "ID" column that the 3rd party is sending us back data is a concatenated key of our member's SSN, Gender, and CCYYMMDD Birthdate. In 90% of the
    cases, we can match back on this. However, the other 10% we have to try a couple of different ways...using our Member #, using what is called a HFCA #.
    We are talking about 10s and 20s of data here...NOT thousands.
    What is the best way to handle this via SSIS? A SQL Server Stored Procedure to cursor through the 3rd party data or multiple INSERT-SELECT statements trying to marry back the data? My thought process was to cursor through each record, try and match on our
    90% match, and then determine if we have a match or not, and then if we do not, then try our other means. Should I SELECT 1 to see which matching criteria to go with? So in other words, for the first match...
    IF EXISTS(SELECT 1 FROM TableName WHERE ColumnName1 = .....) BEGIN....ELSE...Blah Blah Blah
    or simply continue doing INSERT-SELECTS...
    I guess I am asking about the efficiency of using a cursor within a SQL Server Stored Procedure here.
    Thanks for your review and am hopeful for a reply.

    You are asking a SSIS question but posted in tsql - which is it?  But before you go further, which matching logic should have priority?  Member # or the SSN/gender/birthdate? Note that the priority does not depend on matching success percentage. 
    In other words, you may prefer to match on member # first (even though it has a lower success ratio but a higher confidence ratio), followed by ssn..., followed by whatever. 
    In any case, this sounds much more like a SSIS logic issue.  Your questions regarding cursors and stored procedures seem premature at this point. OTOH it may depend on what you are actually trying to accomplish.  

  • Convert VARCHAR to date in OBIEE

    I have an column Period Name and data as
    DEC-04
    DEC-05
    DEC-07
    I want to convert into date format ..so is there any way...i tried with cast but it through error.
    Thanks,
    S

    hi s,
    Try this out :http://varanasisaichand.blogspot.com/2010/01/how-to-change-data-format-to-our-custom.html
    or use evaluate function
    http://varanasisaichand.blogspot.com/2010/05/evaluate-function.html
    Thanks,
    Saichand.v

  • Retrieving Data from SQL Server Database

    Hi All,
    I am working with a program in which i have a requirement to connect to SQL Server Database
    and extract the data from the SQL Server Database. I am able to connect to the SQL Database but i am facing problem with the Select Statement. I have the Select Statement
    Select PARTNRID from GBA_SI.TRACKING and REFERENCEID3 from HEADER where TRANSTYPE = "INVOIC" and WICOMPLETEDDATETIME is within the date range specified in selection screen (Join on TRANSID).
    Can any one tell me how to write the Select Statement in ABAP for retrieving the data from the SQL Server Database.
    Regards,
    Sudhir

    hi check this..
    data: begin of itab occurs 0,
           PARTNRID  like GBA_SI-PARTNRID,
          end of itab .
    data: begin of itab1 occurs 0,
            TRANSID like header-TRANSID,
            TRANSTYPE like header-TRANSTYPE ,
            REFERENCEID3 like header-REFERENCEID3,
            end of itab1 .
    select-options:s_PARTNRID for GBA_SI-PARTNRID ,
                         s_date for sy-datum.
    Select PARTNRID
        from GBA_SI
             into table itab
    where PARTNRID in s_PARTNRID.
    select TRANSID
             TRANSTYPE
      REFERENCEID3 from HEADER
    into table itab1
    for all entries in itab
    where TRANSID = itab-PARTNRID
         and TRANSTYPE = "INVOIC"
    and WICOMPLETEDDATETIME  in s_date .
    regards,
    venkat appikonda

  • Problem inserting date into MS SQL Server

    I am trying insert date into MS SQL Server database. First I used Statement and when I insert the date only date used to be inserted properly and the time used to be always 12:00:00 AM. I tried PreparedStatement and when I insert I get an error message:
    SQL Error: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    I have attached the code.
    GregorianCalendar cal = new GregorianCalendar();
    java.util.Date dtm = (java.util.Date)cal.getTime();
    SimpleDateFormat formatOb = new SimpleDateFormat("dd/MM/yy hh:mm:ss");
    String date= (String)formatOb.format(dtm);
    dateCreated = new java.sql.Date(formatOb.parse(date).getTime());
    PreparedStatement psmt = con.prepareStatement("INSERT INTO Resume (ResumeName, Summary, Skills, OtherInformation, Interests, Memberships, Languages, Category, DateCreated, SupervisorName) VALUES(?,?,?,?,?,?,?,?,?,?)");
    psmt.setString(1, name);
    psmt.setString(2, summary);
    psmt.setString(3, skills);
    psmt.setString(4, info);
    psmt.setString(5, interest);
    psmt.setString(6, member);
    psmt.setString(7, language);
    psmt.setString(8, category);
    psmt.setDate(9, dateCreated);
    psmt.setString(10, loginName);
    psmt.executeUpdate();
    Any suggestions will be really helpful.

    Thanks,
    I changed the field in the database of DateCreated to timestamp, but when I insert the some binary data is inserted into the database. something like 0000000000000017D.
    I installed jtds-0.8.1 driver from source forge. but when try to connect to the database I get an error as:
    Connection refused: connect
    Error: Connection refused: connect
    I have attached the code for setting the driver and url also.
    private String driver = "net.sourceforge.jtds.jdbc.Driver";
    private String url = "jdbc:jtds:sqlserver://TEKKATTE:1433/placement;TDS=7.0";

  • Data Sharing with SQL Server

    I am working with another consultant that has a customer that is mainly .NET and SQL Server. They are looking at ways to share data between current SQL Server databases (up to 100) and a Oracle database. I figured a SQL Server/ Oracle Gateway may help but I am getting push back from about using either streams or replication. The question is how explain to the customer how to setup one or the other of these

    Can you clarify what "share" is intended to mean here? In particular, which system(s) are the source and which system(s) are the target?
    Streams is used to publish and consume changes in the form of Logical Change Records (LCRs). It would be possible to write code that would publish LCRs from a non-Oracle database, but that would require a potentially hefty amount of code. Consuming LCRs in a non-Oracle system tends to be the easier option.
    You can use Heterogeneous Services to create a database link from an Oracle database to a non-Oracle database (much like creating a linked server in SQL Server to a non-SQL Server database). With those database links in place, you can use materialized views to pull the data from the SQL Server systems into Oracle.
    http://tahiti.oracle.com has all the Oracle documentation online. There are multiple manuals that describe how to implement these various options.
    Justin

  • Connecting sql server database as source system into BW in unix/oracle

    Hi
    We have a requirement to extract the data from MS SQL server database as a source system into the BW3.0B instance, which is running under HP-UX/oracle.
    We have been told that Microsoft does not supply a SQL Server driver for UNIX.
    So in this case, we need to have a option to complete it.
    Please let me know if some one has any similar type configuration existing.
    VJ

    In general, BI application servers can only be supported for DB Connect on operating system versions where a SAP Database Shared Library (DBSL) has been released for the BI database and the source database.
    refer: http://help.sap.com/saphelp_nw70/helpdata/EN/58/54f9c1562d104c9465dabd816f3f24/frameset.htm for DB Connect supported DB's.

  • RickTextbox - getting and saving the text to and from SQL server database

    I have no trouble saving the data to an SQL Server database.  Here is a sample of what is saved.
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
    \viewkind4\uc1\pard\f0\fs17 testing the\par
    rich\par
    text box\par
    when I retrieve the text from the database, I end up with exactly what is shown above.  I am retrieving the text with a SqlDataReader.  here is the code that I am using;
    while (sqlDataReader.Read())
    string special_Instructions = ""; //first I was using this line but both lines have the same result // special_Instructions = sqlDataReader["Special_Instructions"].ToString();
    special_Instructions = sqlDataReader.GetString(5);
    special_InstructionsRichTextBox.Rtf = special_Instructions;
    any guidance or help will be greatly appreciated.
    dave

    Michael,
    Lets begin with, 'Thanks for your guidance'. With your last run of questions, I was able to figure it out.
    Here is what I learned, (by the way, this is in Winforms):
    When I checked the properties of the RichTextBox control, I saw and then remembered that the control was bound to the form.  First thing I did was comment out the code I was using (above) to fill the control and tested the program.  I actually
    received the same issue with the contents of the control as before.
    I then dropped a new RichTextBox control from the tool box to my form and positioned it next to the original control.  I un commented the above code and used it to fill the new
    richTextBox1.Rtf and ran the program.  The original control that was bound to the form still gave the incorrect result but the new control worked perfectly.
    I hope this helps others and Thanks again for your guidance.  If there is anything else you think could be added to this reply please let me know.
    dave

  • How to convert string to an integer in SQL Server 2008

    Hi All,
    How to convert string to an integer in sql server,
    Input : string str="1,2,3,5"
    Output would be : 1,2,3,5
    Thanks in advance.
    Regards,
    Sunil

    No, you cannot convert to INT and get 1,2,3 BUT you can get
    1
    2
    3
    Is it ok?
    CREATE FUNCTION [dbo].[SplitString]
             @str VARCHAR(MAX)
        RETURNS @ret TABLE (token VARCHAR(MAX))
         AS
         BEGIN
        DECLARE @x XML 
        SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
        INSERT INTO @ret
            SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
            FROM @x.nodes('//t') x(i)
        RETURN
       END
    ----Usage
    SELECT * FROM SplitString ('1,2,3')
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to convert Oracle database to Sql server Database

    Hi All,
    I have one database made in the Oracle 8i, i want to convert that database to Sql Server Database,
    Can anyone please give me the step by step process to do this conversion.
    Regards
    Ramesh Jha

    Try using the DTS (data transformation services) services of SQL Server 2000
    DTS is based on an OLE DB architecture that allows you to copy and transform data from a variety of data sources. For example: Oracle directly, using native OLE DB providers.
    Alternatively, you could follow the following broad steps for data migration (assuming you are retaining the same table structures in SQL Server, and that you are talking about SQL Server 2000).
    1. Get the CREATE scripts corresponding to each Oracle table / view / index. These can be reverse engineered from the database using a tool.
    2. Map Oracle datatypes to SQL server datatypes e.g: date maps to datetime/smalldatetime, numeric maps to one of int, bigint, smallint, etc depending on the range of values in the CREATE scripts.
    3. Indexes in SQL Server are of two types: Clustered / non-clustered. There can only be one clustered index on each table.
    4. Converting procedures and triggers will have to be line by line, since SQL Server uses a proprietary T-SQL instead of ORacle's PL/SQL
    I have yet to see a really good tool to do this migration, but it is possible to write a PL/SQL procedure / Pro*C program to automate the script creation for creating tables in the SQL Server database.
    For the actual data import into SQL Server, export the Oracle data table by table into flat files, and then use the import wizard of SQL Server enterprise manager

  • Plz its URGENT : Storing unicode data in MS SQL Server 2000 through JSPs

    Hello All,
    I'm trying to store unicode data, entered from JSP page into the SQL Server. For that I've tried the following :
    1> I put tag -
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    2> Also set in JSP tag -
    <%@page contentType="text/html;charset=UTF-8"%>
    But, still data is being entered in ISO-8859-1 format, don't know why. I tried with function for convertion - private String toUniCode(String strPar)-it successfully shows me the unicode data in alret msg, but it doesn't enters unicode data in SQL Server. In SQL Server only '??????' get entered. I kept data-type in SQL Server as nvarchar to store data in unicode.
    Would it be possible for me, to accept the data as UTF-8 itself & can I store it in SQL Server as it is? How can I do that? I'm accepting data in 'marathi' language.
    Plz, anybody Help me, I'm trying for this from around more than 1 week.
    Thanks in advance for any replies!

    Hello dmorris800,
    Thanx for your help. In fact I've tried lot many alternatives for that. Later I realised that it was problame of Driver, not of code. I was using jdbc:odbc driver which doesn't support unicode, or I don't know what was the problame with it.
    But I downloaded the driver named :'TaveConnect30C'. It is the connection optimised driver of Atinav.com This is the JDBC3 Type 4 Driver for MS SQL Server 6.5/7.0/2000 & trial version of which can be downloaded from http://www.atinav.com/download.htm
    It is really very good type-4 Driver.
    Cheers
    -Yogesh

  • TRANSFER DATA FROM MS-SQL SERVER TO ORACLE

    hello everybody
    can anyone tell me how 2 transfer or convert data from ms-sql server to oracle
    is there any utility
    if yes let me know .
    thanks in advance

    There are various options depending on how much data we're talking about, where you want the program logic, whether it's a one-time migration, etc.
    Among the options
    - Use SQL Server's DTS
    - BCP the data from SQL Server into flat files and use SQL*Loader to load it
    - Create a database link using Heterogeneous Services and Generic Connectivity to extract data from SQL Server
    - Use the Oracle Migration Workbench, which is now integrated into SQL Developer
    - Use an ETL tool like Oracle Warehouse Builder
    Justin

  • Can OBIEE 10G connect to a SQL Server database (2005)?

    We have Oracle BI running already. We have also a SQL Server database running. Now there is requirement that asks to connect to the SQL Server and directly send some SQL quires to the SQL Server and get result back and display it in answers. I know the normal process should be set ETL to load the data from the SQL Server to OBIEE and from there the report can be built. So I am not sure is this doable?

    Hi Srini,
    These is the steps I have done:
    1. open Oracle BI administration tool
    2. create a new repository
    3. select import from database, and specify the ODBC (connection to the SQL Server). It asked me to choose tables to import. I then selected one table. Now I can see the connection pool and the table being created in physical. I saved it.
    4. I then goes to BI interactive dashboard -> answers-> Direct Database Request. In the connection pool I entered the name of the connection pool in step 3. And entered some simple query and I got:
    error : Odbc driver returned an error (SQLExecDirectW).
    error : State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27022] Unresolved Connection Pool object: "asepostest_pool". (HY000)
    error : SQL Issued: {call NQSGetQueryColumnInfo('EXECUTE PHYSICAL CONNECTION POOL asepostest_pool select * from branch')}
    Should I modify NQSConfig.INI in C:\OracleBI\server\Config\ to make it point to my new repository? Like this?
    Star
    =
    asepostest1.rpd, DEFAULT;
    But then I couldn't restart BI server.

  • Convert Varchar to Date

    Hi
    im trying to convert varchar to date.
    So, i used To_date ( cilumn, 'DD-MM-YYYY') , Since i have to order the out put in Decending Order i used the same convertion function with Order by clause.
    The problem is ... the out put is not ordered,
    <sql>
    select date_created
    from
    select distinct
    to_date(created_date,'DD-MM-YYYY') as date_created
    from schedule_backup
    order by date_created desc
    <sql>
    out put is
    =================
    DATE_CREA
    26-NOV-09
    23-NOV-09
    19-NOV-09
    16-NOV-09
    11-NOV-09
    04-NOV-09
    30-OCT-09
    11-SEP-09
    04-MAR-10
    01-MAR-10
    25-FEB-10
    DATE_CREA
    22-FEB-10
    17-FEB-10
    15-FEB-10
    11-FEB-10
    09-FEB-10
    03-FEB-10
    27-JAN-10
    20-JAN-10
    15-JAN-10
    04-JAN-10
    thanks
    raj

    Hi, Raj,
    When you store dates in a VARCHAR2 column, you're asking for touble, so it seems that everything is working according to plan.
    Even aside from that, your query works perfectly for me.
    In the output you posted, the order is correct within each year, and you're only showing 2 digits of the year. Are you sure the centuries are right in the schedule_backup table? Perhaps everything that was supposed to be '2010' got enetereed as '1910' or '0010'.
    Post some sample data (CREATE TABLE and INSERT statements) that gets the wrong results with your query.
    For example:
    CREATE TABLE     schedule_backup
    (     created_date     VARCHAR2 (10)
    INSERT INTO schedule_backup (created_date) VALUES ('11-11-2009');
    INSERT INTO schedule_backup (created_date) VALUES ('04-11-2009');
    INSERT INTO schedule_backup (created_date) VALUES ('30-10-2009');
    INSERT INTO schedule_backup (created_date) VALUES ('11-09-2009');
    INSERT INTO schedule_backup (created_date) VALUES ('04-03-2010');
    COMMIT;

Maybe you are looking for

  • Oracle DB 10g to 11g Upgrade

    Hi, We have a SAP Oracle Database, the size is 1.5 TB. The Hardware details are Application – SAP ERP 6.0 EHP5 SPS6 Database – Oracle 10.2.0.2 OS Platform – AIX 5.3 TL05, SP06 HW – 8 Dual Core CPU's, 256 GB RAM on DB-CI server Test Environment : 32 G

  • LMS4.1 aggregated duplicate MAC-Report

    Hello, We want to quickly identify ports with probably attached mini-switches/hubs. Does a report type exist in LMS4.1 showing duplicate MACs aggregated with its count of occourence, not line by line? Is it planed to bring out basic aggragate functio

  • Windows Phone for DX 12 development?

    I already posted on the atter on StackExchange, but got no answer, so I thought I'd repost here: I was somewhat disappointed that MWC2015 passed by and noone mentioned Windows (Phone) 10. Does anyone have relevant information?

  • How do I identify SIM card number in iPad?

    I know how to reveal the number for my SIM in iPad 2 by going into "Settings". But I'm having difficulties to do the same with the next generation of iPad, i.e. iPad with Retina Display model. Would appreciate if someone could guide me on this please

  • All About BDC

    Hi Folks, Can anyone here please provide me some links through which I can know more about BDC. Thanks. K.Kiran.