Process works fine... how to track which column is causing error..

hi, i have a big sp which does lets say tasks A, B, C, D...
After every task i.e A, B, C, D I have an update or insert
statement. The update & insert both work fine, except that I
have coldfusion catch code for sp execution and it returns String
or binary data would be truncated error. Normally this means
inserting something into a column whose lenght is less than whats
being inserted. I understand this , but how can i determine which
column is causing problem since after tasks A,B,C,D the insert or
update i have is working fine. It would be have easy if i couldnt
have seen inserted or updated records, but in this case the
functionality is working fine except that coldfusin gives an error
which i want to avoid.
Thanks in advance.

quote:
Originally posted by:
MikerRoo
Yes, if the database column is smalldatetime then then
@start_date should be smalldatetime.
However, the SP's input variable (call it say,
"RawStartDate") can still be varchar for the reasons you stated.
Just be sure to return the appropriate error and/or insert a valid
smalldatetime always.
Sorry for confusion... GetDate was just an example , it could
another variable @end_date which is varchar(20).
so we could have SET @start_date =
CAST(convert(varchar(20),@enddate,101) as datetime)
Now coming back to main problem.. I am not calling the SP
from coldfusion. I am directly running it thru Query Analyser and
here is what iam getting for a date value passed as '2006-05-24
00:00:00.000'
Server: Msg 295, Level 16, State 3, Procedure WS_AUTO_INTAKE,
Line 263
Syntax error converting character string to smalldatetime
data type.
here is the query starting at line 263
INSERT INTO intake_seq (intake_id, intake_seq, absence_type,
start_date, start_time, end_date, end_time)
VALUES (@intake_id, 1, @absence_type, cast(@start_date as
smalldatetime), DATEADD ( hh , 8, cast(@start_date as
smalldatetime)), cast(@end_date as smalldatetime), DATEADD ( hh ,
16, cast(@start_date as smalldatetime)) )
You would say, ok try just datetime instead of
smalldatetime...tried that also .. it gives this error
Server: Msg 241, Level 16, State 1, Procedure WS_AUTO_INTAKE,
Line 263
Syntax error converting datetime from character string.
Its all got to do with this value '2006-05-24 00:00:00.000'
which is passed as one of the parameters to sp call... I tried with
this and gives error... when i removed the last 3 zeroes with . ,
it works fine ...example '2006-05-24 00:00:00'
What is wrong here? Iam I missing something????
by the way , this SP is working fine for 99% of time... its
just that on very few occassions iam seeing the error... thats the
reason i persisted with SP INPUT VARIABLES declared as VARCHAR
rather than int or datetime, ....
any ideas????
I know I can have convert(varchar(20), @start_date,101) to
get the format dd/mm/yy but then I have to cast it to datetime
which will again make it in format dd/mm/yy hh:mi:ss... any other
way to just keep it dd:mm:yy ???

