Link to home
Start Free TrialLog in
Avatar of capturetheflag
capturetheflag

asked on

Interger changes to character in ADODB command statement

Hello,
I am working with a Classic ASP and the ADODB command that I am trying to use with an integer always returns a character with the value of '20' no matter what integer value I use.

We have installed a new Oracle 11G Client web server and are using an Oracle 10G database.

For example in the code snippet the integer 38 returns as a character with the value 20.

Thanks for the help

cmd.Parameters.Append cmd.CreateParameter("p_user_id", 20, 1, 10 , 38)

Open in new window

Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Wrap the 38 in quotes.  That data type is not a number.
I meant to post this link with my answer for reference.  http://msdn.microsoft.com/en-us/library/windows/desktop/ms677209(v=vs.85).aspx

The "38" is a variant so it can be a number or character, therefor, wrap in quotes.
Avatar of capturetheflag
capturetheflag

ASKER

Hello padas,

The quotes did not work, and this line of code fails too.

cmd.Parameters.Append cmd.CreateParameter("p_user_id", Application("adInteger"), Application("adParamInput"), 10, clng(request.form("userID")))

But it works on the old web server. Hmmm?
That line may not have worked because you do not have adovbs included in your file.

I do not know Oracle.  Is that compatible with classic asp?  64bit vs 32bit?
Let's go back to what you did here http:Q_28258510.html#a39547703

For each version you tried please let us know the exact error message.  "It did not work" is hard to go by.  Also, if you are getting generic 500 error, you need to turn on asp errors.

http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default

I would also like to see more of your code.  Can you sprinkle some response.writes through different points in your code to help see where it is breaking.  Are you 100% sure it is that line?   It could also have something to do with your provider.  Have you always used oracle or did you use ms sql in the past?
Looking at some of my own code, where you have

cmd.Parameters.Append cmd.CreateParameter("p_user_id", 20, 1, 10 , 38)

Shouldn't that be

cmd.Parameters.Append cmd.CreateParameter("p_user_id", 200, 1, 100 , 38)
or
cmd.Parameters.Append cmd.CreateParameter("p_user_id", 200, 1, 100 , "38")
Hello padas,

Thanks for the help.  Yes,

cmd.Parameters.Append cmd.CreateParameter("p_user_id", 200, 1, 100 , 38)

will work but, that makes it a character and it must be an integer.  
Another factor may be that we are using a new Oracle web server because the code works on the old web server.  I would not know where to look on the new web server

Here is the complete code statement.


Set cmd = Server.CreateObject("ADODB.Command")
                cmd.CommandType = 4
                cmd.ActiveConnection = conn
                cmd.CommandText = "APP_API.UPD_USER_BY_USER_ID"
                
                'cmd.CommandText = "UPDATE personnel SET email = lower(p_email), first_name = upper(p_first_name),last_name = upper(p_last_name) WHERE user_id = p_user_id"

                cmd.Properties("PLSQLRSet") = TRUE

                cmd.Parameters.Append cmd.CreateParameter("p_user_id", 20, 1, 10 , 38)
                cmd.Parameters.Append cmd.CreateParameter("p_first_name", 200, 1, 30, "xxxxx")
                
                cmd.Parameters.Append cmd.CreateParameter("p_last_name", 200, 1, 30, "yyyyy")
                cmd.Parameters.Append cmd.CreateParameter("p_email", 200, 1, 50, "zzzzzz@rrrrrr.ggg")

                for each x in cmd.Parameters
                                Response.Write("<p>" & x.Name & " = " & x.Value & "</p>")
                next

Open in new window

Hello padas,

It appears that a bigint value is not supported in the version of the OLE DB driver that we use to connect our apps to the DB.

Mike
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help but, I will just have to call Oracle about this problem.
Although I appreciate the points.  My post didn't do anything to solve the issue.

If you did not get an answer to the question, you should just ask to have the question deleted.

>> I will just have to call Oracle about this problem.

We can probably answer the question faster than Oracle but you will need to provide us with enough information to be able to do so.  Even Oracle will ask for similar information to be provided.
Yes, I agree.  The solution selected should also  help the next person viewing the thread.  


Just another thought.  I typically use adDouble for all number values.  Can you try changing you code to:
cmd.Parameters.Append cmd.CreateParameter("p_user_id", 5, 1, 10 , 38)

Open in new window


However, I don't think that is the problem.  I don't use Oracle, I can't believe there is something that changes the value of your input value.  I wonder if we are looking at the wrong thing to figure out  your issue.

As slightwv has asked, viewing the code from your stored procedure is most likely the issue. it is probably something in your SP that is accepting the wrong value from something other then what you think it is.  

In your SP, do you have a fixed value set perhaps for testing you forgot to change?  Do you have the wrong variable specified in your SP for that item?  Slight spelling variation?  Or calculation?