Results 1 to 5 of 5

Thread: Leading Space problem

  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Leading Space problem

    In asp-db enterprise using ORACLE 8i, is there a way to process character information that has leading spaces on the database. Asp-db is chopping the leading spaces off and is not able to update/delete etc...

    Please help!

    Thanks!

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    Leading space in what? Data field values? A leading space should not affect update and delete. Explain more. What is the purpose of the leading space or it is just from user input. Do you need to input values with a leading space on purpose?


    FK

  3. #3
    Join Date
    Nov 2003
    Posts
    2
    Here is some code. The BDN_NUMBER which is really a VARCHAR field because it can contain characters other than 0-9, contains number like " 999" and "1000". When " 999" is being updated nothing happens because the SQL generated updates "999". I need to tell the system to use the leading space as data.


    Set MyDb = Server.CreateObject("ASPdb.EP")
    MyDb.dbUnit = 10515
    MyDb.dbDSN = SESSION("DBCONN")
    MyDb.dbDBType="ORACLE"
    MyDb.dbMode= "dual-horiz"
    MyDb.dbSQL = "SELECT PARENT_NUMBER, " & _
    " BDN_NUMBER " & _
    " FROM RA.ACCOUNT_CHAIN " & _
    " WHERE PARENT_NUMBER = " & SESSION("PARENTNUMBER")
    MyDb.dbMagicCell = _
    "0, align=left, <font size=2>#0#;" & _
    "1, align=center, <font size=2>#1#;"
    MyDb.dbNavigationItem="top, bottom, next, prev, filter, download, edit"
    MyDb.dbNameMap = "Parent_number,Parent;" & _
    "BDN_number,Account;"
    MyDb.dbGridInc=15
    MyDb.dbFormDisplayFlds = "-1"
    MyDb.dbTestBlankSQL="SELECT PARENT_NUMBER FROM RA.ACCOUNT_CHAIN WHERE PARENT_NUMBER = " & SESSION("PARENTNUMBER")
    MyDb.dbEditParams="TableName=RA.ACCOUNT_CHAIN, BookMarkFlds=0+1, TableTag=BORDER=1"
    MyDb.dbEditFlds="0[" & SESSION("PARENTNUMBER") & "],1"
    MyDb.dbEditAddROFlds = "0"

    'MyDb.dbdebug = 3
    MyDb.ASPdbEP

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    Where is the SQL check for " 999" and reject "999" takes place? Does this " " space has to be in the SQL? Does the edit entry actually a " 999" with a leading space or the edit input is formatted somewhere.

    I Checked and the Input values are trimmed. Before we come up with a solution to this problem please identify how the user input this "formatted" values like " 999" - they actually put in leading space? The ultimate way to deal with this problme is to furnish a formatting option for input values which is fairly involved.


    FK

  5. #5
    Join Date
    Oct 2002
    Posts
    933
    Do not get discouraged by this kind of odd ball problems. One of the features of the next major release (looks like in Jan 2004) will be validation via "user code". With that, you can write your own filter to process the field values.


    Frank

Posting Permissions

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