Results 1 to 4 of 4

Thread: Insert Into

  1. #1
    Join Date
    Oct 2002
    Location
    Houston, TX
    Posts
    34

    Unanswered: Insert Into

    I have a INSERT query into my SQL database that something wierd is happening.

    I keep getting an error trying to insert into my database. I am pretty sure that this is a conversion problem from my variables which are coming from a file uploader script.

    I have tried replacing the variables with actual text and it INSERTs into the database fine.

    What conversion function do I need to apply to these variables?

    The column in my database is set to VarChar.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What is the error message that you get?

    I think it is good practice whenever feasible to load data into a staging table first. The staging table is set up to apply the absolute minimum restrictions on the data that it will accept. IE, anything will go into the staging table. The data is then cleansed and loaded into the primary database schema, and all succesfully loaded records are deleted from the staging table. This makes it easy to identify what values are causing the error.

    blindman

  3. #3
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Insert Into

    Originally posted by rob7765
    I have a INSERT query into my SQL database that something wierd is happening.

    I keep getting an error trying to insert into my database. I am pretty sure that this is a conversion problem from my variables which are coming from a file uploader script.

    I have tried replacing the variables with actual text and it INSERTs into the database fine.

    What conversion function do I need to apply to these variables?

    The column in my database is set to VarChar.

    Please state the INSERT statement AND your error message. You should understand, that you are the only person knowing the details. Without these details, just general answers are possible.
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  4. #4
    Join Date
    Oct 2002
    Location
    Houston, TX
    Posts
    34
    Here are the files that are associated with this problem.

    picupload.asp -- the form where data is entered. POST to Insert.asp
    insert.asp -- has include at top of file to loader.asp Then has form that POST to write2DB.asp
    loader.asp -- this is where I think the data is getting screwed up.
    write2DB.asp -- INSERT statement. I have text in some of the variables for testing purposes. The CustID and CID are working fine. Notice I had to use CLng function on them to get them working. I can't figure out what to apply to the text fields to make them work.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •