Ask a Question

How to add an IN PARAMETER Type TimeStamps in Stored Procedures calls?

raultellez17
Frequent Visitor

How to add an IN PARAMETER Type TimeStamps in Stored Procedures calls?

I'm having problems calling a stored procedures from script, the error ocurred exactly when I try to add an in parameter type DBtimestamp.

 

this is the code:


var SProc;
SProc = ADO.CreateADOStoredProc();
CnnString = ProjectSuite.Variables.connectionString;
SProc.ConnectionString = CnnString;
SProc.ProcedureName = "SPRCOBJ.ASOLINGTER";


// Adding an in parameter:
SProc.Parameters.AddParameter();
SProc.Parameters.Items(0).name = "AUVI";
SProc.Parameters.Items(0).DataType = ftFixedChar;
SProc.Parameters.Items(0).Size = 5;
SProc.Parameters.Items(0).Value = "19709";
.
.
.
.
/* This is the problem */
// Adding an in parameter:
SProc.Parameters.AddParameter();
SProc.Parameters.Items(55).name = "TFHVGM";
SProc.Parameters.Items(55).DataType = adDBTime; //The error occurred exactly in this line of code.
//SProc.Parameters.Items(2).Size = 26;
SProc.Parameters.Items(55).Value = "2017-01-05-08.36.44.311000";
.
.
.
.
// Running the procedure
SProc.ExecProc();

 

 

 

Please I need help!!

2 REPLIES 2
Marsha_R
Champion Level 3

What error did you get?  The exact message will help us help you.

tristaanogre
Esteemed Contributor

The error message would help, for sure... but question: You are apparently assigning a full date and time to the parameter. Shouldn't you be using adDBTimeStamp instead? I'm not sure if that would cause your error, but it seems odd to be using a time only datatype when you are passing in a full date time


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: