473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Stored procedure

I am trying to edit and send an "hourly" data value from an Excel spreadsheet to our Oracle based database. Originally the data values on the spreadsheet were queried from the database in question. Each value in the hourly table of the database has a start date and an endate time field that must be sent back to the database with the value of the edited data. I am using a stored procedure (see code below) to send the data value and other associated factual and config info to do this (see code below). Every time I run the code to transfer an houlry edited value from Excel to the database the program stops when it gets to the portion of the code that deals with the date. A message such as "hourly" interval values cannot have the same start and end date. Apparently the database interprets the date I am providing as a top of the day midnight value and truncates any hour or minute portions of the date provided...thinks that every date/time provided in the top of the day. That is why the database thinks I am sending the same date/time for both the start and end time. I have tried many combinations of syntax to make this work...but to no avail. Please see code I am using below: Any suggestions? Thanks in advance.

Expand|Select|Wrap|Line Numbers
  1. Set cmd = New ADODB.Command
  2.    cmd.ActiveConnection = cnn
  3.    cmd.CommandType = adCmdStoredProc
  4.    cmd.CommandText = "modify_r_base"
  5.  
  6.    cmd.Parameters.Append cmd.CreateParameter("site_datatype_id", adVarChar, adParamInput, Val(Len(sdid$)), sdid$)
  7.    cmd.Parameters.Append cmd.CreateParameter("interval", adVarChar, adParamInput, Val(Len(interval$)), interval$)
  8.    cmd.Parameters.Append cmd.CreateParameter("start_date_time", adDate, adParamInput, 8, startdate)
  9.    cmd.Parameters.Append cmd.CreateParameter("end_date_time", adDate, adParamInput, 8, enddate)
  10.    cmd.Parameters.Append cmd.CreateParameter("value", adVarChar, adParamInput, Str_len, str_value)
  11.    cmd.Parameters.Append cmd.CreateParameter("agen_id", adVarChar, adParamInput, 2, agenid$)
  12.    cmd.Parameters.Append cmd.CreateParameter("overwrite_flag", adVarChar, adParamInput, 1, overwrite$)
  13.    cmd.Parameters.Append cmd.CreateParameter("validation", adVarChar, adParamInput, 1, "")
  14.    cmd.Parameters.Append cmd.CreateParameter("collection_system_id", adVarChar, adParamInput, 2, collectionid$)
  15.    cmd.Parameters.Append cmd.CreateParameter("loading_applicaion_id", adVarChar, adParamInput, 2, loadapp$)
  16.    cmd.Parameters.Append cmd.CreateParameter("method_id", adVarChar, adParamInput, 2, methodidnum$)
  17.    cmd.Parameters.Append cmd.CreateParameter("computation_id", adVarChar, adParamInput, 1, compid$)
  18.    cmd.Parameters.Append cmd.CreateParameter("do_update_Y_or_N", adVarChar, adParamInput, 1, "Y")
  19.   Stop
  20.    cmd.Execute
  21.  
  22.    Set cmd.ActiveConnection = Nothing
Oct 10 '07 #1
1 1699
iburyak
1,017 Expert 512MB
cmd.Parameters.Append cmd.CreateParameter("start_date_time", adDate, adParamInput, 8, startdate)

It Looks like it takes only date part of a string can you change to adDateTime?
Oct 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
3
by: kd | last post by:
Hi All, How to debug a stored procedure? Thanks, kd
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.