Text_io checking for the file exists?
When using TEXT_IO package procedures within a form, How can I check whether the file with the same name exits in the same file path?. I mean what is the text_io procedure? Is there any thing specific?
something like
EXCEPTION
when OTHERS then
if SQLCODE = -302000 then -- file problems
MSGBOX('Error: File could not be opened.');
raise FORM_TRIGGER_FAILURE;
else
MSGBOX('Error: ' || SQLERRM);
raise FORM_TRIGGER_FAILURE;
end if;
Similar Messages
-
Check if the file exists in the local machine...
Hi,
I am getting a problem while checking if the local file exists or not. In the first case the server is same as my local machine. When I try to test if the file exists or not using FILE.exists() it works because I am looking for the file in my machine.
But when I move the code in Unix the file.exists( ) tries to look in the unix box and not the local machine. My question is how to read it from the local machine?
We are using jdk v1.2.2 and Iplanet App server v6.0.
Thanks
AmolWhat do you mean by "when I move the code in UNIX..."?
-
How can I check for the existence of an XML file in Illustrator Javascript??
I'm writing a Javascript to run at startup. I want to check for the existence of XML files and process them, if they are available. How can I check for their existence?
Your first line just sets a variable to a string value… getFiles() is a method of Folder… so
var InputXMLDir = Folder( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/" );
Not a PC user so I can't remember if the colon is OK…? As you appear to know the file name why bother with a folder get files anyhow you could just check if the file exists then do some thing…
alert( File( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/brackets_men_web.xml" ).exists ); -
Hi all, I have a script which returns the path for a file in this way:
set outfile to (choose file name with prompt "Choose output file." default name "out.iso")'s POSIX path
the path is then passed to the shell. Now, I want the script to check whether that file exists and if it does, the script needs to be stopped.
I tried some ways I found on the web but none seems to work.
Any help would be appreciated.
Thank you!
LorenzoTry using:
set outfile to (choose file name with prompt "Choose output file." default name "out.iso")'s POSIX path
set thefile to POSIX file outfile
tell application "Finder"
if exists thefile then
return --or other commands to stop script
end if
end tell
(57077) -
How to check if the file already exists in the client directory
Hi all.
I'm on devsuite 10g. I'm using webutil to download files from DB using webutil function db_to_client.
What I need is to check if the file already exists in the client directory and if yes to display a message to ask the user if he wants to overwrite or no. How can I make this???
Here is the code that I'm using to download the file.
Thanks all for the collaboration.
Fabrizio
declare
file_path varchar2(2000) := null;
BEGIN
/** I ask where saving the file on the client machine **/
file_path:= webutil_file.file_selection_dialog
(directory_name => null,
file_name => :bin_docs.name,
file_filter => '',
title => 'Saving file',
dialog_type => save_file, --save_file
select_file => TRUE);
/** I download the file from DB to client **/
if webutil_file_transfer.DB_To_Client_With_Progress
( file_path ,
'BIN_DOCS',
'DOC' ,
'doc_id = '||:bin_docs.doc_id,
'Downloading file',
' '||:bin_docs.name) then
msg_alert('Download del file avvenuto con successo','I',false);
else
msg_alert('Si è verificato il seguente errore in fase di download '||SQLERRM,'I',false);
end if;
end;How about something like the below:
Note: I have a yes/no alert to asking if they want to over-write the existing file.
DECLARE
file_path VARCHAR2(2000) := null;
over_write BOOLEAN := TRUE;
BEGIN
/** I ask where saving the file on the client machine **/
file_path:= webutil_file.file_selection_dialog
(directory_name => null,
file_name => :bin_docs.name,
file_filter => '',
title => 'Saving file',
dialog_type => save_file, --save_file
select_file => TRUE);
IF webutil.file_exists(file_path) THEN
/** check a file by the same name exists in the selected directory **/
IF show_alert('Ask_overright') != alert_button1 THEN
/** If we say no then set over_write value to false **/
over_write := FALSE;
END IF;
END IF;
IF over_write THEN
/** I download the file from DB to client **/
IF webutil_file_transfer.DB_To_Client_With_Progress
( file_path ,
'BIN_DOCS',
'DOC' ,
'doc_id = '||:bin_docs.doc_id,
'Downloading file',
' '||:bin_docs.name) then
msg_alert('Download del file avvenuto con successo','I',false);
ELSE
msg_alert('Si è verificato il seguente errore in fase di'
||' download '||SQLERRM,'I',false);
END IF
END IF;
END;
cheers
Q -
How to check if the file already exists in the application server directory
Hi all. I'm on devsuite 10g.
I transfer file from local machine to application server using webutil function webutil_file_transfer.client_to_as and I want to check if the file I'm transfering already exists on the server directory.
How can I make this?
Thanks all,
Fabriziouse the text_io package and open the file in read-mode.
like this
declare
xFileType text_io.file_type;
begin
xFileType := text_io.fopen('c:\temp\test.txt','R'); --file on the middle tier
-- file exists;
text_io.fclose(xFileType);
exception
when others then
--file doesn't exist
end;
regards
Christian -
Why oh why do I sometimes get this error when defining my Excel Source and then sometimes I do not?
Am I doing something wrong here???
The error is...
Exception from HRESULT: 0xC02020E8
Error at Data Flow Task [[Excel Source[27]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
Error at Data Flow Task [Excel Source [27}}: Opening a rowset for "EFT$" failed. Check that the object exists in the database.
I know the Worksheet "EFT" exists because I defined this previously for the same Excel spreadsheet.
Thanks for your review and am hopeful for a reply.
PSULionRPA reply from CozyRoc must be hitting the nail on the head
sheet name contains $
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ce0fbff5-f5f1-4a4a-9c29-6adc32b0fd79/using-excel-file-as-source-in-data-flow-task-of-ssis-bi-2005-need-example-of-sheetnamecellrange?forum=sqlintegrationservices
Arthur My Blog -
Hi,
i am trying to load the data from excel sheet using For each loop container in ssis 2005.
But it gave me the below error:
Error: Opening a rowset for "Sheet1$" failed. Check that the object exists in the database.
[DTS.Pipeline] Error: "component "failed validation and returned validation status "VS_ISBROKEN".
Error: There were errors during task validation.
Could you please let me know the solution
Regards
SqlstudThat message usually means validation has failed;
Have any of the underlying tables changed? Data types, lengths, maybe even column ordering, etc...?
try this..
Right-click on the Data Flow Task and select Properties. Then set DelayValidation =TRUE.
Let us TRY this |
My Blog :: http://quest4gen.blogspot.com/
Thanks ETL.
Everything is fine..(Datatypes,length,orderings etc)
Already i have set
DelayValidation =TRUE.
IS there any other problem?
Regards
Sqlstud -
File exist to check for any file, not just a specific filename
How can I implement a check to see if any file exists in a certain directory. I don't know the filename beforehand, only the directory.
Can I still use the FILE EXISTS activity or do I need to write something different.
Thanks,
GuidoHi guidonlm
You can use USER DEFINED activity or FILE EXISTS activity. With file exists you must get file name before (file name can be hard coded or passed as variable). With user defined activity you can make your own shell script and check anything that you need (in this case you must enable property in file $ORACLE_HOME/owb/bin/admin/Runtime.properties property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
Regards -
I recently uploaded the Maverick operating system. I wanted to scan some things on my HP Printer/Scanner and could not . This is the error message I received: An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only. I am a novice with the computer and have no one to help. I hope someone knows an easy fix.
Thank youThis worked for me:
"Although it is not a 'fix' for the HP issue, I did find a workaround that helped me. In the Preferences Panel in MacOS X you can pull up the Printer/Scanner preferences and scan directly from OS X. I'd not known of this prior to posting here and it worked like a charm."
"Of course, HP should still update their software, but it's good to know that Apple has it covered for them."
I found it here:
http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/MAVERICKS-WONT-SCAN-HP-C3 09A/td-p/3052105 -
HI
i restored a sharepoint web 80 application in our test domain
and after when i browse the new web application
it says
Cannot make a cache safe URL for "1025/styles/Themable/corev4.css", file not found. Please verify that the file exists under the layouts directory.
adilHi adil,
According to your description, my understanding is that you encountered the error “Cannot make a cache safe URL for "1025/styles/Themable/corev4.css", file not found. Please verify that the file
exists under the layouts directory.” .
The issue happens in
We have customized master page
In the master page, we use path the script/style file like this: <SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/coe/mainCOE.css%>"
runat="server"/>
While using the dynamic path in a multiple languages enabled site, language Id(1033 etc) will be added to the path automatically. That cause the file to be not found.
To solve the issue, please download the Arabic language pack http://www.microsoft.com/en-us/download/details.aspx?id=3411 ,
install it on your SharePoint and refresh your browser.
Reference:
http://sharepoint-community.net/profiles/blogs/cannot-make-a-cache-safe-url-for-1036-sytles-themable-corev4-css
Best Regards,
Eric
Eric Tao
TechNet Community Support -
I have Maverick 10.9.1 installed I scanned a photo on my HP D 110 series but it won't let me print or save it: An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only.
Read the user manual that came w/the scanner and/or contact HP Support.
http://support.apple.com/kb/PH14141 OS X Mavericks: Reset the printing system
http://support.apple.com/kb/HT3669 Printer and scanner software available for download
A scanner driver you may wish to consider: VueScan Scanner Software -
How to check for the sub folder in the document library Is already Exist using CSOM?
Hi,
My requirement is to create the folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
I able to check for the parent folder.
But cant able to check the subfolder in the document library.
How to check for the sub folder in the document library?
Here is the code for the folder
IsFolder alredy Exist.
private
string IsFolderExist(string InputFolderName)
string retStatus = false.ToString();
try
ClientContext context =
new ClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
context.Credentials =
CredentialCache.DefaultCredentials;
List list = context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
FieldCollection fields = list.Fields;
CamlQuery camlQueryForItem =
new CamlQuery();
camlQueryForItem.ViewXml =
string.Format(@"<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FileDirRef'/>
<Value Type='Text'>{0}</Value>
</Eq>
</Where>
</Query>
</View>",
@"/sites/test/hcl/"
+ InputFolderName);
Microsoft.SharePoint.Client.ListItemCollection listItems = list.GetItems(camlQueryForItem);
context.Load(listItems);
context.ExecuteQuery();
if (listItems.Count > 0)
retStatus =
true.ToString();
else
retStatus =
false.ToString();
catch (Exception ex)
retStatus =
"X02";
return retStatus;
thanks
SundharHi Sundhar,
According to your description, you might want to check the existence of sub folder in a folder of a library using Client Object Model.
Please take the code demo below for a try, it will check whether there is sub folder in a given folder:
public static void createSubFolder(string siteUrl, string libName, string folderServerRelativeUrl)
ClientContext clientContext = new ClientContext(siteUrl);
List list = clientContext.Web.Lists.GetByTitle(libName);
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml =
@"<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FSObjType' />
<Value Type='Integer'>1</Value>
</Eq>
</Where>
</Query>
</View>";
//camlQuery.FolderServerRelativeUrl = "/Lib1/folder1";
camlQuery.FolderServerRelativeUrl = folderServerRelativeUrl;
ListItemCollection items = list.GetItems(camlQuery);
clientContext.Load(items);
clientContext.ExecuteQuery();
Console.WriteLine(items.Count);
if (0 == items.Count)
//create sub folder here
Best regards
Patrick Liang
TechNet Community Support -
How to do CHECK IN the files for the document?
Hi ,
By using BAPI_DOCUMENT_CHECKIN2 Function module I am uploading the Files for the Document number.
My problem is - After uploading the files to the document number the files are not in check in status.
I want the files to be checked in after uploading the from the FM.
Can anyone tell me what I am missing ? How to do check in the files.
I am passing the following values to FM.
ls_files-SOURCEDATACARRIER = ls_file-DATA_CARRIER.
ls_files-WSAPPLICATION = ls_file-application.
ls_files-DESCRIPTION = ls_file-file_desc.
ls_files-STORAGECATEGORY = ls_file-category.
ls_files-DOCFILE = ls_file-doc_path.
ls_files-CHECKEDIN = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
EXPORTING
DOCUMENTTYPE = ls_file_data-dokar
DOCUMENTNUMBER = ls_file_data-doknr
DOCUMENTPART = ls_file_data-doktl
DOCUMENTVERSION = ls_file_data-dokvr
IMPORTING
RETURN = ls_return
TABLES
DOCUMENTFILES = lt_files
COMPONENTS =
DOCUMENTSTRUCTURE =
I appriciate you response on this.
Thanks in advance.Hi,
Check the values you are passing into ls_files .
you dont need to pass checkedin = 'X'.
and check the storagecategory field - this should not be blnak.
files-SOURCEDATACARRIER = lsfile-DATA_CARRIER.
ls_files-WSAPPLICATION = ls_file-application.
ls_files-DESCRIPTION = ls_file-file_desc.
ls_files-STORAGECATEGORY = ls_file-category.
ls_files-DOCFILE = ls_file-doc_path.
ls_files-CHECKEDIN = 'X'.
This FM will work. No issues just check the values you are psssing into this LS_FILES structure.
Rest of the fields are corect.
Thanks,
Murali. -
How to do Check in the files for the document number?
Hi ,
By using BAPI_DOCUMENT_CHECKIN2 Function module I am uploading the Files for the Document number.
My problem is - After uploading the files to the document number the files are not in check in status.
I want the files to be checked in after uploading the from the FM.
Can anyone tell me what I am missing ? How to do check in the files.
I am passing the following values to FM.
ls_files-SOURCEDATACARRIER = ls_file-DATA_CARRIER.
ls_files-WSAPPLICATION = ls_file-application.
ls_files-DESCRIPTION = ls_file-file_desc.
ls_files-STORAGECATEGORY = ls_file-category.
ls_files-DOCFILE = ls_file-doc_path.
ls_files-CHECKEDIN = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
EXPORTING
DOCUMENTTYPE = ls_file_data-dokar
DOCUMENTNUMBER = ls_file_data-doknr
DOCUMENTPART = ls_file_data-doktl
DOCUMENTVERSION = ls_file_data-dokvr
IMPORTING
RETURN = ls_return
TABLES
DOCUMENTFILES = lt_files
COMPONENTS =
DOCUMENTSTRUCTURE =
I appriciate you response on this.
Thanks in advance.Any answers for this?
Thanks.
Maybe you are looking for
-
Adding custom fields in screen
I have added two custom fields in QUOTATION(VA21) in additional data tab B...when i create quotation for a particular sales order i am getting the fields in VBAK table and the issue is while creating sales order for the same i have to get these field
-
How I got my MicroPhoto to det
After hours of trying different things I finally got it to detect my MicroPhoto. I figure I might as well post how I got it to work. . Uninstall everything 2. Reinstall + update to 3.30.2 ( Can be found at Creative support ) 3. Reboot 4. Run windows
-
How to force HTML5 video?
hey, I did a clean install of Yosemite on my mid-2010 MBP 13, and one of the supposed things that was supposed to come of Yosemite (and Safari) was HTML5 video playback. 1) I have "prefer HTML5 playback" set w/Netflix, but, it still demands me to dow
-
Note to Jerry, Peter, Mike, drev9 and other Forum Contributors
I just discovered something today which will be useful to all of us. As you know, we very frequently have questions about what a particular Toshiba utility does and some people have asked where they can read about all the Toshiba utilities. I notice
-
Hi, I am working with ABAP-HR. In Personal Administration, while defining Infotypes , they say 'each infotype requirs at least 2 structures and atleast 1 internal table'. Will any body please help me to get the idea. Thanks in advance. Anirban Bhatta