Check a file type numeric

Good Morning Gurus.
I Have a Dump , this dump occurs because  my program Check a variable numeric but in this variable have a value with letters ,then occurs dump.
  STATICS: v_catly TYPE zcatly,
            v_msgtx TYPE zmensagem_t.
   IF v_catly IS INITIAL OR v_catly = ' '.
     EXIT.
   ENDIF.
v_catly is type numeric ,but when check  " IF v_catly IS INITIAL OR v_catly = ' '."  it has the value '   BEA-3 .
The beter solution is?
1- check if variable have letters with 'CS, CA' ,if yes move to variable char or exist other way.
ERROR:
An exception occurred that is explained in detail below.
This exception cannot be caught in the context of the current statement.
The reason for the exception is:
The program attempted to interpret the value "BEA-3" as a number, but
since the value contravenes the rules for correct number formats,
this was not possible.
Thanks

Hi Ronaldo,
REPORT zao.
START-OF-SELECTION.
  DATA: v_catly(8) TYPE n VALUE 78213970.
  IF v_catly CO '0123456789'.
    WRITE: 'numbers'.
  ENDIF.
  DATA: lv_str TYPE string.
  lv_str = '782g13970'.
  FIND FIRST OCCURRENCE OF REGEX '([a-zA-Z])' IN lv_str.
  IF sy-subrc = 0.
    WRITE:/ 'letter'.
  ENDIF.

