How to catch "an insufficient number of arguments" error?

Hi All,
I have a question - how to cauch this error:
SELECT * FROM dbo.ExistingFunction ('Wrong number of params - ExistingFunction expects 2 of them')
I tried using try-catch (both on the same level and one level higher) but with no success.
Best Regards,
Mike

There are a couple of variations with this error, because it depends on when the mismatch between the caller and the function occurs.
1) The function call is incorrect when you attempt to create the procedure => the procedure will not be created.
2) The function was correct when you created the procedure, but the function was changed before the procedure was compiled and put into cache. In this case compilation of the procedure fails, and it is never entered. And thus you cannot trap it in the procedure
itself. You can catch it in outer scope.
3) The function was changed after the procedure was put into cache. This causes a statement recompile at run-time, and as will all compilation errors, you cannot catch this in the local CATCH block despite you have entered the TRY block. You cannot however
trap it in the caller.
You say that you are not trap it even one level higher, but that is certainly possible, as testified by the repro below:
[sql]
CREATE FUNCTION funkis (@a int)
RETURNS @r TABLE (a int) AS
BEGIN
   INSERT @r VALUES(@a + 1)
   RETURN
END
go
CREATE PROCEDURE inner_sp AS
BEGIN TRY
   PRINT 'Entering inner_sp'
   SELECT * FROM dbo.funkis(1)
   PRINT 'Exiting inner_sp'
END TRY
BEGIN CATCH
   PRINT 'Error trapped in inner_sp: ' + error_message()
END CATCH
go
CREATE PROCEDURE outer_sp AS
BEGIN TRY
   PRINT 'Entering outer_sp'
   EXEC inner_sp
   PRINT 'Exiting outer_sp'
END TRY
BEGIN CATCH
   PRINT 'Error trapped in outer_sp: ' + error_message()
END CATCH
go
EXEC outer_sp
PRINT '------------------------'
go
ALTER FUNCTION funkis (@a int, @b int)
RETURNS @r TABLE (a int) AS
BEGIN
   INSERT @r VALUES(@a + @b)
   RETURN
