Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.CreateParameter   recieving a CLOB

Posted on 2006-10-30
18
Medium Priority
?
808 Views
Last Modified: 2008-01-09
I am recieving a CLOB from an oracle query.
How should my .CreateParameter method's parameters look?

This is what I have , but the app seems to be bombing out

.Parameters.Append .CreateParameter("highlight", adVarChar, adParamInput, 57478)
0
Comment
Question by:bertino12
  • 7
  • 3
  • 3
  • +2
16 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 17835286
I believe that an adVarChar needs a length parameter and that a text value needs delimiters:

.Parameters.Append .CreateParameter("highlight", adVarChar, adParamInput, 5, "57478")

FtB
0
 

Author Comment

by:bertino12
ID: 17835673
I dont think this way works at all for a CLOB. Im trying to find a way to make it work.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 17835701
Well, I don't know about CLOBS, but if you are using an adVarChar, .CreateParameter will require all of those parameters.

A few things to check:

http://forums.oracle.com/forums/thread.jspa?messageID=1116750
http://forums.oracle.com/forums/thread.jspa?messageID=1101332


FtB
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bertino12
ID: 17837201
I saw those urls early this morning. Unfortunately, they dont help :(
0
 

Expert Comment

by:soconne
ID: 17837209
This guy bertino12 is kind of a hot head.
0
 

Author Comment

by:bertino12
ID: 17837235
?
0
 

Expert Comment

by:soconne
ID: 17837257
Hey man, chill out.  No need to start sending me hateful private messages.  Please respect the rest of us in this forum.
0
 

Expert Comment

by:soconne
ID: 17837316
sorry mr han fwitz, I so wery sorwy.  no happen again evwer
0
 

Author Comment

by:bertino12
ID: 17841465
Still Havent figured it out im calling a stored procedure last and thats whats blowing up my code. The first 3 createParameters have been tested and work.
The 4th CreateParameter is recieving a CLOB and thats what is messing me up.

    sql = "SELECT doc_id, display_name, " &_
           "to_char((SELECT MAX(process_end_time) FROM CONVERT_LOG l WHERE l.doc_id=d.doc_id), 'MM/DD/YYYY HH:Mi:SS PM')  publish_date" &_
        "Markup_First_Hit(d.doc_id, 'dog', '<b><font style=""background:#FFFF99"">', '</B></font>') highlight " &_
        "FROM DOCUMENTS d WHERE published=1"

      Set oCmd = Server.CreateObject("ADODB.COMMAND")
            With oCmd
            .ActiveConnection = conn
            .CommandType = adCmdText
            .CommandText = sql
            .Parameters.Append .CreateParameter("doc_id", adInteger)
            .Parameters.Append .CreateParameter("display_name", adVarChar)
            .Parameters.Append .CreateParameter("publish_date", adVarChar)
            .Parameters.Append .CreateParameter("highlight")
      end with
      
      Set rst = oCmd.Execute
      Set oCmd = Nothing
0
 

Author Comment

by:bertino12
ID: 17843282
I figured it out. I didnt even need a createParameter.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 17854326
I am okay with the refund as long as bertino posts his final solution so that others might reference it.

FtB
0
 

Author Comment

by:bertino12
ID: 17854659
I didnt change anything, but took off the createParameter. The select statement contained a stored procedure, but wasnt a stand alone stored procedure so there was no need for createParameter functions.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17854666
Just post your solution, as your explanation makes no sense.
0
 

Author Comment

by:bertino12
ID: 17857416
How does removing the createParameter not make sense?

   sql = "SELECT doc_id, display_name, " &_
          "to_char((SELECT MAX(process_end_time) FROM CONVERT_LOG l WHERE l.doc_id=d.doc_id), 'MM/DD/YYYY HH:Mi:SS PM')  publish_date" &_
       "Markup_First_Hit(d.doc_id, 'dog', '<b><font style=""background:#FFFF99"">', '</B></font>') highlight " &_
       "FROM DOCUMENTS d WHERE published=1"

     Set oCmd = Server.CreateObject("ADODB.COMMAND")
          With oCmd
          .ActiveConnection = conn
          .CommandType = adCmdText
          .CommandText = sql
     end with
     
     Set rst = oCmd.Execute
     Set oCmd = Nothing
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17861076
>>How does removing the createParameter not make sense?<<
I was not referring to that, but rather this:
"The select statement contained a stored procedure, but wasnt a stand alone stored procedure so there was no need for createParameter functions."

A select statement cannot contain a stored procedure,, perhaps you meant the reverse: the stored procedure contained a select statement.

I have no idea what you meant by "stand alone stored procedure", perhaps you mean/meant one that does not have parameters.

But the bottom line is that your code does not contain any stored procedures.  Period.  Further you do not even need a Command object for such a trivial exercise.

Glad you got it figured out.
0
 
LVL 1

Accepted Solution

by:
kodiakbear earned 0 total points
ID: 17877202
Closed, 125 points refunded.
kb
Experts Exchange Moderator
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question