Oracle SQL- Date/Time Help

Hi I have a query that generates a roster report.
The issue I am having is how do I create a query the runs off the start and end time.
What I mean by this is, no matter what time of the day it is, I want the query to run based off of the between time of start and end, if that makes sense.
Below is an example, notice the double entry, (and yes it is correct) the issue is that both these records get picked up, I would like my query to be based off what the time of day is.
If it is 12PM, to send 1st record, if its 1:46 pm, to send 2nd record, not both.
Any help... please
Employee ID First Last Unit Abr Staffing Start Dt Staffing End DT wstat_name_ch wstat_type_no_in
'015428'     Jason     Xi     'P23'     '2012-09-10 11:45:00.000'     '2012-09-11 11:45:00.000'     'Regular Duty'          3
'015428'     Jason     Xi     'P77'     '2012-09-10 13:45:00.000'     '2012-09-11 11:45:00.000'     'Regular Duty'          1
--My query for above statement.
SELECT DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch,
DBA.Resource_Master_Tbl.RscMaster_FName_Ch, DBA.Resource_Master_Tbl.RscMaster_LName_Ch, DBA.unit_tbl.unit_abrv_ch,
DBA.staffing_tbl.staffing_start_dt, DBA.staffing_tbl.staffing_end_dt, DBA.wstat_cde_tbl.wstat_name_ch, DBA.wstat_cde_tbl.wstat_abrv_ch,
DBA.wstat_cde_tbl.wstat_type_no_in
FROM DBA.resource_tbl, DBA.Resource_Master_Tbl, DBA.staffing_tbl, DBA.wstat_cde_tbl, DBA.position_tbl, DBA.unit_tbl
WHERE DBA.resource_tbl.RscMaster_No_In = DBA.Resource_Master_Tbl.RscMaster_No_In AND DBA.resource_tbl.rsc_no_in = DBA.staffing_tbl.rsc_no_in AND
DBA.staffing_tbl.wstat_no_in = DBA.wstat_cde_tbl.wstat_no_in AND DBA.staffing_tbl.pos_no_in = DBA.position_tbl.pos_no_in AND
DBA.position_tbl.unit_no_in = DBA.unit_tbl.unit_no_in AND (DBA.staffing_tbl.staffing_start_dt <= NOW()) AND
(DBA.staffing_tbl.staffing_end_dt >= NOW()) AND (DBA.wstat_cde_tbl.wstat_type_no_in = 1 OR
DBA.wstat_cde_tbl.wstat_type_no_in = 3)
GROUP BY DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch, DBA.Resource_Master_Tbl.RscMaster_FName_Ch,
DBA.Resource_Master_Tbl.RscMaster_LName_Ch, DBA.unit_tbl.unit_abrv_ch, DBA.wstat_cde_tbl.wstat_name_ch, DBA.wstat_cde_tbl.wstat_abrv_ch,
DBA.staffing_tbl.staffing_start_dt, DBA.staffing_tbl.staffing_end_dt, DBA.wstat_cde_tbl.wstat_type_no_in
ORDER BY DBA.Resource_Master_Tbl.RscMaster_FName_Ch

