html sql - sql timeout

Posted on 2004-11-03
Last Modified: 2012-05-05
I get the following error;

Error Number: 350
Error Text: Native SQL Error Code
Error Hint Text: Native SQL Error Code

SQL STATEMENT: INSERT INTO xcards2004 (Use_Flag,Company_Number,Company_Name,Home_Email,Work_Email,First_Name) VALUES(' ','000031352','Deloitte & Touche LLP ',' ',' ','MICHAEL ')
SQL 350 STATEMENT: [Microsoft][ODBC SQL Server Driver]Timeout expired

The code is as follows;

<iINCLUDE name='d:\usersites\htdocs\admin\'>

<div class="d" align="center">AS/400 User Interface</div>
<ieq name="filepath1" value='d:\emaildata\'>
<ieq name="filepath2" value='.txt'>
<ieq name="filepath" value=:filepath1:CallListName:filepath2>
<ieq name="cdata" value=`}<iFile name=":filepath" op="read">`>
<iEQ name="Ctext" value="text">
<iEQ name="CLText" value=:CallListName:Ctext>
<iEQ name="begin" value="Begin">

<iEQ name=NumOfRecords value=<iListget name=TESTLIST op=count>>

<iIf cond=<iStrcmp src=<iStrlen src=`:cdata`> dst="1">>
<p align="center">
No data was transfered from the AS400.<br>
Go back to the first page and check your data.<br>

<iEQ name=fieldstring value="Use_Flag,Company_Number,Company_Name,Home_Email,Work_Email,First_Name">

<iSQL DBNAME="emailerdb" SQL="CREATE TABLE :CallListName (List_ID integer NOT NULL IDENTITY,Use_Flag VARCHAR(1) NULL,Company_Number VARCHAR(9) NULL,Company_Name VARCHAR(255) NULL,Home_Email VARCHAR(255) NULL,Work_Email VARCHAR(255) NULL,First_Name VARCHAR(255) NULL)" LOGIN="tax-talentdata/tony12" ALIAS="TABLETEST">
<iSQL DBNAME="emailerdb" SQL="CREATE INDEX CnameIndex ON :CallListName (Company_Name)" LOGIN="ta" ALIAS="TABLETEST2">

<iLOOP initial=1 final=:NumOfRecords>
<iEQ name=item1 value=`<iListget name=TESTLIST op=getat index=:i_loop>`>

<iREPLACE var=item1 src="}" dst="">
<iREPLACE var=item1 src="~" dst="','">
<iEQ name=finalitem1 value="'">
<iEQ name=finalitem value=":finalitem1:item1:finalitem1">

<iSQL DBNAME="emailerdb" SQL="INSERT INTO :CallListName (:fieldstring) VALUES(:finalitem)" FAILURE="ErrorIDENTIFIER: :i_error :i_errortext :i_sqlerrortext" LOGIN="ta" ESC=FALSE>

<p align="center">
<br>Number of Records: :NumofRecords<BR><BR>
The data has been stored in a table called :CallListName.<br>


<iINCLUDE name='d:\usersites\taxtalent2\htdocs\admin\'>

This code runs for a small file of 15 records but not for 600. I have no idea what timeout happened. I checked the ODBC and SQL. I changed the IIS server timeout from 120 to 360 but no change. The timeout actually happens at about 45 seconds. The table has about 130 records in it when it fails (starts with zero).

Question by:larksys
    LVL 6

    Assisted Solution

    I think that this error does not occur on the web server, but on the SQL Server. Inside SQL Server timeouts can be defined as well (don't know exactly where).

    Since the error occurs while inserting data into a table, my guess is that the table is locked at the moment of the insert and that it takes too long to be released so your data can be inserted. Are there any other processes running on the same SQL Server table? Like any other applications inserting/updating or deleting? Or is your application the only application at that moment.

    What you could do is use enable tracing on the SQL Server and see what happens when you insert data.
    LVL 1

    Accepted Solution

    this has nothing to do with the db, it is a odbc connection timeout between db and app. you need to set the actual connection variables:
    ConnectionTimeout = 0
    CommandTimeout = 0

    note: 0 = never times out, good for testing but in best practice you want to set it to 2x your system threshold but never infinite. for more info on commandtimeout.
    LVL 1

    Author Comment

    Can you point me to the timeout parameters. I cannot find them under ODBC admin or SQL Ent Manager. Do I have to set them with javascript? That might be the only access I have to them via html.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
    In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now