Similar Messages

  • DBA_DEPENDENCIES: 11gR2 fine-grained dependency tracking -- which columns??

    DBA_DEPENDENCIES is great, but I need to know the dependent columns. Given that 11g supports fine-grained dependency tracking... for example:
    create view emp_view as
    select emp_no, emp_name
    from employees
    where emp_no in (select emp_no from employees where hire_date > sysdate-2000)
    EMP_VIEW only exposes EMP_NO and EMP_NAME.
    If I drop the column EMPLOYEES.HIRE_DATE, Oracle will not invalidate objects that reference just EMP_NO and EMP_NAME, but in this case Oracle immediately invalidates EMP_VIEW because the view definition contains HIRE_DATE.
    Where does Oracle store this column dependency? Only at the table/view/function level in DBA_DEPENDENCIES. Maybe in an X$ table somewhere?
    Or does Oracle do an "on the fly" check for the dropped column in all dependent objects (seems messy).
    Before I change any table or view, I want to know what else I may have to change without finding out the hard way. I can easily look at the view's column list, but if I have to go into the view text, or the function text... messy! Must be a better way.
    Thanks.
    BB

    Exactly what I needed. Not sure why I didn't find this with the ten different Google searches I did...

  • Firefox pops up an error message on certain pages, all other browsers work fine, how can I make firefox ignore the "error" [e2219] css init error: ReferenceError: g is not defined

    Basically I want to replace the Ajax Control Toolkit Slider in favor of the Component One Studio for iPhone Slider for better mobile/desktop consistency (the ajax slider doesn't work well with iPhone). I created a simple page that works on every browser and platform (iPhone, Android, Mac, Windows) except Firefox, which fails on every platform. I have already tried disabling all plugins (safe mode) and clearing cache, I have also tried this with different versions of Firefox on different platforms. I posted this error on the Component One forum but since this only occurs with Firefox I believe this is a Firefox issue.
    I searched for this error on the forums and Google but didn’t get any results:
    ''[e2219] css init error: ReferenceError: g is not defined''
    The console has this message:
    ''[12:05:26.954] uncaught exception: [Exception... "prompt aborted by user" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource:///components/nsPrompter.js :: openTabPrompt :: line 462" data: no]''
    You can see the error by visiting http://www.componentone.com/i/
    Visit the same URL with IE, Chrome or Safari and there is no error. If I click [OK] the page loads normally enough for me. Is there some JavaScript or CSS line I can put in the page to make Firefox ignore the error? If so that would be great because even if there is a fix put into Firefox itself there will be those millions of users out there that will not upgrade.

    A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

  • Since windows 7 updated I noticed I can no longer view anything on youtube. It works fine on Internet Explorer which I don't care to use

    Question
    since windows 7 updated I noticed I can no longer view anything on you tube. It works fine on Internet Explorer which I don't care to use

    There are some compatibility issues between the latest Flash player and some Firefox add-ons or settings. Could you see whether anything in this article helps: [[Flash 11.3 doesn't load video in Firefox]].

  • HT6084 Since upgrading to OS X Mavericks I have not been able to work on any MS Word tracked changes documents (works fine if no tracked changes), as every time upon opening such a word file the word processor closes / crashes. What can be done in this ca

    Since upgrading to OS X Mavericks I have not been able to work on any MS Word tracked changes documents (works fine if no tracked changes or comments in the doc). Every time upon opening such a word file with tr.changes the word processor closes / crashes.
    What can be done in this case?

    I just discovered that by turning off in tracked changes balloons in Word preferences prevents the software from crashing, but from then on I need to use only the review pane.

  • I am a proud owner of iphone5, iOS6.1.4, recently I am facing prob to connect it with Ford Figo. Its not that iphone is not connecting, its getting disconnecting immediately after connected. I hv tired other ph with car, its working fine, how 2 resolve ?

    I am a proud owner of iphone5, iOS6.1.4, recently I am facing prob to connect it with Ford Figo. Its not that iphone is not connecting, its getting disconnecting immediately after connected. I hv tired other ph with same car, its working fine, how 2 resolve ?

    Morning Indrajit Chatterjee,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iOS: Troubleshooting car stereo connections
    http://support.apple.com/kb/TS3581
    Best of luck,
    Mario

  • Just broke my laptop that had CS6 (also have on my desktop and working fine)  how can I get CS6 back onto my new laptop?

    just broke my laptop that had CS6 (also have on my desktop and working fine)  how can I get CS6 back onto my new laptop?

    Hi tydormi,
    Please follow the thread: how can I install PS cc on a new mac? In the creative cloud app it says it is installed where this issue is already discussed.
    Let us know for further query.
    Regards,
    Ratandeep Arora

  • I am developing a book via email with a collaborator. iBooks Files are sent to me via a link to preview on iPad. This worked fine for a while but now getting download errors and the unhappy mac face saying download failed. Any ideas?

    I am developing a book via email with a collaborator. iBooks Files are sent to me via a link to preview on iPad. This worked fine for a while but now getting download errors and the unhappy mac face saying download failed. Any help appreciated. Very frustrating!

        I can see that this issue has been quite extensive, and frustrating, and I am so sorry for all that has happened societygirl! I would like to help you work this issue out. Please follow & send me a Direct Message, so I can get your account specifics and help finally bring this to a resolution.
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • Iam Running an Application it is running and working fine in Firefox where as Chrome pushing an error stating "Object reference not set to an instance of an object."

    Iam Running an Application it is running and working fine in Firefox where as Chrome pushing an error stating "Object reference not set to an instance of an object."

    This forum is for discussing technical documentations on Microsoft's web site.
    If you need help with an app, contact its author.
    Visual C++ MVP

  • I have compiled a program for a target after I added a new vi from NI_AALPro.lvlib. The addition worked fine on my development computer but gave me errors when run on the target.

    I have compiled a program for a target after I added a new vi from NI_AALPro.lvlib. The addition worked fine on my development computer but gave me errors when run on the target.
    The box displayed:
    Missing subVI NI_AALBase.lvlib:1D Linear Evaluation.vi in VI NI_PtbyPt.lvlib:Linear Fit PtbyPt.vi
    Missing subVI NI_AALPro.lvlib:MSE.vi in VI NIPtbtPt.lvlib:Linear Fit PtbyPt.vi
    What do I need to do to bring the correct library into the transportable code?

    Hello,
    I was unable to reproduce the behavior that you saw.  I was able to deploy my application with the Linear Fit PtByPt without issues.
    Could you attach the smallest piece of code that reproduces this behavior so that I can test it as well?
    Justin Parker
    National Instruments
    Product Support Engineer

  • Hard problem. how to track which application a user opens next?

    Hello,
    When the user runs my program,
    then **with his permission**, I want to be able to track
    which application the user has opened.
    For example, if he opens resume.rtf in MSWord, then I
    should be able to record or store the full path of
    MSWord and also the document path (c:\my
    documents\resume.rtf).
    Do you know how to do it?
    I would appreciate any help.
    thanks,
    Anil Philip

    In this old link
    http://www.gamedev.net/community/forums/topic.asp?topic_id=313980
    Da Wanderer has posted code (in Visual Basic?) to open a folder. He says it is cross platform. I am stumped by the code for Linux. Does anyone know if it will work for Linux. ie. Can I use the same options to open a document in Linux?
    I plan to use Runtime.exec similarly in Java, to open a doc.
    if (vars.Contains("GNOME_DESKTOP_SESSION_ID"))
                   processes.Add( new ProcessAndArgs("nautilus", "--nodesktop --browser " + path) );
                   osFound = true;
              else if (vars.Contains("KDEDIR"))
                   processes.Add( new ProcessAndArgs("kfmclient", "exec " + path) );
                   osFound = true;
              }

  • SQL server agent jobs throws random errors while the ETL process works fine.

    Hi,
    I have this problem with SQL agent jobs.
    We went from sql2008 to sql2012 and migrated SSIS without problems. The ETL process runs fine and the OLAP cubes are processed.
    I have a job which calls the master execution dtsx for a particulair customer. When the ETL load and OLAP is processed it should go to the next customer. The problem i have is that the agent logs some errors for random customers. I tried to do only two clients
    in one job this works then i add the third client and then it fails (log wise) for a customer which did run successfully before when there were only two customers.
    Despite the error message the ETL did run, there were no duplicate keys and OLAP was processed???
    Im very close to pull all my hair, because some combinations like two customers work, and placing these two customers with a third one it then fails again. (again cubes are processed and data is integer yet i keep getting these annoying errors in the log)
    Perhaps someone could help me further. 
    -Miracles are easy, the impossible takes a bit longer-

    Just double-click on the Agent job, then click on Steps property page (on your left), you must be able to see a list of steps with the action "On Failure" which you should examine.
    Arthur My Blog

  • Htmlb_tableview - how to define which columns are visible

    Hello
    i am working on an MVC BSP application that renders to the screen 5 fields.
    Yet in the bsp definition I see it reads pt-requisition-list which has many fields.
    <htmlb:tableView id                  = "requilistTab"
                       headerText          = "<%= controller->tv_header %>"
                       headerVisible       = "true"
                       columnHeaderVisible = "true"
                       table               = "<%= controller->pt_requisition_list %>"
                       design              = "alternating"
                       width               = "100%"
                       visibleRowCount     = "20"
                       footerVisible       = "true"
                       emptyTableText      = "<%= otr(paoc_rcf_ui/no_requi) %>"
                       sort                = "SERVER"
                       onHeaderClick       = "dummy"
                       keyColumn           = "OBJID"
                       iterator            = "<%= controller %>"
                       filter              = "SERVER"
                       visibleFirstRow     = "<%= controller->visible_first_row %>"
                       selectedRowKey      = "<%= controller->selected_record-objid %>"
                       selectionMode       = "SINGLESELECT" />
    My question: how do you tell the bsp what fields to display?
    Thanks in advance
    yuval

    iterator = "<%= controller %>"
    this is what makes controlling the columns visible.
    go to the class (referenced by variable controller) and see the method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS  to see the coding behind this.
    alternative method to show/hide columns without using iterator.
    page attribute:
    col_control_tab     TYPE     TABLEVIEWCONTROLTAB
    col_wa     TYPE     TABLEVIEWCONTROL
    layout
    <%
      clear col_wa .
      move: 'CARRID' to col_wa-columnname ,
      'This is the title of carrid' to col_wa-title ,
      'LEFT' to col_wa-horizontalalignment ,
       'ICON_PLANE' to col_wa-icon ,
      ' ' to col_wa-encode ,
      ' ' to col_wa-wrapping .
      append col_wa to col_control_tab .
      clear col_wa .
      clear col_wa .
      move: 'CONNID' to col_wa-columnname ,
      '<B>Connection</B>' to col_wa-title ,
      'X' to col_wa-sort ,
       'DESCENDING' to col_wa-preSelectedSortDirection ,
      'mycellclick' to col_wa-ONCELLCLICK ,
      'LEFT' to col_wa-horizontalalignment ,
      'X' to col_wa-encode .
      append col_wa to col_control_tab .
      clear col_wa .
    clear col_wa .
      move: 'FLDATE' to col_wa-columnname ,
      'Price' to col_wa-title ,
      'X' to col_wa-sort ,
      'LEFT' to col_wa-horizontalalignment ,
      ' ' to col_wa-encode .
      append col_wa to col_control_tab .
      clear col_wa .
          %>
    <htmlb:tableView id                  = "tv1"
                           design              = "ALTERNATING"
                           selectionMode       = "MULTISELECT"
                           onRowSelection      = "MYROWSELECTION"
                           table               = "<%= flights %>"
                         columnDefinitions   = "<%= col_control_tab %>"
                           tableLayout         = "AUTO"
                           width               = "50%"
                           columnHeaderVisible = "true"/>
    in this example  columnDefinitions  attribute determins which columns to be shown.

  • Light room five keeps crashing my computer uninstalled it downloaded a fresh copy it works fine how do I get my pictures out of the old copy to the new one?

    Light room five keeps crashing my computer, uninstalled it downloaded a fresh copy it works fine. How do I get my pictures out of the old copy to the new one?

    Apparently you have two catalogs now, one from each installation. If you did importing, tagging and editing during the first installation, that will all be in the first catalog. Find the first catalog - it is a file with the suffix .lrcat and the default place for LR to put it is usually your Pictures folder - and (with LR closed) double-click on it. LR will launch with catalog #1 active.

  • How to determine which column is currently sorted on?

    When my application closes down I grab all important state information from the various views in my application and persist the state information to a db. On application startup I retrieve the state information and reload all my views with their previous state. I currently save things like column order, column visibility, column size, applied filters, etc... for the tables that are in my app. I would also like to persist which column in each of my tables is currently sorted on, if any, but have been unable to locate an API method that gives me this information. I use the default sorting that is controlled by clicking on one of the column headers so I don't know which column has been sorted on. I don't listen for sorting events. I simply want to ask my table which column is sorted and get back the column or column identifier and the sort order whether ascending or descending.

    Just wanted to update the thread. Your post made also pointed me towards myTable.getSortOrder(Object identifier) which takes a column identifier and returns a SortOrder enumeration of that columns sort state (one of: Ascending, Descending, Unsorted) this allowed me to quickly save the state of each column by iterating through the columns and getting their individual SortOrder property.

Maybe you are looking for