958211 wrote:
Hi I have a query that generates a roster report.
The issue I am having is how do I create a query the runs off the start and end time.
What I mean by this is, no matter what time of the day it is, I want the query to run based off of the between time of start and end, if that makes sense.
Below is an example, notice the double entry, (and yes it is correct) the issue is that both these records get picked up, I would like my query to be based off what the time of day is.
If it is 12PM, to send 1st record, if its 1:46 pm, to send 2nd record, not both.
Any help... please
Employee ID First Last Unit Abr Staffing Start Dt Staffing End DT wstat_name_ch wstat_type_no_in
'015428'     Jason     Xi     'P23'     '2012-09-10 11:45:00.000'     '2012-09-11 11:45:00.000'     'Regular Duty'          3
'015428'     Jason     Xi     'P77'     '2012-09-10 13:45:00.000'     '2012-09-11 11:45:00.000'     'Regular Duty'          1
--My query for above statement.
SELECT DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch,
DBA.Resource_Master_Tbl.RscMaster_FName_Ch, DBA.Resource_Master_Tbl.RscMaster_LName_Ch, DBA.unit_tbl.unit_abrv_ch,
DBA.staffing_tbl.staffing_start_dt, DBA.staffing_tbl.staffing_end_dt, DBA.wstat_cde_tbl.wstat_name_ch, DBA.wstat_cde_tbl.wstat_abrv_ch,
DBA.wstat_cde_tbl.wstat_type_no_in
FROM DBA.resource_tbl, DBA.Resource_Master_Tbl, DBA.staffing_tbl, DBA.wstat_cde_tbl, DBA.position_tbl, DBA.unit_tbl
WHERE DBA.resource_tbl.RscMaster_No_In = DBA.Resource_Master_Tbl.RscMaster_No_In AND DBA.resource_tbl.rsc_no_in = DBA.staffing_tbl.rsc_no_in AND
DBA.staffing_tbl.wstat_no_in = DBA.wstat_cde_tbl.wstat_no_in AND DBA.staffing_tbl.pos_no_in = DBA.position_tbl.pos_no_in AND
DBA.position_tbl.unit_no_in = DBA.unit_tbl.unit_no_in AND (DBA.staffing_tbl.staffing_start_dt <= NOW()) AND
(DBA.staffing_tbl.staffing_end_dt >= NOW()) AND (DBA.wstat_cde_tbl.wstat_type_no_in = 1 OR
DBA.wstat_cde_tbl.wstat_type_no_in = 3)
GROUP BY DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch, DBA.Resource_Master_Tbl.RscMaster_FName_Ch,
DBA.Resource_Master_Tbl.RscMaster_LName_Ch, DBA.unit_tbl.unit_abrv_ch, DBA.wstat_cde_tbl.wstat_name_ch, DBA.wstat_cde_tbl.wstat_abrv_ch,
DBA.staffing_tbl.staffing_start_dt, DBA.staffing_tbl.staffing_end_dt, DBA.wstat_cde_tbl.wstat_type_no_in
ORDER BY DBA.Resource_Master_Tbl.RscMaster_FName_ChFor your own sanity, you should learn to format your code. For the sanity of those of whom you are requesting assistance, you should preserve that formatting with the use of the code tags
SELECT
    DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch,
    DBA.Resource_Master_Tbl.RscMaster_FName_Ch,
    DBA.Resource_Master_Tbl.RscMaster_LName_Ch,
    DBA.unit_tbl.unit_abrv_ch,
    DBA.staffing_tbl.staffing_start_dt,
    DBA.staffing_tbl.staffing_end_dt,
    DBA.wstat_cde_tbl.wstat_name_ch,
    DBA.wstat_cde_tbl.wstat_abrv_ch,
    DBA.wstat_cde_tbl.wstat_type_no_in
FROM
    DBA.resource_tbl,
    DBA.Resource_Master_Tbl,
    DBA.staffing_tbl,
    DBA.wstat_cde_tbl,
    DBA.position_tbl,
    DBA.unit_tbl
WHERE
    DBA.resource_tbl.RscMaster_No_In = DBA.Resource_Master_Tbl.RscMaster_No_In
AND DBA.resource_tbl.rsc_no_in = DBA.staffing_tbl.rsc_no_in
AND DBA.staffing_tbl.wstat_no_in = DBA.wstat_cde_tbl.wstat_no_in
AND DBA.staffing_tbl.pos_no_in = DBA.position_tbl.pos_no_in
AND DBA.position_tbl.unit_no_in = DBA.unit_tbl.unit_no_in
AND (DBA.staffing_tbl.staffing_start_dt <= NOW())
AND (DBA.staffing_tbl.staffing_end_dt >= NOW())
AND (DBA.wstat_cde_tbl.wstat_type_no_in = 1
     OR
     DBA.wstat_cde_tbl.wstat_type_no_in = 3)