Similar Messages

  • "Open with" command tries to open a document via Firefox, even though I have reassociated the file type numerous times.

    Some time ago after installing the new Adobe Creative Suite 5, my indd file extensions lost their association to InDesign. I mis-clicked when trying to correct this and accidentally selected Firefox from the list of programs. But now I can't seem to correct the problem. I've reassociated the file extension with InDesign, but when I try to open the file, a dialog box pops up in Firefox asking if I'd like to open the file in InDesign. If I click OK, a new tab and new dialog box pops up -- endlessly. I've tried editing the registry but nothing seems to work. How can I erase firefox from this file extension's memory?

    This is actually based on how the site handles different file types; Hotmail gives it to the browser as "application/octet-stream" or something like it, whereas sites that properly open it in the browser tag it as "application/pdf". Unfortunately there's nothing you can do about this without setting up a proxy to rewrite the HTTP headers. Complaints to Hotmail in the past haven't worked, and it's not possible to override the behavior in Firefox.

  • Question about filtering a file type on check in?

    I am reading on how to filter file types on check in and I was wondering.  Is it possible to check a file type and pop up a error page in iDoc, or would I have to go the custom component route (and would that need to be java or iDoc)?

    Thanks for the input, but seeing how the setting where I'm going to employ this component for UCM is secure I can't use code I can't read for myself (No offence to the author of that blog or to you).  But yeah I kinda figured making a filter based component would be the best route, but most examples I've found used the intradoc library.  Problem is I can't seem to find the intradoc library to try to write a basic example to see what I'm doing, everything I get is for RIDC (even found a small example on writing a filter for RIDC).  Is this what UCM is using now in 11g?
    Also one thing I felt missing when looking at example code, I get the basic idea of the code itself.  But to employ the componant to work on the check in request would I just include that component in that idoc function for checkin?

  • File type check before uploading a file

    Right now I have a processing page that uploads a file only of type zip. If you try submitting something other than a zip file, it throws an error. Is it possible to check the file type before uploading?
    Something like this in pseudo code:
    if (file type does not = zip ) {
         redirect to the homepage with cflocation
    else {
         <cffile action="upload" ....  />

    Not with ColdFusion, it does not run on the client and has no idea about the file until the client browser has sent it to the web server and the web server as put it into the server's temp directory.
    Maybe with someting that runs on the client, like JavaScript.  But when dealing with files in the client browser you quickly run into security features that prevent you from doing much to prevent hackers from writing client code to farm unsupecting users systems for interesting files.

  • Checking File Type

    How would i check the file type of a file they selected to make sure its a .txt file? Thanks - Jeff

    or a better way would just be
    if(!filename.endsWith(".txt"))
        return;Cheers,
    Radish21

  • File Type Association fails when opening multiple files from Bridge to Premiere

    I'm running Vista 32 bit CS3 Bridge and Premiere.
    According to the Video workshop
    http://www.adobe.com/designcenter-archive/video_workshop/
    under Premiere > all 19 topics > Managing Media in Adobe Premiere Pro > at 02:46 it shows group selecting a bunch of quicktime files using Edit > Select all, then File > Open With ...the drop down shows Premiere.
    Mine only show Premiere if a single file is selected. If I multiple select, it only shows Quicktime Player 7.6.
    I've checked the file type association in preferences of Bridge to open these files in Premiere but it still only sees Premiere if a single file is selected.
    I've upgraded Bridge to 2.1.1.9 and set to run as Administrator but to no avail.
    Any ideas?

    Import has always worked fine. this is not the issue.
    I have now changed the file association in Vista, re-started Premiere and Bridge and then after having started just Premiere chose File > Browse and the selected all the .mov files and selected Open With. Hurrah! Premiere is now listed!
    However, If I continue the focus changes to Premiere but a warning appears "This file path does not exist on disk at this location".
    Nothing is imported. Unlike the video workshop mentioned above.
    If however, I chose Open and not Open with then the files are imported.
    Seems to be a bug with Open with with more than one file chosen. If a single file is chosen and Open With is applied then the focus changes to Premiere but no file is imported.
    I have seen the exact same problem in another discusion "Re: Bridge CS3: Not importing clips into Premiere CS3" (see the More Like This panel on the rightside of this window)

  • File type on Yosemite iCloud drive

    Hello,
    before upgrading to Yosemite, I want to check what file types I can use on iCloud drive. I work a lot with Sketchup and Layout, it would be great if i could keep the files on Drive and then work on them on either my MBP or my iMac. Presumably I would need an internet connection any time I needed to work on them?
    Thanks for any advice you can give, regards, Sally

    You can store all kinds of documents on iCloud Drive, if you create your own folders there. You are not restricted to the predefined application collection folders. Any document on iCloud Drive will update across all your Macs.
    Only packages are problematic, for example don't move iPhoto Libraries to iCloud Drive.
    See this link:   iCloud Drive FAQ
    Presumably I would need an internet connection any time I needed to work on them?
    You can work off-line. iCloud Drive is keeping shadow copies of all documents locally stored on your Macs. You can continue to edit even without an internet connection. The changes will be updated, when you again connect to the internet.

  • OS file type for the 10g R2 installation

    I have a new AIX 5.3L system, and ready to install the 10g R2. When I check the file type of file system, I noticed that the contractor formated the hard drive (hdisk0) in jfs2 for OS itself and other three hds in jfs type and create the basic filesystem,/oracle_app, /oradata in jfs type hds. I knew there is a limitation of creating file larger than 2 G in 10g, However, for the installation of 10g and later operation, Do I need to install the oracle under jfs2 file type, just in case , for example for some media data file to be stored?

    Maybe I did not descirbe it clearly. Let me try again.
    I have 4 hds on the systems. Besides the OS filesystems, such as /home, /tmp, /user which are by default, other filesystems created by user, ex /myOracle, /myOradata were using jfs file type. So when I first installed the Oracle, there was a problem in process to create a datafile bigger than 2 G. I did not know what ent wrong. I thought it may be a limitation of 10G r2. Then when I tried to uncompress a file, which can expand into size biger than 2 G (2.8 G actually), in such filesystem folder, the OS return a message "file cannot be larger than the value set by ulimit". Even I set unlimited for the file size to /etc/security/limits, it still won´t work. The same error when I pass a larger file to that filesystem. So I realize that it must be the cause of the jfs system, because m other AIX system has the same filesystem but setup with jfs2 type. Then I created a filesystems with jfs2 and it worked. So I appoligize to mislead. But certainly the problem is under the AIX 5.3L. But my other concern is a filesystem using file type larger than 2 G necessary for Oracle 10 g operation (apparently needed for installation if i want to create datafile larger than 2 G)? Hope this will make thing clear.

  • Windows BUG: Can't change file types through control panel Quicktime settings

    I am running the latest version of Quicktime on Viista Home Premium 64-bit.
    When I into Control Panel -> View 32-bit Control Panel Items -> Quicktime -> Browser, and I click on "File Types" or "MIME Settings", I get a blank page that looks like this: http://oi40.tinypic.com/hvbbia.jpg, and Quicktime momentarily freezes.
    I have no issue adjusting file type settings when bringing up Quicktime outside of control panel, or when using "Default Programs" within control panel, it's only when I do it within "View 32-bit Control Panel Items" that it does this.
    This is a minor bug but still weird. Can anyone else verify the issue? I tried uninstalling and reinstalling but that didn't help.

    This could be caused by damaged QuickTime preference files (or possibly a permissions problem on the preferences files).
    We can try rebuilding one set of your preference files to see if that helps with the greyed-out stuff.
    First, quit QuickTime if you have it open.
    Next, you'll need to make sure you are set up to view hidden files and folders in Vista (or 7).
    1. From the Start menu, click Open.
    2. In the Organize menu, click Folder and Search Options.
    3. Click the View tab.
    4. In the "Advanced settings" pane under "Hidden files and folders" make sure that the "Show hidden files and folders" option is selected.
    5. Click OK.
    Next, you'll remove the QuickTime preference folder (and contained file).
    6. In Computer, open Local Disk: C or whichever drive your documents are stored on.
    7. Open the Users folder.
    8. Open the folder with the name of the Windows 7 user account in which the QuickTime file types are "greyed out".
    9. Open the AppData folder.
    10. Open the Local folder.
    11. Open the Apple Computer folder.
    12. Drag the QuickTime folder out onto the Desktop.
    Now you'll rebuild the preference folder and file.
    13. Launch QuickTime. Check your file types again.
    Are they still greyed out, or can you change them now?

  • Plugins for viewing other file types?

    Hi. I'm just wondering if anyone knows of a plugin for Bridge that would allow me to preview other file types, specifically Blender 3D .blend files.
    Windows Explorer can preview them, but not Bridge. And Bridge can preview all of the AI and PSD files that Windows Explorer can't.
    I'd like to use bridge since it is faster for previewing and changing meta data, etc.
    Any help is appreciated.
    Thanks!

    I'd like to use bridge since it is faster for previewing and changing meta data, etc
    If the files don't show in the content window they probably are not supported. First try a purge cache for folder using the tool menu / cache/ purge cache for folder and if still no luck check the file type associations in the Bridge preferences.
    If your file is not on the list the only option is to add a feature request somewhere on this forum. The more people want it the bigger chance it will get realized sometime.
    I'm not aware of any plug in to add file types to Bridge. Don't think scripts can solve this but you could also visit the scripting forum for this.

  • Check file type after JavaScript File.openDialog()...

    So, I'm on Mac OS and want my script to obviously cancel on the "Cancel" bottle, as well as check whether the file selected was a PDF. I've had some success with the code below, but some of the PDF's I select get cancelled with this script. Upon checking, the FilePath.type property returns "????" for some PDF's - anyone know why?
    var myFilePath = File.openDialog("Please choose a PDF file...", undefined, false);
    if((myFilePath == "") || (myFilePath == null)){
        exit();
    else if(myFilePath.type != "PDF "){
        alert("Please choose a PDF file!") ;
        exit();
    I'm quite new to scripting. Thank you!

    Under Windows, all you can do is supply a file extension (the well-known "*.PDF" filter), and it's wise to always add the catch-all "*.*" for 'All files'. That way, a user can select a file even if it has the wrong extension (and in that case, it's the user's responsibility to make sure the file is of the expected type nevertheless).
    Under OSX, there are two options:
    1. The file has the correct "Creator/Type" metadata; and/or
    2. The file has the correct file extension.
    Historically, Macintosh-based OSes used option #1, and software was not expected to look at the actual file names. However, that soon became unworkable when people tried to exchange files between their Mac and (virtually any) other systems. That lead to various tools to 'assign' Creator/Type data to well-known file extensions, just so they could be opened with the right software on a Mac. Also the reverse happened; saving a file 'without extension' on a Mac was not a problem, but to open it on Windows you often had to add the right extension.
    So, somewhere around one or two System versions ago, Apple decided to go back to the old, trusted 'File Extension' way. But OSX still saves Creator/Type metadata for files created on your own Mac. Checking the "type" should work then -- but the problem is, what if you got your file from somewhere else? The extension may be correct, but if it has no file type, your script will not see it.
    Fortunately, the Mac OSX File Open dialog allows some pretty wicked customizations. Never mind a file filter, you can run a custom function that decides for each separate file and folder whether it should be selectable or not. The function has access to all file attributes; you can go so far as to checking the file name, and reject all files that contain a 'q', or files that are read-only, or files that are smaller than 1Kb.
    Check out this piece of code (I wrote it myself, but various hints and tricks were read on this very forum):
    if (File.fs == "Windows")
        pdfFile = Folder.myDocuments.openDlg( 'Load PDF document', "Adobe PDF:*.pdf,All files:*.*", false);
    else
        pdfFile = Folder.myDocuments.openDlg( 'Load PDF document', function(file) { return file instanceof Folder || (!(file.hidden) && (file.name.match(/\.pdf$/i) || file.type == "PDF ")); }, false );
    (I advise you to copy the Windows fragment as well, just in case your script goes 'round the world.)

  • The value returned from the load function is not of type numeric  errors after migration to Coldfusion 11

    I am currently testing our website with CF11. It is currently working with CF8 however after migrating it to a new server running CF11 I have encountered the following error.
    The value returned from the load function is not of type numeric.
    The error occurred in
    D:/Applications/CFusion/CustomTags/nec/com/objects/address.cfc: line 263
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/contact.cfc: line 331
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 510
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 1675
    Called from D:/website/NECPhase2/action.validate.cfm: line 54
    261 : <cfif isNumeric(get.idCountry)>
    262 : <cfset rc = this.objCountry.setID(get.idCountry)>
    263 : <cfset rc = this.objCountry.load()>
    264 : </cfif>
    265 : <cfset this.sPostcode = get.sPostcode>
    Have there been any changes between CF8 and CF11 that could  cause this error?
    Does anyone have ideas?

    This is the code in file object file country.cfc (nec.com.objects.country):
    <cfcomponent displayname="Country object" hint="This is a Country object, it allows you to access and set values in the Country.">
    <!---
    // Construct this object
    --->
    <cfset this.objFunctions = CreateObject( 'component', 'nec.com.system.functions' )>
    <cfscript>
      this.idCountryID = 0;
      this.sCountryName = "";
      this.sISOCode = "";
      this.sDHLCode = "";
      this.iErrorID = "";
    </cfscript>
    <!---
    // The following functions are the setters and getters. offering us a better way to get
    // at the contents of the object
    --->
    <!---
    // Getters
    --->
    <cffunction name="getID" displayname="Get ID" returntype="numeric" output="false" hint="This returns the ID of the current item.">
      <cfreturn this.idCountryID>
    </cffunction>
    <cffunction name="getsCountryName" displayname="Get sCountryName" returntype="string" output="false" hint="This gets the sCountryName value of this item.">
      <cfreturn this.sCountryName>
    </cffunction>
    <cffunction name="getsISOCode" displayname="Get sISOCode" returntype="string" output="false" hint="This gets the sISOCode value of this item.">
      <cfreturn this.sISOCode>
    </cffunction>
    <cffunction name="getsDHLCode" displayname="Get sDHLCode" returntype="string" output="false" hint="This gets the sDHLCode value of this item.">
      <cfreturn this.sDHLCode>
    </cffunction>
    <cffunction name="iError" displayname="Get iError" returntype="numeric" output="false" hint="This returns the iError of the current item.">
      <cfreturn this.iError>
    </cffunction>
    <!---
    // Setters
    --->
    <cffunction name="setID" displayname="Set ID" returntype="boolean" output="false" hint="This sets the ID value of this item.">
      <cfargument name="idCountryID" required="true" type="numeric" displayname="ID" hint="The ID to use.">
      <cfset this.idCountryID = arguments.idCountryID>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsCountryName" displayname="Set sCountryName" returntype="boolean" output="false" hint="This sets the sCountryName value of this item.">
      <cfargument name="sCountryName" required="true" type="string" displayname="sCountryName" hint="The sCountryName to use.">
      <cfset this.sCountryName = arguments.sCountryName>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsISOCode" displayname="Set sISOCode" returntype="boolean" output="false" hint="This sets the sISOCode value of this item.">
      <cfargument name="sISOCode" required="true" type="string" displayname="sISOCode" hint="The sISOCode to use.">
      <cfset this.sISOCode = arguments.sISOCode>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsDHLCode" displayname="Set sDHLCode" returntype="boolean" output="false" hint="This sets the sDHLCode value of this item.">
      <cfargument name="sDHLCode" required="true" type="string" displayname="sDHLCode" hint="The sDHLCode to use.">
      <cfset this.sDHLCode = arguments.sDHLCode>
      <cfreturn true>
    </cffunction>
    <!---
    // Clear, to empty out the contents of this object
    --->
    <cffunction name="clear" displayname="Clear items Details" returntype="boolean" output="false" hint="Clears out all of the items details.">
      <cfscript>
       this.sCountryName = "";
       this.sISOCode = "";
       this.sDHLCode = "";
       this.iErrorID = "";
      </cfscript>
      <cfreturn true>
    </cffunction>
    <!---
    // The following functions deal with the load, save and deleting of objects
    --->
    <!---
    // Load
    --->
    <cffunction name="load" displayname="Load items details" returntype="numeric" output="false" hint="This loads in all the information about an item.">
      <cfset rc = this.clear()>
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Check to see if it exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: checkID: '#this.idCountryID#' #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         if(isDefined("session.afr")){
          whichOne = "#session.afr.getsAFRNumber()#";
         } else {
          whichOne = "";
         iErrorID = objError.addError("A Country with that id doesn't exists.[#this.idCountryID#][#whichOne#]");
        </cfscript>
       <cfset this.iErrorID = iErrorID>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // If we got past all then then load in the details
      --->
      <cftry>
       <cfquery name="get" datasource="#sDatasource#">
        SELECT idCountryID, RTRIM(sCountryName) as sCountryName, RTRIM(sISOCode) as sISOCode, RTRIM(sDHLCode) as sDHLCode
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: get: #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfset this.idCountryID = get.idCountryID>
      <cfset this.sCountryName = get.sCountryName>
      <cfset this.sISOCode = get.sISOCode>
      <cfset this.sDHLCode = get.sDHLCode>
      <cfset this.iErrorID = "">
      <cfreturn true>
    </cffunction>
    <!---
    // Save
    --->
    <cffunction name="save" displayname="Save items Details" returntype="numeric" output="false" hint="Saves (to some source) the current details for the ID of the item.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("save: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <!---
      // If it doesn't exist, then add the record, otherwise update the record
      --->
      <cfif not checkID.recordCount>
       <cfreturn this.add()>
      <cfelse>
       <cfreturn this.update()>
      </cfif>
    </cffunction>
    <!---
    // Add
    --->
    <cffunction name="add" displayname="Add Country" returntype="numeric" output="false" hint="This adds a Country.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#'
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that name or ISO code already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <cftry>
       <cfquery name="add" datasource="#sDatasource#">
        SET nocount on
        INSERT INTO tblCountry(sCountryName, sISOCode, sDHLCode)
        VALUES('#this.objFunctions.scrubText(this.sCountryName)#','#this.objFunctions.scrubText(t his.sISOCode)#','#this.objFunctions.scrubText(this.sDHLCode)#')
        SELECT @@identity as autoID
        SET nocount off  
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: add: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn add.autoID>
    </cffunction>
    <!---
    // Update
    --->
    <cffunction name="update" displayname="Update Country" returntype="numeric" output="false" hint="This updates a Country record.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE (sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#')
        AND idCountryID <> #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("Another Country with that name already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Attempt to update the record to the datasource
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="update" datasource="#sDatasource#">
        UPDATE tblCountry
        SET sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#',
        sISOCode = '#this.objFunctions.scrubText(this.sISOCode)#',
        sDHLCode = '#this.objFunctions.scrubText(this.sDHLCode)#'
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: update: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID> 
    </cffunction>
    <!---
    // Delete
    --->
    <cffunction name="delete" displayname="Delete Country" returntype="numeric" output="false" hint="This deletes a Country record.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that id doesn't exists, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now check to see if there are any dependancies, if so we can't delete the item
      --->
      <cftry>
       <cfquery name="checkDependancies" datasource="#sDatasource#">
        SELECT idCountry
        FROM tblAddress
        WHERE idCountry = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkDependancies: idCountry: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkDependancies.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("That Country is being used by an address, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now attempt to remove the record.
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="delete" datasource="#sDatasource#">
        DELETE FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: delete: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID>
    </cffunction>
    </cfcomponent>

  • File Load - Valuation of File Type

    Hello
    In an application we successfully created a "Picture" load to the database.
    This "Picture Load" is only required for "Picture" file types. e.g. JPEG etc
    I looking for ideas for valuating the file type as currently if the wrong file type is entered the load fails and crashes the application.
    Any ideas very welcome
    Regards
    Pete

    Dear Arie & Dan
    I agree fully with your conclusions. In the days of OLTP (online terminal processing), before PCs, we split valuation into two parts ... level 1 & 2.
    Level1 was the simple checks ... are fields of the correct value type e.g. numeric, dates etc
    Level2 was the data checks ... are the records on file etc
    If level 1 valuation failed you would display the error message and not go on to level 2 valuation
    Today, Javascirpts can do the level1 valuation. This saves on network and centre processing time. The end user does not wait to be told about a basic error.
    In addition, javascirpts can held static data like date or colour pickers. Apex has good functions for these tasks but requires network and centre process time. This is fine if you and the end user have the recourses to give good response times. In most cases the end user gets a far poorer performance from central processed function vs the local Javascipt running in thier browser.
    Aire, my understand of Javascrits is poor (but learning fast). Within the contents of a APEX application where do I add the Javascript code and how does it get called.
    i.e. I beleive the Javascrit goes in the header and a commended is added to the button (I sure the format of this)?
    Please can help me?
    Thank to you both
    Regards
    Pete
    PS Dan, the insert was missing as I only added part of the script, below is the full script which may be of use to someone in the future
    Declare
    image blob;
    apex_id varchar2(4000);
    attributes clob;
    img_mimeType varchar2(32);
    img_width integer;
    img_height integer;
    img_contentLength integer;
    fileFormat varchar2(32);
    contentFormat varchar2(32);
    compressionFormat varchar2(32);
    TRANS_BLOB_LOG_REC TRANS_BLOB_LOG%ROWTYPE;
    temp1 blob;
    temp2 varchar (4000);
    temp3 varchar (4000);
    v_raw varchar (4000);
    v_start number:=1;
    count1 number:= 0;
    count_stop number:=0;
    v_lenght number:=2000;
    v_blob_lenght number;
    Begin
    select blob_content, id into image, apex_id from apex_application_files where name = :P870_LOGO for update;
    DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
    ORDSYS.ORDImage.getProperties(image,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    If img_width > 100 or img_height > 100 then
    ordimage.process(image, 'maxScale=100 100');
    ORDSYS.ORDImage.getProperties(image,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    end if;
    DBMS_LOB.FREETEMPORARY(attributes);
    update supplier set
    logo_id = apex_id,
    logo_blob = image,
    logo_mime = img_mimeType,
    logo_width = img_width,
    logo_height = img_height,
    logo_lenght = img_contentLength
    where supplier_key = :P801_SUPPLIER_KEY;
    delete apex_application_files where name = :P870_LOGO;
    commit;
    end;

  • File type in GUI_download

    Hi Experts,
    Whatis the coresponding file type for 'WK1 for WS_DOWNLOAD in GUI_DOWNLOAD?

    Hi ravi,
    1. Its the same WK1.
    2. U can check for yourself in the documentation of this parameter in se37.
    regards,
    amit m.

  • Removing obsolete file type associations from "Open With" menu

    Ever since I removed VMWare Fusion 3.x from my system, I've been unable to remove the Bootcamp file type associations that it created. For example, if I right-click on a PDF and choose Open With, this is a partial list of what I see:
    Adobe Acrobat Pro (default)
    Adobe Distiller (Mac) - Boot Camp partition (VMWare Fusion 3.0.0)
    Adobe Fireworks CS4
    Adobe Fireworks CS4 (Mac) - Boot Camp partition (VMWare Fusion 3.0.0)
    Adobe Illustrator CS4
    Adobe Illustrator (Mac) - Boot Camp partition (VMWare Fusion 3.0.0)
    Adobe Photoshop CS4
    Adobe Photoshop CS4 (Mac) - Boot Camp partition (VMWare Fusion 3.0.0)
    ...and on and on and on. 17 additional entries for Fusion for PDS's alone. This junk is driving me crazy.
    I've tried rebuilding the Launch Services database with MacPilot and Onyx (the recommended fix that I've found on the web), but the entries still are there even after restarting Finder and rebooting my iMac. I'm at a loss to figure out how to get rid of these.
    Can anyone help me?
    Thanks!

    They are stored in the LaunchServices database. You can give this a try, but no guarantees. If you no longer use VM Fusion then I suggest following the information below on uninstalling software.
    Rebuild LaunchServices Database
    Open the Terminal application in your Utilities folder. At the prompt paste in the following command in its entirety:
    find /System/Library/Frameworks -type f -name "lsregister" -exec {} -kill -seed -r \;
    Press RETURN.
    Wait for the Terminal prompt to return after which you can quit the Terminal.
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash. Applications may create preference files that are stored in the /Home/Library/Preferences/ folder. Although they do nothing once you delete the associated application, they do take up some disk space. If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application. In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder. You can also check there to see if the application has created a folder. You can also delete the folder that's in the Applications Support folder. Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item. Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder. Log In Items are set in the Accounts preferences. Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab. Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    Some software use startup daemons or agents that are a new feature of the OS. Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term. Unfortunately Spotlight will not look in certain folders by default. You can modify Spotlight's behavior or use a third-party search utility, Easy Find, instead. Download Easy Find at VersionTracker or MacUpdate.
    Some applications install a receipt in the /Library/Receipts/ folder. Usually with the same name as the program or the developer. The item generally has a ".pkg" extension. Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are also several shareware utilities that can uninstall applications:
    AppZapper
    Automaton
    Hazel
    CleanApp
    Yank
    SuperPop
    Uninstaller
    Spring Cleaning
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.

Maybe you are looking for