END
go
EXEC outer_sp
go
DROP FUNCTION funkis
DROP PROCEDURE inner_sp, outer_sp
[sql]
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • ADO Error: an insufficient number of arguments....

    Im currently using Access 2000 which is connected to a SQL database. I have a query (Or View) that runs every month. The problem i had was i had to manually make some changes every month to get to the data i needed so i changed this View into a Function with a parameter so i can input the detail(s) i need and it will run correctly - this works so far but the original View was also used within other queries that were created. Now the problem i have now is some of the other views that are now connected with the newly created Function comes up with the error:
    ADO error: an insufficient number of arguments were supplied for the procedure or function Name_Of_Function.
    I called the newly created function the exact name as the original view to ensure i had no problems. Any idea of whats happening here and how to resolve?
    Thanks

    Heres the function i have:
    Code BlockSELECT     TOP 100 PERCENT dbo.[Totals].User, dbo.[Totals].[Account Name], dbo.[Totals].Company, dbo.[Totals].Name,
                          dbo.[User].Amount AS [Month Amount], dbo.[User].Profit AS [Month Profit], SUM(dbo.[Totals].[Y Amount]) AS [Y Amount],
                          SUM(dbo.[Totals].[Y Profit]) AS [Y Profit], dbo.[User].Month
    FROM         dbo.[User] RIGHT OUTER JOIN
                          dbo.[Totals] ON dbo.[User].[Account Name] = dbo.[Totals].[Account Name] AND
                          dbo.[User].User = dbo.[Totals].User
    GROUP BY dbo.[Totals].User, dbo.[Totals].[Account Name], dbo.[Totals].Company, dbo.[Totals].Name,
                          dbo.[User].Amount, dbo.[User].Profit, dbo.[User].Month
    HAVING      (NOT (dbo.[Totals].User = N'Temp')) AND (dbo.[User].Month = @Month)
    ORDER BY dbo.[Totals].User, dbo.[Totals].Company
    Where it states Month = @Month is where the problem is i think. This Function runs fine as i want it to. But when im in another view that uses this function it get the above error. The only way i dont get the error is when i type in the month then all runs fine - but i would prefer it to ask me what month i need the data for????
    Thanks

  • Error: An insufficient number of arguments were supplied for function

    Hi ,
    I changed the data source for a data set on my report . The data source  is still pointing to same server and database but I am getting this error 
    "An error occurred during local report processing
    Query execution failed for data set 'Data Set Name'
    An insufficient number of arguments were supplied for function "
    I checked the function number of arguments again and it was correct and even executed the function in the dataset query designer and it works fine.
    any ideas for the reason for this error ?

    Without seeing the query you use or function its hard to suggest.
    See if parameter passed from SSRS has expected values. Is there some multivalued parameters involved?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Wron number of arguments error on URLEncoder.encode(language,

    the following is the code which is an example in The complete Reference JSP
    I ran this in tomcat
    it shows an error which is showed down this code.The place where error occuring is underlined in the code
    <%@ page session="false"
    import="java.io.*,
    java.net.*,
    java.util.*" %>
    <html>
    <head>
    <title>Using Cookies to Store Preferences</title>
    <style><%= STYLESHEET %></style>
    </head>
    <body>
    <table border="0" cellspacing="3" width="500">
    <%-- Company logo --%>
    <tr><td>
    <img src="images/lyric_note.png">
    </td></tr>
    <%-- Language preference bar --%>
    <tr><td class="LB">
    <%= getLanguageBar(request) %>
    </td></tr>
    </table>
    <%-- Localized greeting --%>
    <h1><%= getGreeting(request) %></h1>
    <%-- Store language preference in a persistent cookie --%>
    <% storeLanguagePreferenceCookie(request, response); %>
    </body>
    </html>
    <%!
    // ===========================================
    // Helper methods included here for
    // clarity. A better choice would be
    // to put them in beans or a servlet.
    // ===========================================
    * The CSS stylesheet
    private static final String STYLESHEET =
    "h1 { font-size: 130%; }\n"
    + ".LB {\n"
    + " background-color: #005A9C;\n"
    + " color: #FFFFFF;\n"
    + " font-size: 90%;\n"
    + " font-weight: bold;\n"
    + " padding: 0.5em;\n"
    + " text-align: right;\n"
    + " word-spacing: 1em;\n"
    + "}\n"
    + ".LB a:link, .LB a:active, .LB a:visited {\n"
    + " text-decoration: none;\n"
    + " color: #FFFFFF;\n"
    + "}\n";
    * Creates the language preference bar
    private String getLanguageBar
    (HttpServletRequest request)
    throws IOException
    String thisURL = request.getRequestURL().toString();
    StringBuffer sb = new StringBuffer();
    appendLink(sb, thisURL, Locale.ENGLISH);
    appendLink(sb, thisURL, Locale.GERMAN);
    appendLink(sb, thisURL, Locale.FRENCH);
    appendLink(sb, thisURL, Locale.ITALIAN);
    String languageBar = sb.toString();
    return languageBar;
    * Helper method to create hyperlinks
    private void appendLink
    (StringBuffer sb, String thisURL, Locale locale)
    throws UnsupportedEncodingException
    if (sb.length() > 0)
    sb.append(" ");
    String language = locale.getLanguage();
    sb.append("<a href=\"");
    sb.append(thisURL);
    sb.append("?language=");
    sb.append(URLEncoder.encode(language, "UTF-8")); sb.append("\">");
    sb.append(locale.getDisplayName(locale));
    sb.append("</a>\n");
    * Gets the greeting message appropriate for
    * this locale
    private String getGreeting
    (HttpServletRequest request)
    Locale locale = getLocaleFromCookie(request);
    ResourceBundle RB = ResourceBundle.getBundle
    ("com.jspcr.sessions.welcome", locale);
    String greeting = RB.getString("greeting");
    return greeting;
    * Determines the locale to use, in the following
    * order of preference:
    * 1. Language parameter passed with request
    * 2. Language cookie previously stored
    * 3. Default locale for client
    * 4. Default locale for server
    private Locale getLocaleFromCookie
    (HttpServletRequest request)
    Locale locale = null;
    String language = request.getParameter("language");
    if (language != null)
    locale = new Locale(language);
    else {
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
    for (int i = 0; i < cookies.length; i++) {
    Cookie cookie = cookies;
    String name = cookie.getName();
    if (name.equals("language")) {
    language = cookie.getValue();
    locale = new Locale(language);
    break;
    if (locale == null)
    locale = request.getLocale();
    return locale;
    * Stores the language preference
    * in a persistent cookie
    private void storeLanguagePreferenceCookie
    (HttpServletRequest request, HttpServletResponse response)
    Locale locale = getLocaleFromCookie(request);
    String name = "language";
    String value = locale.getLanguage();
    Cookie cookie = new Cookie(name, value);
    final int ONE_YEAR = 60 * 60 * 24 * 365;
    cookie.setMaxAge(ONE_YEAR);
    response.addCookie(cookie);
    %>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 45 and 173 in the jsp file: /chap08/examples/cookies/CookieBasedWelcome.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\_\chap08\examples\cookies\CookieBasedWelcome$jsp.java:75: Wrong number of arguments in method.
    sb.append(URLEncoder.encode(language, "UTF-8"));
    ^
    An error occured between lines: 45 and 173 in the jsp file: /chap08/examples/cookies/CookieBasedWelcome.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\_\chap08\examples\cookies\CookieBasedWelcome$jsp.java:110: Wrong number of arguments in constructor.
    locale = new Locale(language);
    ^
    An error occured between lines: 45 and 173 in the jsp file: /chap08/examples/cookies/CookieBasedWelcome.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\_\chap08\examples\cookies\CookieBasedWelcome$jsp.java:119: Wrong number of arguments in constructor.
    locale = new Locale(language);
    ^
    3 errors
    But i have even checked the syntax of encode at which is exactly matching
    http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html
    Kindly let me know what is the reason.......

    Check the Java API for this:
    There is a specific note for the method, which reads as follows:
    Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
    It's always better to look in API docs.
    Annie.

  • How to catch/read mal-formed xml at Error Handler.

    I have added Error Handler at starting node of Message Flow in a Proxy Service and its(Proxy Service) listenning to a JMS queue.
    So when i am putting a mal-formed XML into the JMS queue, getting "Failure while unmarshalling message: Failed to parse XML text" error at ALSB server log.
    But i am not able to capture the mal-formed xml inside Error Handler node.
    Can any one help me how to capture input mal-formed xml in Message Folw.
    Thanks in Advance.
    Regards.
    Deba

    Re: How to catch malformed xml using error handling mechanism in from a proxy? Had a solution for similar issue. It appears that in-case of malformed XML, $body will not be populated with faulty xml snippet. One way out of this solution is, design your service as Text service and create another service isXML as explained in my above reply.
    Thanks
    Manoj

  • How to catch accounting Document Number in SE37 for  BAPI_ACC_DOCUMENT_POST

    HI Frds,
    My ReQ is i have to post Customer Invoice from Legacy to ECC through PI interface. So i am using one BAPI , ' BAPI_ACC_DOCUMENT_POST''. I had customized this BAPI by adding 2 fields (1.zstatus, 2.zsaprefno) as i have to send the status(1. Success/Fail, 2.Account Document Number) back to Legacy.
    For PI i have to give the BAPI structure. So when i am executing in SE37 zstatus field is catching the value as 'Success'. But the ZSAPREFNO is not catching the account document number. Bez we have to execute BAPI_TRANSACTION_COMMIT after this BAPI(in test sequence from Menu bar). So directly updating in Database tables.
    when i was excuting in SE38 the Accounting Document Number is returned in RETURN parameter of MESSAGE_V2 as we are checking the return parameter after BAPI_TRANSACTION_COMMIT.
    when i am trying in SE37 its not catching the value in MESSAGE_V2(catching as $).  After COMMITing we have no option to check the RETURN parameter.
    So, any idea how to get the Account Document Number  in SE37.......Or any other way to do..........
    Edited by: priya tavanam on Sep 3, 2010 7:02 AM

    Hi,
    if standard BAPI did not return the Acc. document number before BAPI_COMMIT then create wrapper FM
    1) call actual BAPI and BAPI_COMMIT with in that.
    2) retrun the account document back.
    otherwise you can try sync proxy as well.
    Regds,
    Suresh

  • How to catch server port number.

    Hi All,
       I want to disaply host name & port number of present server in the textview.
       For Host name i have used following code. It's working great.
         InetAddress n=InetAddress.getLocalHost();
         String name=n.getHostName();
         wdContext.currentContextElement().setSn(name);
       In the same way i need The Server port number also. Can you give whcih calss i have to use to get port number. plase give me the solution.
    Thanks and Regards
    Praveen.D

    Using WDURLGenerator.getAbsoluteWebResourceURL(deployableObjectPart); you will get the complete url then you need to have a logic to just take Hostname : hostport
    Vinay

  • Incorrect number of arguments error

    Seems like a simple task, and i've used the same method for other files but for some reason it doesn't recognize the arguments. Here's just the code relating to my error. I made bold the line with the error.
    var loader:Loader;
    var i:Number = 1;
    var container:Sprite;
    function imgLoad(e:MouseEvent):void {
         i++;
         if (i == 3) {
              i = 0;
         loader = new Loader();
         loader.load(new URLRequest("resized Images/Bracelet" + String(i) + ".jpg"));
         preload_mc.visible = true;
         loader.contentLoaderInfo.addEventListener(Event.INIT,imgComplete,false,0,true);
         loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,imgProgress,false,0,true );
    function imgProgress(e:ProgressEvent):void {
         var loaded:Number = e.bytesLoaded;
         var total:Number = e.bytesTotal;
         var pct:Number = loaded/total;
         preload_mc.loader_mc.scaleX = pct;
    function imgComplete(e:Event):void {
         container = new Sprite();
         addChild(container);
         var myLoader:Loader = new Loader(e.target.loader);
         container.addChild(myLoader);
         smallImg_mc.visible = false;
         fullMode_txt.visible = false;

    Loader constructor doesn't accept any arguments:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#Loader

  • How to use ... when there is uncertain number of arguments

    I just tried to write the following method
    public void analyze(int index, Object... flags)
    Assume I have passed 5 arguments into the method, how can I manipulate each of them?
    Thanks

    I just tried to write the following method
    public void analyze(int index, Object... flags)
    Assume I have passed 5 arguments into the method, how
    can I manipulate each of them?
    Thanks_flags.length should give you the number of arguments passed to the method. It can be treated as if it were an array.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I view the number of items I have in a folder on Mac 10.9.2 (Mavericks)?

    I have only been using Mac OS X 10.9.2 (Mavericks) for a little while so I'm having to deal with many inconveniences that I didn't have to face with Mac OS X 10.6.3 (Snow Leopard). It's frustrating that 10.9.2 (Mavericks) doesn't let me tap twice on the trackpad in order move or drag something, but at least I figured out how to do this in a different way. One part that I cannot figure out is how to view the number of files in each folder. With Snow Leopard, I was able to view the number of files on that folder automatically by looking at the bottom of the folder (*See the example on the photo). On the bottom of that folder, you will see the number of items, which it 10. Every time I add new files (or folders within that folder), it will update the number of items to the appropriate number. This is especially useful to me if I'm going to have many items within a folder and when I need to make sure that the number I have is exact. For example, sometimes I have to save files in a precise number and order. If I miss saving a file with a specific number, and I don't catch that the number of items is off as early as possible, I may have to waste time looking through files to try to figure out what is missing. For this reason, I have to find a convenient way to view the number of items in each folder with Mac OS 10.9.2 (Mavericks) or else using it will be a hassle. 
    Now that I'm using Mac OS X 10.9.2 (Mavericks), I don't see any information on the folder that tells me how many items are in it (*See photo below). I keep looking to see if it's located somewhere else on the folder or if I can change the folder preferences to make it become visible. I also clicked on the folder and on "Get Info" (which would be inconvenient if I had to do this constantly). This showed me the number of items in that folder but I can't always keep checking like this because it's time-consuming and distractive.
    I need to find a way to make the number of items appear on the folder itself, while it is open.
    Do you know a convenient way to view the number of items in a folder?
    Is there some way I can change the preferences so that the number becomes visible on the folder itself?

    Open the Finder's View menu and choose 'Show Status Bar'.
    (111921)

  • Urgent******how can i get the number of rows enterd by the user in a table

    Hi Frndz..
    As per my requirement i need to do the validations for the multipple rows in a table that was enterd by the user,
                   T
              The prob is how can i get that number of rows that enterd by user,
           WDMessageManager msg = wdComponentAPI.getMessageManager();
         String col1= "";
         String col2= "";
         double col3= 0;
         double col4= 0;
         double amount= 0;
         int nodesize = wdContext.nodeTest().size();
         try
         for(int i=0; i<=2 ; i++)
                   col1 = wdContext.nodeTest().getTestElementAt(i).getCol1();
                 //msg.reportSuccess("col1 size is :"+col1);
                   col2 = wdContext.nodeTest().getTestElementAt(i).getCol2();
                   col3 = wdContext.nodeTest().getTestElementAt(i).getCol3();
                   col4 = wdContext.nodeTest().getTestElementAt(i).getCol4();
                    amount = wdContext.nodeTest().getTestElementAt(i).getAmount();
              if(col1 == "" )
                        msg.reportException("Plz fil the col1 for line:",true);
                   break;
              else
              if(col2 == "" )
                                  msg.reportException("Plz fil the col2 for line:",true);
                             break;
                        else
              if(col3 <= 0)
                   msg.reportException("Plz fil the col3:",true);
                   break;
              else
                   if(col4 <= 0)
                   msg.reportException("Plz fil the col4:",true);
                   break;
              msg.reportSuccess("skvgjhdfgasdfgsjkafguisafisenvtvyeriy");
                                                       wdThis.test();
         catch (Exception e)
                   msg.reportException("strMessage in catch block",true);
         this is the code am going
    Regards
    Rajesh

    Hi,
       You can try this:
    * Let's say the table's datasource is a node called Table  and it has two attributes first & second.
    * You want to check if any of these attributes has been changed by the user or not. If they have been
    * changed then you want to do some validations against them.
      int sizeOfTable = wdContext.nodeTable().size();
      for(int i = 0; i < sizeOfTable; i++){
         IPrivate<view name>.ITableElement ele = wdContext.nodeTable().getTableElementAt(i);
         if(ele.isChangedByClient(ITableElement.<attribute name>)){
            //value has been changed, do some validation. You can get the row index using ele.index().
    Regards,
    Satyajit.

  • Variable number of arguments in C functions

    Hello. I know how to achieve creating a function that accepts a variable number of arguments. For example:
    #include <stdio.h>
    #include <stdarg.h>
    int add (int x, ...);
    int main (int argc, const char * argv[])
    int result = add(3, 5, 3, 7);
    printf("%d", result);
    return 0;
    int add (int x, ...)
    va_list argList;
    va_start(argList, x);
    int sum = 0;
    int i;
    for (i = 0; i < x; ++i)
    sum += va_arg(argList, int);
    va_end(argList);
    return sum;
    The first argument, x, is sent to the function and represents how many additional optional arguments will be sent to the function (3 in the above example). Then, the definition of the add function totals those remaining (3) arguments, returning a value of (in this case) 15, which main then prints to the console. Simple enough, but here's my question:
    What if I want to achieve this same optional arguments concept without having to send the function the number of optional arguments it will be accepting. For example, the printf() function takes an optional number of arguments, and nowhere there do you have to specify an extra argument that represents the number of additional optional arguments being passed (unless maybe the number of formatting specifiers in the first argument determines this number). Can this be done? Does anyone have any input here? Thanks in advance.

    Hi Tron -
    I looked over my first response again, and it needs to be corrected. Fortunately Bob and Hansz straightened everything out nicely, but I still need to fix my post:
    RayNewbie wrote:
    Yes, the macros are designed to walk a list of args when neither the number of args or their type is known.
    The above should have said. "The macros are designed to walk a list of args when neither the number of args or their type is known _at compile time_".
    If I may both paraphrase and focus your original question, I think you wanted to know if there was any way the function could run without knowing the number of args to expect. The answer to this question is "No". In fact at runtime, the function must know both the number of args and the type of each.
    Tron55555 wrote:
    ... the printf() function takes an optional number of arguments, and nowhere there do you have to specify an extra argument that represents the number of additional optional arguments being passed (unless maybe the number of formatting specifiers in the first argument determines this number).
    As both Bob and Hansz have explained, the underlined statement is correct. Similarly, the example from the manual gives the number and types of the args in the first string arg.
    Hansz also included an alternative to an explicit count or format string, which is to terminate the arg list with some pre-specified value (this is sometimes called a "sentinel" value. However when using a sentinel, the called function must know the data types. For example, you could never simply terminate the args with a sentinel and then pass a double followed by an int. The combined length of these args is 8 + 4 => 12 bytes, so unless the function knew which type was first at compile time, it wouldn't be possible to determine whether the list was 4+8 or 8+4 at runtime.
    If you're interested in knowing why a variable arg function is limited in this way, or in fact how any C function finds its args, its parameters, and how to return to the calling function, you might want to do some reading about the "stack frame". You can learn the concept without getting into any assembler code. Here's an article that might be good to start with: [http://en.citizendium.org/wiki/Stack_frame].
    After you have some familiarity with the stack frame, take a look at the expansions of the stdarg macros and see if you can figure out how they work, especially how va_arg walks down the stack, and what info is required for a successful trip. Actually, I don't think you can find these expansions in the stdarg.h file for Darwin; it looks like the #defines point to built-in implementations, so here are some typical, but simplified defs:
    // these macros aren't usable; necessary type casts have been removed for clarity
    typedef va_list char*;
    #define va_start(ap,arg1) ap = &arg1 + sizeof(arg1)
    #define va_arg(ap,type) *(ap += sizeof(type))
    #define va_end(ap) 0
    Note that I"m trusting you not to start asking questions about the stack or the above macros until you've studied how a stack works and how the C stack frame works in particular.
    - Ray

  • Error: parse error before '.' & number of arguments doesn't match

    Compiling my simple source code reports error error: parse error before '.' . But in fact there is not any "." token on this line.
    At my guess it has something to do with JNI C macros but I really have no idea how to find that bug
    // ##net_java_dev_jssm_MulticastSSM.h: line 55
    JNIEXPORT void JNICALL Java_net_java_dev_jssm_MulticastSSM_join2
      (JNIEnv *, jobject, jstring, jstring);
    // ##net_java_dev_jssm_MulticastSSM.c: line 306
    JNIEXPORT void JNICALL Java_net_java_dev_jssm_MulticastSSM_join2
      (JNIEnv *env, jobject obj, jstring s_addr, jstring g_addr) {
    // no code yet
    mingw32-gcc.exe -DWIN32 -Wall -c -IC:\java\JNI_headerFiles\jdk1.6.0/include -IC:\java\JNI_headerFiles\jdk1.6.0/include/win32 -shared src_c/net_java_dev_jssm_MulticastSSM.c -DNODEBUG
    src_c/net_java_dev_jssm_MulticastSSM.c:307: error: parse error before '.' token
    src_c/net_java_dev_jssm_MulticastSSM.c: In function `Java_net_java_dev_jssm_MulticastSSM_join2':
    src_c/net_java_dev_jssm_MulticastSSM.c:307: error: number of arguments doesn't match prototype
    src_c/net_java_dev_jssm_MulticastSSM.h:56: error: prototype declaration
    make: *** [all] Error 1
    C compiler: mingw32-gcc.exe
    JNI: jdk1.6.0
    Any help would be really appreciated.

    Hi radone,
    I just read your posting and suddently got an idea why your compiler was complaining about the period. In most C environment, there is a definition
    #define s_addr S_un.S_addr
    in some socket-related header file! Now you know where the dot is coming from.

  • Error message: 450 [Wrong number of arguments or invalid property assignment]

    Hello Support,
    I have a vbscript which does some database query. i see from the log that script quits with the below error.
    Error message: 450 [Wrong number of arguments or invalid property assignment]
    but when i execute the same query directly on database, it gives me correct result. also i see that not all the time script quits with this error.
    Does anyone have idea how to troubleshoot it?
    -KAKA-

    i see. i know at which line it fails as error handling is done and will be written in the log.
    sQuery_Prod = "select object_text from sto_ov_externalnode where name = '" & NodeId & "'"
    oRecordSet_Prod.Open sQuery_Prod, oConnection, adOpenStatic, adLockOptimistic
    if err.number <> 0 then
    LogWrite ("Unable to run query")
    LogWrite ("Query: [" & sQuery_Prod & "]")
    LogWrite ("Connection string: [" & sConnect & "]")
    LogWrite ("Error message: " & err.number & " [" & err.description & "]")
    wscript.quit(1)
    end if
    and this piece of code write following in the log.
    07.10.2014 16:55:03:Unable to run query
    07.10.2014 16:55:03:Query: [select object_text from sto_ov_externalnode where name = '{B10255CF-F618-45FB-99BC-31A57D747702}']
    07.10.2014 16:55:03:Connection string: [DSN=Script;DRIVER={SQL Native Client};User ID=xxxxxx;Password=yyyyyy]
    07.10.2014 16:55:03:Error message: 450 [Wrong number of arguments or invalid property assignment]
    Where as i can run query "select object_text from sto_ov_externalnode where name = '{B10255CF-F618-45FB-99BC-31A57D747702}'" successfully directly on database.
    also in the next cycle same query will be successfull within script too.
    Does this help in understanding the problem?
    -KAKA-

  • How to catch  Timestamp in bean

    hi
    in servlet I can use
    HttpSession userSession = req.getSession(true);
    HttpSession session=req.getSession();
    Timestamp accessed = new
    Timestamp(session.getLastAccessedTime());
    how can I got then in bean
    Thank you

    hi , thank you for the kindness reply,
    I guess is something else wrong so I post my codepublic boolean validate() {
             boolean allOk=true; 
             if (stuNumber.equals("")|| stuNumber.length() !=10) {
                 errors.put("stuNumber","Please enter a valid student Number");
                 stuNumber="";
                 allOk=false;
               } else {
                   try {
                       int x = Integer.parseInt(stuNumber);
                     } catch (NumberFormatException e) {
                       errors.put("stuNumber","Please enter a valid student Number");
                       stuNumber="";
                       allOk=false;
               }//else
             //add into database
             try {
                  //use getInstance() method to get object of java Calendar class
                   //Calendar cal = Calendar.getInstance();             
                   Timestamp myTimestamp = new Timestamp(new Calendar().getTimeInMillis());
                    db =connectionPool.getConnection();
                     Statement s = db.createStatement(); 
                     rs = s.executeQuery("SELECT*  FROM survey where stuNumber='"+stuNumber+"'");           
                 connectionPool.returnConnection(db);
                 int count =0;//how many rows we can find.
                while (rs.next()){
                    count++;
                connectionPool.returnConnection(db);
                if(count<1){                       
                    db.setAutoCommit(false);
                  String  sql="insert into survey(name, stuNumber, gender,facultyName,degree, year, quesOne, quesTwo, quesThree, quesFour, quesFive, quesSix,quesSeven, quesEight, quesNine,quesTen,quesEleven, quesTwelve, quesThirteen, quesFourteen,quesFifteen, quesSixteen, quesSeventeen, quesEighteen, quesNineteen, quesTwenty, quesTwentyOne,userIp,accessTime)";
                                       sql+="value(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                        ps = db.prepareStatement(sql);
                         ps.setString(1, name);
                          ps.setString(2, stuNumber);
                          ps.setString(3, gender);
                          ps.setString(4, facultyName);
                          ps.setString(5, degree);
                          ps.setString(6, year);
                          ps.setString(7, quesOne);
                          ps.setString(8, quesTwo);
                          ps.setString(9, quesThree);
                          ps.setString(10, quesFour);
                          ps.setString(11, quesFive);
                          ps.setString(12, quesSix);
                          ps.setString(13, quesSeven);
                          ps.setString(14, quesEight);
                          ps.setString(15, quesNine);
                          ps.setString(16, quesTen);
                          ps.setString(17, quesEleven);
                          ps.setString(18, quesTwelve);
                          ps.setString(19, quesThirteen);
                          ps.setString(20, quesFourteen);
                          ps.setString(21, quesFifteen);
                          ps.setString(22, quesSixteen);
                          ps.setString(23, quesSeventeen);
                          ps.setString(24, quesEighteen);
                          ps.setString(25, quesNineteen);
                          ps.setString(26, quesTwenty);
                          ps.setString(27, quesTwentyOne);
                          ps.setString(28,userIp);
                          ps.setTimestamp(29,timeStampDat);
                          ps.executeUpdate();                   
                   db.commit();
                db.setAutoCommit(true);   
                connectionPool.returnConnection(db);
               }//end try
               catch (Exception e) {
                 System.out.println("Error populating myBean: " + e.toString());
             return allOk;        
    }

Maybe you are looking for

  • Iphone 4 mail icon shows 3 emails, but do not show in the inbox

    I set up my new iphone 4 with my email and all the mail came in yesterday just fine. Today, the icon updates when a new email comes in but when I go to the inbox, it isn't showing. It goes through the update process but nothing updates. Is there a se

  • Is there any Web Service to create Internal Order?

    Hi, I have to find out a suitable Web Service which can create internal order. I have searched in SOAMANAGER but did not find any such WS. Does anybody have an idea whether there is any such WS?

  • Function Module Get Conf by PO number

    Dear Expert, I would like to get Confirmation number by PO Number. Please let me know what the Function module should I use in SRM example : I have a PO number, I want to know the confirmations number related for these PO number Many Thanks

  • Arch User Script Repository?

    As I was browsing through the sticky, which is full of useful stuff, I found searching this ever longer and more disorganized thread for a script for a particular purpose difficult. Wouldn't it be great to have an organized repository for these contr

  • Plugin for jsp in Eclipse3.0

    Hello All, How can i get a plugin for JSP in Eclipse3.0? What is the procedure for installing the plugin? Please help me out. Thanks in advance. Minal.