GROUP BY
    DBA.Resource_Master_Tbl.RscMaster_EmployeeID_Ch,
    DBA.Resource_Master_Tbl.RscMaster_FName_Ch,
    DBA.Resource_Master_Tbl.RscMaster_LName_Ch,
    DBA.unit_tbl.unit_abrv_ch,
    DBA.wstat_cde_tbl.wstat_name_ch,
    DBA.wstat_cde_tbl.wstat_abrv_ch,
    DBA.staffing_tbl.staffing_start_dt,
    DBA.staffing_tbl.staffing_end_dt,
    DBA.wstat_cde_tbl.wstat_type_no_in
ORDER BY
    DBA.Resource_Master_Tbl.RscMaster_FName_ChI'm not sure the above is even legal Oracle SQL. Are you sure you aren't taking code from some other rdbms?

Similar Messages

  • Oracle.sql.DATE documentation also missing

    Thanks for the documentation of jbo.domain.Date, but it was not enough.
    I need to know how to use the toDate method, but it seen to be described in the superclass
    oracle.sql.DATE that was also missing in documentation.
    I have searched at OTN docs, but it's also missing there.
    There is some place where this documentation is stored in OTN, since could be others classes missing.
    Thanks for the support.

    I'm trying to set a date value and keep getting a ClassCastException:
    rsaDemandException is a ScrollableRowsetAccess object
    "StartDate" is a valid Date type column in the DemandException view object
    newDate is a Date object of the various types I have tried below
    The line that causes an exception to be thrown:
    rsaDemandException.setColumnValue("StartDate", newDate);
    I've tried the following objects for newDate
    java.util.Date;
    java.sql.Date;
    java.sql.Timestamp;
    oracle.sql.DATE;
    oracle.jbo.domain.Date;
    None of them work. They all throw a class cast exception.
    Any hints on what I need to do? Or is this some bug?
    null

  • Fail to convert to internal representation: oracle.sql.DATE

    I'm using the oracle 8.1.7 jdbc driver against oracle 8.1.7 running on NT, and I get the exception message below when I attempt to insert an jpub object structure into a prepared statement.
    All date objects have been constructed from a timestamp object, using the oracle.sql.DATE Timestamp constructor. So I'm surprised to get this error given the timestamp object was successfully constructed.
    I've tried session date formats of 'yyyy-mm-dd hh24:mi:ss' and 'mm/dd/yyyy hh24:mi:ss', with no success.
    I can call stringValue on oracle.sql.DATE and it returns a valid date.
    Can someone confirm that they have been able to use the oracle.sql.DATE class to insert a date correctly into the database? Its seems a silly question to ask but you have to start somewhere!
    Exception : Fail to convert to internal representation: oracle.sql.DATE@3c144e8a
    Stack trace : java.sql.SQLException: Fail to convert to internal representation: oracle.sql.DATE@3c144e8a
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:829)
    at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:261)
    at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:385)
    at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:560)
    at oracle.sql.STRUCT.<init>(STRUCT.java:95)
    at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:65)
    null

    The JPub/JDBC runtime is converting your Java object into Oracle-specific representation (all data is put in oracle.sql.XXXX format). The top level object is an oracle.sql.STRUCT, the attributes of which are represented as an array of oracle.sql.Datum objects - in your case an oracle.sql.NUMBER and an oracle.sql.DATE. However, the error does occur in the StructDescriptor which describes the SQL type and the shape of the object. Is the error dependent on the data values? Might null values not be dealt with, correctly?
    One thing to try to do is create such an oracle.sql.STRUCT object from scratch with the same attribute values and insert/manipulate that using SQL.
    I have not dealt with TAR's. If you send me a self-contained test case, I'll check it against the current development version of JDBC. (At least you'll know if the next JDBC release fixes this issue :-) I might also file a bug.

  • Convert Data type from Oracle Data time string to SQL Date time data type

    I have a time stamp column pulled from oracle into a SQL server db table varchar datatype column.
    Now i want to change that column to date time.
    Following is the data present in the table:
    01-APR-11 02.15.00.026000 AM -08:00
    01-APR-11 04.15.00.399000 AM -08:00
    01-APR-11 06.15.00.039000 AM -08:00
    I want to convert this data into sql server datetime data type.
    Please advice.
    Thanks,
    Sam.
    I am unable to find the solution in other sites which is why I have posted it in Oracle forum for seeking solution.
    Thanks in Advance.
    Sam.

    Sam,
    How are you actually loading the data into SQL*Server - are you using something like an Oracle gateway, BCP or another Microsoft utility of some sort ?
    If you are using an Oracle problem then we may be able to help but if using a Microsoft utility then you should really follow up with Microsoft to know what format the data should be in to use a Microsoft utility.
    Regards,
    Mike

  • Prepared statement - setDate(index, sql.Date, Cal) Help!

    Hi everyone, I'm creating a form to query an Oracle table. I'm setting up the search criteria which includes a start and end date. (in this example I've just used the start date)
    I get all the search parameters into my JSP and I created the following Calendar objects:
    // Calendar creation
    Calendar startCal = Calendar.getInstance();
    startCal.set(start_year, start_month, start_day, start_hour, start_minute);
    Calendar endCal = Calendar.getInstance();
    endCal.set(end_year, end_month, end_day, end_hour, end_minute);
    //define a sql.Date value for start and end date
    java.sql.Date startDate = null;
    java.sql.Date endDate = null;I then create a string that contains my SQL statement:
    String sqlStmt = "select dateValue, value3 from someTable where dateValue >= ? and value2 = ?";In my Prepared Statement I pass in the following information:
    ps = c.prepareStatement(sqlStmt);
    ps.setDate(1, startDate, startCal);
    ps.setString(2, searchValue);My question is the following - I define the hour and minute in my Cal object - will that information get passed into my "startDate" sql.Date object? According to the API it should work (at least that's my understading of it):
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#setDate(int,%20java.sql.Date,%20java.util.Calendar)
    My search does not blow up or report any errors but it never finds a match - even when I put in parameters that I know are a match.
    Any feedback is appreciated.

    I think I got it. my java.sql.Date can't be null.
    java.sql.Date startDate = null;
    java.sql.Date endDate = null;needs to be:
    java.util.Date startCalendarDate = startCal.getTime();
    java.util.Date endCalendarDate = endCal.getTime();
    java.sql.Date startDate = new java.sql.Date(startCalendarDate.getTime());
    java.sql.Date endDate = new java.sql.Date(endCalendarDate.getTime());

  • Oracle SQL Developer Installation Help (Basics?)

    Hello
    So im taking a class (student here, totally new to this) in Oracle SQL right now and trying to download the Oracle SQL Developer tool onto my desktop (v 2.1.1).
    Im just starting up Oracle SQL Developer and its asking, or I am looking to create a connection.
    I was wondering if anyone had a tutorial for how to make a connection?
    I only have Oracle SQL developer installed on my machine right now, nothing else. I dont have a server or anything, and just wanted to run this on my desktop local machine to practice running some SQL.
    Is there anything else i need to install?
    Is there some basic username and password that would allow me to connect to my local machine?
    What values do i need for the hostname, port and SID etc?
    Any help for a new student to Oracle would be greatly appreciated.

    You'd need a database to connect the SQL Developer client to.
    The easiest / quickest if you're a student would be the Express Edition.
    http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
    Pick your platform and away you go.
    Your hostname will then be 127.0.0.1, SID will be XE .... username and password will depend on what you choose when you're installing (you should get prompted for SYS/SYSTEM passwords).

  • Oracle SQL Data Modeler -COMPARE/MERGE

    Hi all,
    I am trying to compare/merge or just trying to merge a relation model with another in Oracle SQL Developer DATA MODELER.
    Scenario:
    I have tried to import from data dictionary the hr schema into 3 parts.
    Table employee is alone imported in one design model's relational model(say DataModelerDesign1- DMD1).
    Table Departments,Locations and Countries in another design model's relational model(say DMD2).
    Table Job_history,Jobs and Regions in another design model's relational model(say DMD3).
    Now, I tried to merge all this into one design model's relational model, here into DMD3.
    Requirement:
    I want all of this relational model's tables to get merged with exact mappings as if it is in HR schema all connected to each other. But they are all getting merged as separate entities not conencted to each other when taken from Compare/merge option. How should i do this task?
    Issues:
    1) I can never see anything in the compare model when i try to click on view compare mapping. Can anytime we see any data here?
    2) In realtime scenario, when will we try to merge a table into another or split it. Because some foriegn key violations are happening here. Is it ever possible to succeed our requirement while merging itself instead of creating relationships between entities manually in main relationship model DMD3 in example here.

    I have found on occasions the diagram pdf would be missing a few relationship lines. Usually it happens after I have been doing a lot of work in the tool or printing a bunch of diagrams. Seems to be a memory leak of some sort. If I close Data Modeler, re-open it, then print to PDF, the diagram is fine.

  • Sql date time

    hi i have a date time field in ms sql server 2005
    i have 2 form fields i need to insert into the datetime
    i am using CAST(@SchDateTime AS DATETIME) to convert my
    datetime from
    #DateFormat("#form.SMS_Date# #form.SMS_Time#",'dd/mm/yyyy
    hh:mm:ss')#
    but the time is not inserting correctly any ideas how i
    insert 2 form fields into sql ?
    many thanks

    KeithLaw999 wrote:
    > the time is not inserting correctly
    What does not correctly mean?
    > #DateFormat("#form.SMS_Date#
    #form.SMS_Time#",'dd/mm/yyyy hh:mm:ss')#
    DateFormat parses a date value (not a date and time). It uses
    US date formats. So "12/2/2007" will be considered December 2nd,
    not February 12th. Also, is your time using a 12-hour or 24-hour
    clock? It its a 12-hour clock sql server might assume AM, unless
    you included a time marker (ie AM or PM).
    > am using CAST(@SchDateTime AS DATETIME) to convert my
    datetime
    Convert() provides more control, but I don't know if
    dd/mm/yyyy hh:mm:ss is one of the supported styles. An alternative
    is to use CF to parse the strings into a valid datetime object
    first, instead of passing a string to sql server and letting it do
    the parsing.

  • Java.sql.Date output help

    i want to add a date to a mysql databse but im getting incorrect info...
    here is a similiar code to what i have in my software
    import java.util.Calendar;
    import java.sql.Date;
    public class test {
         public static void main(String[] args) {
            Calendar c = Calendar.getInstance();
            int year = c.get(Calendar.YEAR);
            int month = c.get(Calendar.MONTH);
            int day = c.get(Calendar.DAY_OF_WEEK);
            Date d = new Date(year, month, day);
            System.out.println(d);
    }i get 3906-09-06 as an output...please help

    Date d = new Date(year, month, day);
    The year is a number from 1900. So u need to substract 1900 from the value u got before.
    Regards,
    Eyal

  • Oracle SQL Developer Connection Help

    Hi,
    I'm a complete Oracle newbie, so please bear with me. I've been doing research on protein clustering and at my lab the SQL developer has been running queries that I can then do statistics on. I have the query that I need to run, and was told to download Oracle SQL Developer and Oracle Client.
    I was also given a username and password, a hostname, a port and a SID. I'm a bit confused, do I still need to install Oracle Client? And if so, I can't quite find what it is on the website? I have SQL Developer installed but when I click connect I get:
    "Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection"
    I'm pretty computer literate outside the world of databases so if someone can offer some explanations and guidance, it would be appreciated!
    Thanks!

    933874 wrote:
    Hi,
    I'm a complete Oracle newbie, so please bear with me. I've been doing research on protein clustering and at my lab the SQL developer has been running queries that I can then do statistics on. I have the query that I need to run, and was told to download Oracle SQL Developer and Oracle Client.
    I was also given a username and password, a hostname, a port and a SID. I'm a bit confused, do I still need to install Oracle Client? And if so, I can't quite find what it is on the website? I have SQL Developer installed but when I click connect I get:
    "Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection"
    I'm pretty computer literate outside the world of databases so if someone can offer some explanations and guidance, it would be appreciated!
    Thanks!If you have SQL Developer installed & need to connect to some Oracle DB,
    then you do NOT need Oracle client.
    FWIW - SQL Developer is written in Java & uses JDBC (thin) to connect to the DB
    Is the DB Server on a subnet local to your system?

  • Oracle SQL Newbie need help with OE Demo Schema Installation

    Hello everybody !
    I'm hoping some kind soul can help out this SQL newbie.
    First of all i've installed 10g R2 database on a PC running XP SP2.
    Oracle is installed on the root C: drive
    I'm using the SQL Fundamentals I Exam Guide and DBA Handbook (Both Oracle Press)
    as my reference.
    My problem is this.
    I installed the DB and created the demo HR schema without too much problem
    but it's the demo OE schema i'm having problems getting running and cannot
    find anywhere on the net that outlines a step by step SQL process.
    I am using SQL Plus to execute these commands.
    My questions are these:
    -For the default tablespace i specify "users" ?
    -What do i specify for the temporary tablespace ? "temp" ?
    -what directory path do i put for the data files as parameter 6 ?
    I put down "C:\oracle\product\10.2.0\db_1\demo\schema\order_entry" but i suspect it's
    the wrong thing ?
    -What do i specify for the writable directory path for the log files ?
    Is it C:\oracle\product\10.2.0\RDBMS\log
    -And what is "Specify version as parameter 8:" line ?
    I assumed it was the db version but i believe it's wrong.
    Could somebody please help me ? I've already done my CCNA and i wanted to add oracle under my belt.
    I know if i had these few things cleared up for me it would pave the way to actually enjoying learning Oracle :)
    Thank you for any assistance :)

    I installed the DB products from the companion disk and there was no specific mention of the demo schemas. Regardless... They're all there within the demo subfolder and have already created the hr schema.. I just need somebody (I'll pay if necessary) to PLEASE just answer (what would be easy to you guys my questions so i can move on.
    this is a cap from my sql plus..
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 14 15:01:29 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> alter user oe account unlock identified by oe;
    User altered.
    SQL>
    specify password for OE as parameter 1:
    Enter value for 1: mewfymewf
    specify default tablespeace for OE as parameter 2:
    Enter value for 2: users
    specify temporary tablespace for OE as parameter 3:
    Enter value for 3: temp
    specify password for HR as parameter 4:
    Enter value for 4: mewfymewf
    specify password for SYS as parameter 5:
    Enter value for 5: mewfymewf
    specify directory path for the data files as parameter 6:
    Enter value for 6: C:\oracle\product\10.2.0\db_1\demo\schema\order_entry
    writeable directory path for the log files as parameter 7:
    Enter value for 7: C:\oracle\product\10.2.0\db_1\RDBMS\log
    specify version as parameter 8:
    Enter value for 8: 10.2.0
    User dropped.
    old 1: CREATE USER oe IDENTIFIED BY &pass
    new 1: CREATE USER oe IDENTIFIED BY mewfymewf
    User created.
    old 1: ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
    new 1: ALTER USER oe DEFAULT TABLESPACE users QUOTA UNLIMITED ON users
    User altered.
    old 1: ALTER USER oe TEMPORARY TABLESPACE &ttbs
    new 1: ALTER USER oe TEMPORARY TABLESPACE temp
    User altered.
    Grant succeeded.
    Connected.
    Session altered.
    Session altered.
    SP2-0310: unable to open file "C:\oracle\product\10.2.0\db_1/demo/schema/order_entry/coe_10.2.0"
    SP2-0310: unable to open file "C:\oracle\product\10.2.0\db_1/demo/schema/order_entry/loe_10.2.0"
    SP2-0310: unable to open file "C:\oracle\product\10.2.0\db_1/demo/schema/order_entry/poe_10.2.0"
    Session altered.
    ...creating subschema OC in OE
    Type created.
    Type body created.
    Table created.
    FROM inventories i, warehouses w
    ERROR at line 6:
    ORA-00942: table or view does not exist
    FROM product_information p
    ERROR at line 10:
    ORA-00942: table or view does not exist
    FROM customers c
    ERROR at line 20:
    ORA-00942: table or view does not exist
    FROM customers c
    ERROR at line 20:
    ORA-00942: table or view does not exist
    FROM customers c
    ERROR at line 20:
    ORA-00942: table or view does not exist
    FROM orders o
    ERROR at line 9:
    ORA-00942: table or view does not exist
    ON oc_orders FOR EACH ROW
    ERROR at line 2:
    ORA-00942: table or view does not exist
    TABLE order_item_list OF oc_orders FOR EACH ROW
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Commit complete.
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 5:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 5:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 5:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 5:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    FROM oc_product_information o
    ERROR at line 4:
    ORA-00942: table or view does not exist
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    Type altered.
    3 rows updated.
    0 rows updated.
    0 rows updated.
    0 rows updated.
    Commit complete.
    Type body altered.
    Type body altered.
    Type body altered.
    PL/SQL procedure successfully completed.
    SQL>
    Like i can figure out that the "version in parameter 8" has something to do with the coe, poe & loe files
    but i don't know what.
    If somebody can please help me with my questions then i know i can move on.
    Thanks
    Edited by: user11216992 on Jun 14, 2010 3:37 PM

  • Oracle UNIX Data Time Issue/Question

    I have a project where I need to display some data from a commercial software package. All of the tables except 1 store date values in NUMBER columns as UNIX time. I can convert these no problem, but one table has date values stored in FLOAT(126) columns and I cannot figure out how to convert them to get a valid, and accurate, date from them.
    For example, the column contains the value 38513.5775115741 which in the application front end is displayed as Friday, June 10, 2005. Does anyone see a "formula" for this?
    Maybe it's obvious and I've been trying too hard or looking at it too long for it to make sense to me....
    Thanks in advance.

    This looks close:
    SQL > select to_char(date '1900-01-01'  + 38513.5775115741,'fmDay, Month dd, yyyy','nls_date_language=american') from dual
      2   /
    TO_CHAR(DATE'1900-01-
    Sunday, June 12, 2005
    1 rij is geselecteerd.So maybe you should use 30-12-1899 or the number was really 38511.5775115741 instead of 38513.5775115741 ?
    Regards,
    Rob.

  • Sql date time insert error

    Hi i am having trouble entering a date in to a sql stored
    procedure.
    first i convert the date to the users current datetime using
    <cfscript>
    userTZ="#qGetClubDetails.LocalTime12#"; // or whatever tz ID
    you need
    tz=createObject("component","timeZone");
    userDateTime=tz.castFromServer(today,userTZ);
    </cfscript>
    then i need to insert this into a stored procedure using
    <cfstoredproc procedure="xsp_InsertSmsRecords"
    datasource="#application.ds#">
    <cfprocparam type="In" cfsqltype="CF_SQL_DATETIME"
    dbvarname="UsersDate" value="#CREATEODBCDATETIME(userDateTime)#"
    null="No">
    </cfstoredproc>
    but i am getting a error of
    Macromedia][SQLServer JDBC Driver][SQLServer]Error converting
    data type varchar to datetime.
    any ideas what i need to do?

    quote:
    Originally posted by:
    craiglaw98
    ok i have tried that with no luck, i did a cfdump on
    userDateTime and i got
    {ts '2008-01-21 05:16:04'}
    any ideas what i need to do to insert this to sql server
    Looks ok to me. To troubleshoot this, try using cfquery for
    your insert instead of a stored procedure.

  • Date/Time in SQL

    Hey,
    I'm trying to get CF to put the date or date/time into the SQL 2000 date/time field by using Toolbox insert record form wizard. Then use the date picker on the date field.
    my error was
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
    the SQL date/time field is 8 characters long, so, I don't know the best way to go about shoving a date/time into it in CF.
    Thanks in advance!

    Hi Kenneth,
    I´m by no means a CF expert, but...
    the SQL date/time field is 8 characters long, so, I don't know the best way to go about shoving a date/time into it in CF
    ...do your ADDT Control Panel´s *database* "Date format" and "Time formats" settings match the required SQL 2000 date/time format ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Insert current date/time problem in ViewObject

    Hi!
    I'm trying to setAttribute to a Date type field.
    I have a method:
    public String getCurrDateString() throws ParseException, java.sql.SQLException {
    SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy hh:mm:ss aa");
    Date currentTime_1 = new Date();
    return formatter.format(currentTime_1);
    All the time i call this method such as:
    HistoryViewImpl histVO=getHistoryView();
    Row r=histVO.createRow();
    r.setAttribute("Entrydatetime",cp.getCurrDateString());
    I get oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:19-Jun-2002 10:14:33 AM
    the strange thing is, that Oracle recognizes this kind of format, because if I use different pattern such as "yyyy-MM-dd", which returns string "2002-06-19", r.setAttribute("Entrydatetime",cp.getCurrDateString()) method works fine and in Oracle table field we have inserted value 19-Jun-2002 12:00:00 PM. The problem is, that i don't need 12:00:00 PM as a time, i need current time.
    What am i doing wrong? Or does it mean that oracle.jbo.domain.Date doesn't know format "dd-MMM-yyyy hh:mm:ss aa"?

    Hi!
    I'm trying to setAttribute to a Date type field.
    I have a method:
    public String getCurrDateString() throws ParseException, java.sql.SQLException {
    SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy hh:mm:ss aa");
    Date currentTime_1 = new Date();
    return formatter.format(currentTime_1);
    All the time i call this method such as:
    HistoryViewImpl histVO=getHistoryView();
    Row r=histVO.createRow();
    r.setAttribute("Entrydatetime",cp.getCurrDateString());Instead of passing in the "String" pass the date object as is. oracle.jbo.domain.Date should be able to convert java.sql.Date/Time/Timestamp and store the time bits as set.
    If you have to pass in string, then establish a Formatter on the attribute with appropriate date format and then use the AttributeHints interface from the relevant AttributeDef object on the row to parse the input String into a valid parsed object that you can set into the row.
    (See oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeInRow() method for a complete usage - source in bc4j\src\bc4juisrc.zip)
    I get oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:19-Jun-2002 10:14:33 AM
    the strange thing is, that Oracle recognizes this kind of format, because if I use different pattern such as "yyyy-MM-dd", which returns string "2002-06-19", r.setAttribute("Entrydatetime",cp.getCurrDateString()) method works fine and in Oracle table field we have inserted value 19-Jun-2002 12:00:00 PM. The problem is, that i don't need 12:00:00 PM as a time, i need current time.
    What am i doing wrong? Or does it mean that oracle.jbo.domain.Date doesn't know format "dd-MMM-yyyy hh:mm:ss aa"?

Maybe you are looking for