MS Visual C++ and ORACLE datatypes

I am using MS C++ and ADO to pass a date parameter to an
ORACLE stored procedure. The stored procedure is expecting an ORACLE DATE value. I am passing a COleDateTime variable as in the following code:
COleDateTime     calltime = COleDateTime::GetCurrentTime();
pParam = pCommand->CreateParameter("",adDate,adParamInput,sizeof(DATE),(DATE)calltime);
pCommand->Parameters->Append(pParam);
pParam.Release();
ORACLE is only seeing the date portion not the time. The time is 00:00. Can anybody explain to me how to pass a date/time value properly ?
Thank you.

Some code thats seems to work setting a date column in a recordset:
SYSTEMTIME TimeStruct;
CTime t;
COleDateTime date;
t = lpEnt->UpdateDate;
t.GetAsSystemTime(TimeStruct);
date.SetDateTime(TimeStruct.wYear, TimeStruct.wMonth, TimeStruct.wDay, TimeStruct.wHour, TimeStruct.wMinute, TimeStruct.wSecond);
pRstEnt->Fields->GetItem("updatedate")->PutValue((_variant_t)(float)date);

Similar Messages

  • Visual Cafe and Oracle thin driver

    I have created a java applet using visual cafe and oracle think
    driver. The applet connects to database within the visual cafe
    environment. If I try launching applet locally within a browser
    I get the following error "Error:securit. Couldn't connect to
    'host' within origin from 'local_classpath_classes" Any help is
    greatly appreciated.
    THanks
    John Famolaro
    null

    John
    I also had this problem. Its a general security problem.
    Because your trying to connect to another machine, you
    must sign your applet to get full security privelages from
    within your browser. The sandbox within the JVM of the browser
    doesn't let you open connections to other machines.
    (Although my original understanding was that if the applet
    was stored locally, then you had full privelages - but it
    didn't work like this for me.)
    Try signing your applet.
    steve
    John Famolaro (guest) wrote:
    : I have created a java applet using visual cafe and oracle think
    : driver. The applet connects to database within the visual cafe
    : environment. If I try launching applet locally within a
    browser
    : I get the following error "Error:securit. Couldn't connect to
    : 'host' within origin from 'local_classpath_classes" Any help
    is
    : greatly appreciated.
    : THanks
    : John Famolaro
    null

  • Visual Age and Oracle Drivers

    Does Any one know how to set the path when running Visual Age and
    Weblogic 4.5.1. I can not get the set the PATH or ORACLE_HOME in
    VisualAge so the connection pool will start
    Mike Howard
    Cessna Aircraft Compan

    Mike Howard wrote:
    >
    Does Any one know how to set the path when running Visual Age and
    Weblogic 4.5.1. I can not get the set the PATH or ORACLE_HOME in
    VisualAge so the connection pool will startVisualAge uses the system PATH, as far as I know there's no way to
    change it within the environment. You can change your global PATH, or
    you can set the PATH in a command window, and then run 'ide.exe' in the
    IBMVJava\ide\program directory.
         -- Jim

  • Visual C++ 6.0 and Oracle

    Hii..
    I m using Visual c++ 6.0 and Oracle 10 g. I m very new to vc++. And i would lik to build some database applications.
    I couldnt find any resource in the net.
    can anyone help me ?? Send some sample codes and documents !!
    sankar.s

    BTW this is not the right forum for C++ stuff, this one's meant for anything related to ODBC
    I guess you meant building database applications using C++
    For that you can use OCCI, following link can provide some info on OCCI with few samples
    http://www.oracle.com/technology/tech/oci/occi/index.html
    For detailed documentation on OCCI you can browse
    http://download.oracle.com/docs/cd/B12037_01/appdev.101/b10778/toc.htm

  • Visual Web Developer 2010 Express and Oracle ODAC - Oracle data provider

    system - xp pro
    Microsoft Visual Web Developer 2010 Express and Oracle ODAC112021.
    I can't seem to get the ODAC to work correctly with the Web Developer Express. When putting in a gridview I only see the standard adapters. The one from Oracle does not appear. I have spent days trying to figure out why but no luck. No one else seems to have this problem. I do not see any errors when I installed the ODAC. I've followed a few tutorials.
    http://weblogs.asp.net/nannettethacker/archive/2010/09/17/installing-oracle-data-access-components-odac.aspx
    and
    http://www.smart-soft-nz.com/oracle-and-asp-dot-net.html
    I tried using the Windows adapters but they just don't seem to work. I can get results in the query builder but when I go to the next step in the wizard I get the constraints error. I've done all the research on that with no luck so I wanted to use the ODAC. This killing me! This really shouldn't be that hard. I've added the dll to the references but again it's just not an option. If anyone could give me a little direction that would be great!!!!!!!!!!!!!!!!!!!!!!
    Thank you
    John

    Dear Friends,
    Installing SP1 and updates to it solved the first issue. So the database now seems to be of type 2008 R2.
    Deleting some files solved the second issue.
    However, another issue remains.
    My most important projects were created with a version of VWDX 2010 that was downloaded from Microsoft and installed on July 3, 2012. This version of VWDX has now been lost, because my hard drive recently ceased to function and had to be replaced.
    On the new hard drive I have a version of VWDX 2010 that was downloaded yesterday (May 28, 2014). As indicated above, I also installed SP1 and related updates.
    When I load a project that was created in the version of VWDX 2010 that was installed almost two years ago and try to open the database connection, I get, in essence, the following error message:
    "The database C:\Users\...\Database.mdf cannot be opened, because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported."
    So it seems that the original database version was 661, whereas the version downloaded yesterday is 655. It seems very strange that a version downloaded now should be earlier than a version downloaded two years ago. Does anyone have an explanation or a solution?
    Thank you all for your trouble, and best regards.
    Eric (orexin)
    P.S. The site from which I obtained VWDX yesterday was:
    www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-web-developer-express and the executive was called VWD2010SP1AzurePack.exe.

  • Looking for comparison between MS Visual Source Safe and Oracle SCM

    Hi,
    I am looking for some comparison between MS Visual Source Safe and Oracle SCM.
    What I need is technical feature comparison (not just marketing comparison stating that Oracle SCM is better for everything is stored in the very reliable Oracle database(although this is a good point)).
    Any help in this area will be helpfull.
    Best regards,
    Mihail Daskalov

    Thanks you for your answer,
    I like very much Oracle SCM, which I use extensively.
    I have very little experience with MS VSS (only on my local machine). I have never tested it in a network environment with multiple developers.
    I would like to convince other developers to switch to Oracle SCM, but I need to know what to tell them.
    I'm actually both a developer and DBA, and I do like the safety the Oracle Database offers for storing files inside.
    I like very much the opportunity to connect with Oracle Repository Navigator from a remote location to my database through Connection Manager and to be able to work with my projects. (There is an issue with this configuration due to the JDBC driver used I'm unable to compare files).
    But to convince people I need to know more about the differences between MS VSS and Oracle SCM.
    I would appreciate if any of the developers share experience with VSS and SCM.
    Regards,
    Mihail Daskalov

  • JDBC Thin Client and Oracle Long Datatype

    I am using Wepshere 4.0.2 , JDBC 2.0 (thin driver) and oracle 9i.
    I have a procedure which takes Oracle Long Datatype as its parameter.
    I use following code to execute procedure.
    String dataforsql="AAA000000003 123123 07/01/200301/01/2003";
    byte[] bytes = dataforsql.getBytes();
    InputStream is = new ByteArrayInputStream(bytes);
    cstmt=conn.prepareCall("call nscw.CPPF_SAVEPDCRAWTABLE2(?,?,?)");
    cstmt.setAsciiStream (1, is,bytes.length);
    The above code works perfectly for data upto 4000 bytes. Once the data crosses the 4000 mark.
    i get a procedure error
    ORA-01460: unimplemented or unreasonable conversion requested

    cstmt.setAsciiStream (1, is,bytes.length);Oracle's support for CLOB (and BLOB) columns using set{Ascii,Binary}Stream() generally s*cks. You'll have to read Oracle's own JDBC manual (you can read it online at http://technet.oracle.com) for whatever sequence they recommend.
    E.g. for insertion and updation of CLOBS, you're supposed to use an oracle-specific function (EMPTY_CLOB()) as the value in the INSERT/UPDATE statement, and then do a SELECT, getClob(), and use Clob APIs to update the actual column value. At least officially. Or you have to use some Oracle-specific APIs in oracle.sql.Connection and oracle.sql.CLOB.

  • NVARCHAR - NVARCHAR2 datatype mapping between sql server and oracle.

    Question regarding size allocation that occurs for NVARCHAR columns in sql server to NVARCHAR2 in Oracle in the migration tool.
    The migration tool has converted NVARCHAR columns to be twice their size as NVARCH2 in Oracle. Example, a table whose column is mycol NVARCHAR(40) gets migrated as mycol NVARCHAR2(80).
    In SQL Server land, the designation of a column as NVARCHAR(40) will physically store the column as 80 bytes. However, as I understand from this excerpt (taken from here: http://www.oracle.com/technology/oramag/oracle/03-nov/o63tech_glob.html), that Oracle in essence will do the same thing for NVARCHAR2:
    To make it easy to allocate proper storage for Unicode values, Oracle9i Database introduced character semantics. You can now use a declaration such as VARCHAR2(3 CHAR), and Oracle will set aside the correct number of bytes to accommodate three characters in the underlying character set. In the case of AL32UTF8, Oracle will allocate 12 bytes, because the maximum length of a UTF-8 character encoding is four bytes (3 characters * 4 bytes/character = 12 bytes). On the other hand, if you're using AL16UTF16, in which case your declaration would be NVARCHAR2(3), Oracle allocates just six bytes (3 characters * 2 bytes/character = 6 bytes). One difference worth noting is that for UTF-8, a declaration using character semantics allows enough room for surrogate characters, whereas for UTF-16 that is not the case. A declaration such as NVARCHAR2(3) provides room for three UTF-16 code units, but a single supplementary character may consume two of those code units.
    As I read this, NVARCHAR(40) in sql server should be equivalent to NVARCHAR2(40) in Oracle and not NVARCHAR2(80) as it gets translated to - am I missing something? We have a rather large database to migrate so I need to get this size allocation right (and I obviously don't want to truncate any data).
    Thanks -

    Right - well, that's what I'm suggesting is that NVARCHAR(8) in SQL Server is equivalent to NVARCHAR2(8) in Oracle. Truncation will occur after 8 of any character, including, say, double byte Kanjii characters, which would physically store 16 bytes in the NVARCHAR(8) NVARCHAR2(8) column defn. I tried that in both SQL Server and Oracle, and the behavior is the same.
    Also, technically, NVARCHAR2(8) and VARCHAR2(8 CHAR) is roughly the same in terms of behavior, except that in the first case, the physical storage is 16 bytes, while in the second case, it's 24 bytes (to account for 'supplemental' characters or true UTF-8 compliance). Same truncation occurs after 8 of -any- character be it single byte ascii or double byte kanjii, which is the behavior I expect.
    Thanks for looking into this. What I decided to do was the following:
    What was originally defined in SQL Server as varchar (and translated to VARCHAR2 with the CHAR designation), I removed the CHAR designation since I truly want that number of bytes to be stored, and not characters (for columns I do not care about UTF8 or 16 compliance - that will also mimic the same behavior I currently have on the SQL Server side. For anything that was nvarchar in SQL Server, I went ahead and created them as VARCHAR2 with the CHAR designation, with the same size (not double the value as was in SQL Server which the documentation says it gets translated to). I did this since we probably will need true UTF-8 compliance down the line, and since I had the hood open, it was easy enough to do. I could also have converted NVARCHAR(n) to NVARCHAR2(n) (and not n*2) as what was happening in the migration.
    I tested strings in both cases, and I think I have my solution.
    Edited by: kpw on Sep 24, 2008 11:21 AM

  • Difference between CHAR and VARCHAR2 datatype

    Difference between CHAR and VARCHAR2 datatype
    CHAR datatype
    If you have an employee name column with size 10; ename CHAR(10) and If a column value 'JOHN' is inserted, 6 empty spaces will be inserted to the right of the value. If this was a VARCHAR column; ename VARCHAR2(10). How would it handle the column value 'JOHN' ?

    The CHAR datatype stores fixed-length character strings, and Oracle compares CHAR values using blank-padded comparison semantics.
    Where as the VARCHAR2 datatype stores variable-length character strings, and Oracle compares VARCHAR2 values using nonpadded comparison semantics.
    This is important when comparing or joining on the columns having these datatypes;
    SQL*Plus: Release 10.2.0.1.0 - Production on Pzt Au 6 09:16:45 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn hr/hr
    Connected.
    SQL> set serveroutput on
    SQL> DECLARE
    2 last_name1 VARCHAR2(10) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is NOT equal to -TONGUC -
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2 last_name1 CHAR(6) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is equal to -TONGUC -
    PL/SQL procedure successfully completed.
    Also you may want to read related asktom thread - "Char Vs Varchar" http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1542606219593
    and http://tahitiviews.blogspot.com/2007/05/less-is-more-more-or-less.html
    Best regards.

  • MS Visual Studio 2005 + Oracle 10g = Cannot connect to ODBC error: 12154

    Hi there!
    I've read so many threads of same kind of problems but always some key elements seems to be missing so I cannot solve my problem with the solutions in those threads. So, I'll do my own.
    Our environment is...
    We have Oracle 8 database with all the data that we have. Now we have our new server, SQL Server 2005 installed and I am trying to transfer data from Oracle to SQL using MS Visual Studio 2005 using available ODBC drivers. System is Windows 2003 64Bit on intel based hardware.
    Current installations and settings
    I have installed Oracle 10g 32bit and 64bit to separate foldes. Then I made tnsnames and sqlnet files with right settings to specified folders and tested connection with tnsping <servername> command.
    Both, 64bit and 32bit connections are working. (Used 32bit CMD for 32bit connection test)
    ODBC
    I added Microsoft ODBC for Oracle as 32bit driver and Oracle 10g driver for 64bit environment as ODBC driver.
    Both environments uses same ODBC names: Myserver and Mytestserver
    Debug
    First, when I only had 64bit version of ODBC, I had a warning which said that I am using incompatible version of ODBC driver. Then I read from here that I can install 32bit client also and use drivers from that on 32bit ODBC environment and get rid of that message.
    Tried to connect Oracle DB with SQL-Plus and it works.
    Visual studio 2005 SP2
    I have tried to use .Net Providers/Oracle Client dataprovider and .Net Providers for OleDB/Microsoft Old DB for Oracle and also .Net Providers for OldDB/Oracle provider for OldDB
    Frist two gives me an error: ORA-12154 TNS: Could not resolve the connect identifier specified
    Last one says that OraOldDB.oracle.1 is not registered on local machine
    I have absolutily no idea what I can try next?
    Anyone who has more ideas? Suggest anything. I might have tried that already, but give a shot anyway. :)
    Message was edited by:
    user640570

    Hi,
    From where you got Oracle 10g driver for 64bit environment as ODBC driver. I am searching for the same.
    Are you got solution. I am facing same problem.
    Thanks,
    Vijay
    Edited by: user3976154 on Sep 6, 2008 5:12 PM

  • Export and Import Of Tables having BLOB and Raw datatype

    Hi Gurus,
    I had to export one schema in one database and import to another schema in another database.
    However my current database contains raw and blob datatype.I have exported the whole database by the following commnad
    exp SYSTEM/manager FULL=y FILE=jbrms_full_19APR2013.dmp log=jbrms_full_19APR2013.log GRANTS=y ROWS=y
    My question is if all the tables with raw and blob have been exported properly or not.I have done one more thing after taking the export , I have imported to local db and checked the no of rows in the both the envs are same.As I have not tested with the application to confirm.
    I am using this version of Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    not able to attach the complete log file but for the schema jbrms which has the blob and raw datatype.
    Please let me know if you find some potential concerns with the export for BLOB and raw
    . about to export JBRMS's tables via Conventional Path ...
    . . exporting table FS_FSENTRY 8 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table FS_WS_DEFAULT_FSENTRY 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BINVAL 60 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BUNDLE 751 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_REFS 4 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_FS_FSENTRY 1 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BINVAL 300 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BUNDLE 11654 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_REFS 1370 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.

    You could see the 'QUESTIONABLE STATISTICS' warning for a couple of reasons. I don't remember them all but.
    1. If the target and source character set is different.
    2. system generated names (I think?)
    the best solution if you don't need the exact statistics that are on your source database would be to add
    statistics=none
    to your imp command and then regather statistics when the imp command is done.
    Dean

  • How do i call c++ programs(with visual c++)in oracle?

    how do i call c++ programs(with visual c++)in oracle?
    how do i store results which produced by c++ programs to oracle?
    results include picture(*.gif,*.bmp,*.jpg)and some variables.
    please tell me a way.hurry!!!

    You would have to write your C++ programs as DLLs and then use something like the following:-
    CREATE OR REPLACE PROCEDURE messagebeep
         (p_uint IN BINARY_INTEGER)
         AS EXTERNAL LIBRARY user32 NAME "MessageBeep"
         CALLING STANDARD PASCAL;
    Within your C++ code you would then access the database to update your tables etc.
    The way I see it is that you want processing to go Oracle --> C++ --> Oracle.
    Do you really need the C++ layer ?
    Hope this helps.
    Adrian

  • IBM WebSphere and Oracle 8i

    I didn't find any other forum where I could post that question, so, sorry if it disturbs...
    I try to call an EJB deployed in Oracle 8i from a servlet deployed in WebSphere, but it fails.
    I use VisualAge to create the servlet, and I encounter many problems to develop an EJB client.
    So I decided to see if an EJB client from Oracle could work directly in Visual Age... so I've deployed the HelloWorld EJB sample in Oracle 8i, and compiled the Client.java and executed it: it works from my DOS command (under NT).
    I put it in Visual Age, and it fails. Has anyone already done such a thing, or am I doomed to use the products of only one vendor to develop my application in a language that is said to be cross-platform, vendor-independant, ... ?
    null

    Yes, I put everything needed by the client in Visual Age as it is defined in the sample Client.java from Oracle (the HelloWorld EJB sample).
    The problem comes from JNDI, I think, but I don't know exactly why. I wonder if the InitialContext has been correctly created...
    Also, I wonder if there is a problem with the CLASSPATH defined in VisualAge (a priority problem), because I don't know why it fails under VA, and that it works under a NT command (java.exe). There must be a redefinition in the classes of VA... and don't know exactly...

  • How we handle CLOB and BLOB Datatypes in HANA DB

    Dear HANA Gurus,
    We have would like to build EDW using HANA base on our source system Oracle and it's supports CLOB and BLOB datatypes
    Would you please suggest how do we handle in HANA DB.
    Let not say it's oracle specific.
    Regards,
    Manoj

    Hello,
    check SAP HANA SQL Reference Guide for list of data types:
    (page 14 - Classification of Data Types)
    https://service.sap.com/~sapidb/011000358700000604922011
    For this purpose might be useful following data types:
    Large Object (LOB) Types
    LOB (large objects) data types, CLOB, NCLOB and BLOB, are used to store a large amount of data such as text documents and images. The maximum size of an LOB is 2 GB.
    BLOB
    The BLOB data type is used to store large binary data.
    CLOB
    The CLOB data type is used to store large ASCII character data.
    NCLOB
    The NCLOB data type is used to store a large Unicode character object.
    Tomas

  • Forms 4.5 and Oracle 8i

    Hello,
    we want to upgrade from Oracle 7.3 to Oracle 8i and we still want to use Forms 4.5.
    Are there any known problems using Forms 4.5 and Oracle 8i? Do we need some patches or are there any other things to do?
    Thanks and greets,
    Markus

    I use Forms 4.5.7.1.7 & Oracle 8.1.7, When I Modify
    "Record Groups", I Get a Message
    | |
    | Oracle From 4.5 |
    | |
    | unhandle err in icrg 102 |
    | |
    Record Group Type : Query
    Record Group Query: Select MyPackage.STR From dual
    I Change Query to "Select SUBSTR(MyPackage.STR,1,1000) From dual"
    Forms 4.5 can recreate the record group...
    I Change Query to "Select SUBSTR(MyPackage.STR,1,1001) From dual"
    Forms 4.5 Show Error!
    On Oracle 7.3.4 Return Datatype From Functions(Package)
    is varchar2(2000), but Oracle 8.1.7 is Varchar2(4000)!
    I must change all of my Record Group?
    The return value can be a varchar2(2000)?

Maybe you are looking for

  • Itunes: Fatal Error During Installation

    Yesterday my iTunes (7.3.1) was working with no problems then the iTunes + Quicktime upgrade came up telling me to download the newer version but I didnt want to download it yet untill after i restarted my computer so I exited out of both the upgrade

  • Difference between 2 Dates

    hi..Experts Req: In OBIEE,Difference between Start date and end date. Result should be in hh:mm:ss fromat I Tried with TIMESTAMPDIFF(SQL_TSI_SECOND, " Closed Date", "Scheduled Start Date") it gives me No.of Seconds. in Data format tab, custom= [FMT:T

  • HT4059 Can I download a kindle version of a book and use it on an IPad, if so, how?

    Can I download a kindle version of a book and use it on an IPad, if so, how?

  • Photoshop 7 not compatible with Windows 8

    I bought Photoshop 7 years ago which was comptible with XP. I tried loading on Windows 8 and it is not supported.  What program is similar to Photshop 7 that is compatible with Windows 8?

  • "Could not create variable iterator" on creating ADF Parameter Form

    I've got a managed bean with a method; public String cmdLogin_action(String userName, String passWord) { // Add event code here... return "success"; I've created a data control, but whenever I try to drag it onto a page and select "Create ADF Paramet