Sql*loader - loading based on file name
Hi,
I am facing an issue with using sql*loader. I want to load two data files into one table. While loading the data I have to set a column value based on which file the loader uses. I will have to pass the data file name thru command line parameter.
Can anyone give the code to do this?
Data File names:
sproc01.dat
mproc01.dat
sproc02.dat
mproc02.dat, etc.
One control file:
load_data.ctl
The control file should look like....
load data
append
into a
when substr(<file_name>,1,5) = 'mproc'
data1 position(01:20),
data2 constant 'M'
into a
when substr(<file_name>,1,5) = 'sproc'
data1 position(01:20),
data2 constant 'S'
my doubt is, how to get the <file_name> in the when clause.
Hi
Depending on your server write a shell script or batch file to generate the control file.
rgds
Similar Messages
-
Feature Request: Ultrabeat: Load Sample auto copy file name to Drum Voice
Feature Request: Ultrabeat: Load Sample auto copy file name to Drum Voice
I wish that when I load a sample into a drum voice, that it would automatically copy the name of the sound file I'm importing to the drum voice minus the extension. If I were importing BD01.wav I'd like for the drum voice to display BD01. As it is, I have to import the file, then name or rename the drum voice to BD01. When importing large quntities, this becomes a giant pain, and I'm looking for anything programmatic that could save me a load of time. When I think of all the time I'm going to waste...and if you multiply that by all the number of users...that's a lot of wasted time.
I wish of course that the program could suck up and autoload all of the sound files within a directory, names too, until the voices were full. Then I could just fine tune and kick out ones I don't want or want in different order. Not a big deal for users who are importing from all kinds of different sources, but say for impoting libraries like NI's Battery, it's a big deal.
Maybe these could be choices in the load sample menu.
powerbook G4 Mac OS X (10.4.4)
pb g4 Mac OS X (10.4.4)Microsoft pulled the plug on DirectSound HAL in Vista due to lack of hardware support. The SAL exists for
software compatibility, good intention but bad performance as there is no longer a direct path from
DirectSound to audio drivers.
People choose DirectSound for its Direct-ness
but there is no reason to choose it now.
DirectX SDK was integrated
with WIndows SDK which ships with Visual Studio 2012 so you don't need additional downloads for
WASAPI and XAudio 2.
Just look up the documentation for headers/librarieslike every other Windows API you use. If you have a hard time to find the documentation then you need to go to search engines and find search engine tutorials.
There are plenty of samples for both WASAPI and XAudio 2, both in the Windows SDK and online. The DirectX team has some suggestions on which to use on their team blog.
You can find experts for those APIs at the Windows Desktop Pro-Audio Application Development forum and the
Audio/XACT forum on MSDN (link left out for you to practice your search skills). Again, it is fine to ask for hints but don't ask the whole
solution. You are competing with others who just need a hint to finish work here. The time spent on working on your assignment would be better spent on helping on giving hints to others.
Visual C++ MVP -
Receiver File adapter: dynamic folder name based on file name
Hi there,
is it possible to set up one communication channel that will use different target folders based on file name?
E.g.
File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
Thanks.If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
In your abap mapping:
DATA l_record type mpp_dynamic.
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'FileName'.
l_record-value = "your filename"
dynamic_configuration->add_record( l_record ).
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'Directory'.
l_record-value = "your directory ".
dynamic_configuration->add_record( l_record ).
Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
Regards,
Carme. -
Hi,
Please help me for this.
I need to create XML file for mentioned below. when i run the photoshop script i need deatails for active document name, date, time and status.
<?xml version="1.0" encoding="UTF-8"?>
<sample>
<filename>Cradboard_Boxes_Small.tif</filename>
<date>today date</date>
<starttime>now</starttime>
<status>delivered</status>
</sample>
<sample>
<filename>Cardboard_Boxes_Student_Vaue_Pack.jpg</filename>
<date>today date</date>
<starttime>now</starttime>
<status>delivered</status>
</sample>
I need read that xml after creating and modify based on file name. i need to modify status after file finished.
if the file name is already exist i want to modify or delete or add whatever i need.
Kindly help me simple wayYou may want to look into getting Xtools ps-scripts - Browse Files at SourceForge.net then. Most of the support is for ActionManager script code where XML code is use as an intermediate step. There are quite a few Photoshop script in XTools . Ross Huitt is an expert javascript programmer though is is fed up with Adobe's lack of support for Photoshop scripting particularly the bugs in ScriptUI he is still maintaining tool he has created for us free of charge. Tools like Image Processor Pro. None of his scripts are save as binary so you can read all of his code there is a wealth of knowledge in there....
Also there is a scripting forum Photoshop Scripting -
SQL*Loader to insert data file name during load
I'd like to use a single control file to load data from different files (at different times) to the same table. I'd like this table to have a column to hold the name of the file the data came from. Is there a way for SQL*Loader to automatically do this? (I.e., as opposed to running an update query separately.) I can edit the control file before each load to set a CONSTANT to hold the new data file name, but I'd like it to pick this up automatically.
Thanks for any help.
-- HarveyHello Harvey.
I've previously attempted to store a value into a global/local OS variable and use this within a SQL*Loader control file (Unix OS and Oracle versions between 7.3.4 and 10g). I was unsuccessful in each attempt and approach I could imagine. It was very easy to use a sed script to make a copy of the control file, changing a string within it to do this however.
Do you really want to store a file name on each and every record? Perhaps an alternative would be to use a relational model. Create a file upload log table that would store the file name and an upload # and then have the SQL*Loader control file call a function that would read that table for the most recent upload #. You'll save some disk space too.
Hope this helps,
Luke -
30EA4 Bug - load data, space in file name
Ubuntu 10.10, JDK 6.24, Sql Developer 3.0 EA4
If we try to import/load data from .xls file with space in file name, for example "list of cattle.xls" instead "list_of_cattle.xls" it doesn't work. It reports the following error: "Load data into table TABLE_X from file list of cattle.xls. Task failed and load rolled back."
The only workaround is to rename the file name without spaces.same problem when unload - Ver 3 - problem with unload results
-
BPM - merge files based on file name
Hi All,
i need to collect two source files based on the file name in BPM and then process it.
Lets say, i need to collect a header file and a items file. but any point of time, there can be more than one header and more than one item file in the source folder. and i need to collect the header and its corresponding/related item file.
can anyone help me how to achieve it in BPM? whats the correlation i need to give? is it possible to have a java code executed in BPM?
Is it possible to take care of this at adapter level itself while picking the file? if so, whats the file name scheme can i give?
Faster reply is very much appreciated.
Thanks n regards,
Rashmihi,
we can have the header file as header and item file as item. basically based on our convenient we can suggest the file name to the sender. so scheme can be anything that fits our requirement -
File Channel sequential processing based on file names
Hi,
I have a requirement in a sender file channel.
There are mulitple files with different file names, I want these files to be processed in sequence based on the file name.
For example.
The files lets say are A3_1, A2, A1,A3_2.
I want to process A1 then A2 and then A3.
Please suggest methods to implement the same, I think an adapter module should help, please throw some light on the same.
Regards,
Varun.Varun,
In that case I think you need to consider BPM. The file adapter does not support 'advanced' techniques for the sequence in which it polls files.
The process would then be:
- Use the adapter specific identiers for the file adapter to include the file name (/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions)
- Create a message mapping that puts the file name from the dynamic configuration into a field in the message type
- Create an integration process that receives the files from this adapter inside a loop step (/people/daniel.graversen/blog/2006/09/07/using-a-bpm-to-collect-messages-for-a-set-interval-of-time)
- You can now create an interface mapping that sorts the messages according to their filename and then send the messages to the receiver one by one (EOIO?).
Kind regards,
Koen -
Create Directories based on File Names
I have a Folder with all of my digital photos. All of the photos are named using a %Y%m%d_%H%M%S.jpg format. I am trying to write a script that would go through, and create folders based on the %Y%m%d portion of the name. Then move the photos into the appropriate folders. Then, create folders named according to %Y%m of the newly created folders, and move the %Y%m%d folders into the %Y%m folders. So that my folders would be organized as /%Y%m/%Y%m%d/%Y%m%d_%H%M%S.jpg or 200809/20080905/20080905_083026 - for a photo taken today.
Any tips for getting started on this? As always, thanks in advance.There are a number of ways of doing this, here's one model:
set topFolder to (choose folder with prompt "Please select the folder containing your images")
tell application "Finder"
repeat with eachFile in (get files of folder topFolder)
-- get the file name and date elements
set filename to name of eachFile
set YMD to characters 1 through ((offset of "_" in filename) - 1) of filename as text
set YM to characters 1 through 6 of YMD as text
-- make sure the subfolders exist. If they don't then create them
if not (exists folder YM of topFolder) then
make new folder at topFolder with properties {name:YM}
end if
if not (exists folder YMD of folder YM of folder topFolder) then
make new folder at folder YM of folder topFolder with properties {name:YMD}
end if
-- now move the file
move eachFile to folder YMD of folder YM of folder topFolder
end repeat
end tell -
Crearte folders based on file name and then do action
I've written this in the best possible step to step way as possible buti've no idea how to pull it altogether as a script. Hopefully its all there, just let me know if its still not clear, I would love the help if anyone can help sort this out for me.
Many Thanks
Matt
-there is a folder on the desktop called Season_SSxx_PSD where xx = a number
--This folder contains a quantity of PSD files that need to be processed the same but placed in different locations.
set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
set folderName to (folder of theDesktopFolder whose name starts with "SE")
--From the folderName
--set the seasonNumber to the item that follows Season_ and is before _PSD (the Season number should be SS13 but can change)
--Look at all files of folderName
--Files can be named like the following.
-- SE_BH70NW01234BM4BM
-- SE_BU40NW01234BM4BM
-- SE_ES20NW01234BM4BM
-- SE_DV25NW01234BM4BM
-- SE_DJ30NW01234BM4BM
-- SE_RA30NW01234BM4BM
-- SE_FR10NW01234BM4BM
-- SE_TM15NW01234BM4BM
-- SE_WA35NW01234BM4BM
-- Now set the brandIdentifier to Item that follows SE_ of the file names of the folderName
--Convert brandIdentifier to realName
--BH = BigandHuge
--BU = Buttons etc..
-- Now create the folders
--set up names to destination folders and create over Network for FTP collection (based on a mounted drive)
--set this_ftp_folder to "Impulse:"
--set ftpSeasonNumberFolder to my getFolderPath(seasonNumber, this_ftp_folder)
--Or Impulse:SS13:
--set ftpBrandFolder to my getFolderPath(realName, ftpSeasonNumberFolder)
--Or Impulse:SS13:BigandHuge:
--set ftpBrandFolder_High_Res to my getFolderPath(realName & seasonNumber & "_HR", ftpBrandFolder)
--Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:
--set ftpBrandFolder_High_PNG to my getFolderPath("_PNG", ftpBrandFolder_High_Res)
--Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:PNG:
--then the following
--Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:JPG:
--Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:PNG:
--Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:JPG:
--Its these last 4 that will be used later.
--then all files begining with BH in the folderName do this photoshop action and save in the folders created from --above, then move on to the next file begining with BU create the relevant folders and then do the action as --before and so on.Cool that sorted the folder creation out without an issue, many thanks.
Just struggling to pin the photoshop part in.
property type_list : {"8BPS"}
property extension_list : {"psd"}
script o
property theseNames : {}
end script
-- empty log file
do shell script "echo 'Files not processed in Photoshop :' > ~/Desktop/LogPhotoshopError.txt"
set noError to true
--at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
--use the result for the if file exists?
display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
set skipFiles to (button returned of the result) is "Skip (Faster)"
set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
tell application "Finder" to set seFolder to (folders of folder theDesktopFolder whose name starts with "SE")
if seFolder is not {} then
set seFolder to item 1 of seFolder
tell application "Finder" to set tName to name of seFolder
set seasonNumber to my getText(tName) -- get Season Number
if seasonNumber is not "" then
set list1 to {"BH", "BU", "ES", "DV", "DJ", "RA", "FR", "TM", "WA"}
set list2 to {"BHS", "Burtons", "DaisyAndEve", "Diva", "DorothyPerkins", "DorothyPerkins", "Freedom", "TopMan", "Wallis"} -- you must complete this list ***
set tc to count list2
repeat with i from 1 to tc
set brandIdentifier1 to item i of list1
set brandIdentifier to item i of list2 -- the real name
--first item = all files begining with BH
tell application "Finder" to set theseFiles to (files of seFolder whose name starts with "SE_" & brandIdentifier1) as alias list
if theseFiles is not {} then
--local Folders
set this_local_folder to "Images:2012-2013"
set localSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_local_folder)
set localSeasonFolder to my getFolderPath(brandIdentifier, localSeasonNumberFolder)
set localSeasondFolder_PSD to my getFolderPath("PSD", localSeasonFolder)
-- *** Now create the folders ***
set this_ftp_folder to "Impulse:"
set ftpSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_ftp_folder)
set ftpBrandFolder to my getFolderPath(brandIdentifier, ftpSeasonNumberFolder)
set ftpBrandFolder_High_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_HR", ftpBrandFolder)
set ftpBrandFolder_Low_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_LR", ftpBrandFolder)
--Use the folders below within Photoshop
set ftpBrandFolder_High_PNG to my getFolderPath("PNG", ftpBrandFolder_High_Res)
set ftpBrandFolder_Low_PNG to my getFolderPath("PNG", ftpBrandFolder_Low_Res)
set ftpBrandFolder_High_JPG to my getFolderPath("JPG", ftpBrandFolder_High_Res)
set ftpBrandFolder_Low_JPG to my getFolderPath("JPG", ftpBrandFolder_Low_Res)
--- *** end create the folders ***
repeat with i in theseFiles
set tFile to i as string
--taking the folder identify which process it must follow.
if brandIdentifier is equal to "BHS" then
try
tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
on error
set o's theseNames to {} -- no psd files or "8BPS"
end try
set numOfNames to (count o's theseNames)
repeat with j from 1 to numOfNames
set thefile to theFolder & ":" & (item j of o's theseNames)
-- B H S Folder Photoshop Process
set thisName to (item j of o's theseNames)
tell application "Finder"
set t_ext to name extension of file thefile
if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
end tell
if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
tell application "Adobe Photoshop CS5.1"
-- I remove the command activate, Photoshop stay in background
set ruler units of settings to pixel units
try
open (alias thefile) showing dialogs never
set origName to name of current document
set myOptions to {class:JPEG save options, quality:12}
set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
tell current document
--If the quick mask mode has been left on then delete the channel Quick Mask
if (quick mask mode) then delete channel ¬
"Quick Mask"
--If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
if (exists layer "Original Layer") then ¬
tell layer "Original Layer" to set name to "Original Image"
save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
(delete layer "Original Image") flatten
resize image resolution 300 resample method none
--sharpen image
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
save in (ftpBrandFolder_High_JPG & name) as JPEG with options myOptions without copying
--Prepare for Low RES by resetting image history
set current history state to history state 3
flatten
resize image width 1348
resize image resolution 300 resample method none
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
--add save to lowResFolder with same options
save in (ftpBrandFolder_Low_JPG & name) as JPEG with options myOptions without copying
close saving no
end tell
on error
set noError to false
my myLogs(thefile) -- write path to log file in Desktop
try
close saving no --if exists, close current document
end try
end try
end tell
end if
end repeat
--End BHS
--taking the folder identify which process it must follow. W A L L I S
else if brandIdentifier is equal to "Wallis" then
try
tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
on error
set o's theseNames to {} -- no psd files or "8BPS"
end try
set numOfNames to (count o's theseNames)
repeat with j from 1 to numOfNames
set thefile to theFolder & ":" & (item j of o's theseNames)
-- W A L L I S Folder Photoshop Process
set thisName to (item j of o's theseNames)
tell application "Finder"
set t_ext to name extension of file thefile
if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
end tell
if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
tell application "Adobe Photoshop CS5.1"
-- I remove the command activate, Photoshop stay in background
set ruler units of settings to pixel units
try
open (alias thefile) showing dialogs never
set origName to name of current document
set myOptions to {class:JPEG save options, quality:12}
set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
tell current document
--If the quick mask mode has been left on then delete the channel Quick Mask
if (quick mask mode) then delete channel ¬
"Quick Mask"
--If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
if (exists layer "Original Layer") then ¬
tell layer "Original Layer" to set name to "Original Image"
save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
(delete layer "Original Image") flatten
resize image resolution 300 resample method none
--sharpen image
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
save in (ftpBrandFolder_High_Res & name) as JPEG with options myOptions without copying
--Prepare for Low RES by resetting image history
set current history state to history state 3
flatten
resize image width 1020
resize image resolution 300 resample method none
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
--add save to lowResFolder with same options
save in (networkBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
close saving no
end tell
on error
set noError to false
my myLogs(thefile) -- write path to log file in Desktop
try
close saving no --if exists, close current document
end try
end try
end tell
end if
end repeat
--End W A L L
end if
end if
if not noError then do shell script "/usr/bin/open ~/Desktop/LogPhotoshopError.txt'"
on myLogs(t)
try
do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
end try
end myLogs
on getText(t)
set {oTID, text item delimiters} to {text item delimiters, "_"}
try
set r to ""
set r to text -2 thru -1 of (text item -2 of t)
end try
set text item delimiters to oTID
return r
end getText
on getFolderPath(tName, folderPath)
tell application "Finder" to tell folder folderPath
if not (exists folder tName) then
return (make new folder at it with properties {name:tName}) as string
else
return (folder tName) as string
end if
end tell
end getFolderPath -
Trying to move a file based on file name
ok, so i feel like this should be an easy thing to accomplish, but sadly, i can't seem to get it. here's what i got...i have an automator app that will take a file that has been scanned in (pdf) and rename it to the name in a field in one of my filemaker databases. got that working. now, depending on the name of the file, i need this applescript to move that file to the correct folder. for instance...if the file name starts with "P", then i need it to move to 'folder 1'. if it starts with 'L", it needs to move to 'folder 2'....and so on. this is what i've got, but it doesn't work. can someone point me in the right direction?
on run {input, parameters}
set FileName to input as text
tell application "Finder"
if name of FileName starts with "P" then
move file FileName to folder "Drive:Folder:Folder1"
else if name of FileName starts with "8" then
move file FileName to folder "Drive:Folder:Folder2"
else if name of FileName starts with "L" then
move file FileName to folder "Drive:Folder:Folder3"
else if name of FileName starts with "T" then
move file FileName to folder "Drive:Folder:Folder4"
end if
end tell
return input
end runtry...
if character 1 of FileName is "P"
edit:
Whoops rereading your code I realized I completely misdiagnosed the problem there as "begins with" is proper applescript. What are you passing in as Filename? Try a "display dialog FileName" near the beginning of your script and see what you get. You might also try ...if fileName contains "string"...so you don't need to worry about starts with etc. -
Deleting Applications based on file names.
I have a pink palm centro, and I would like to delete the following applications: get email, sprint store, and sprint TV. When I try to delete these things, it only gives me the file names on the list, and I don't know which file name belongs to what applications.. Can anyone help?
Post relates to: Palm i705Hi.. Welcome to the Palm forums. The applications you are trying to delete are all part of the rom and not removable.
Post relates to: Centro (Sprint) -
Cant load schema-based xml-file to default table via http/ftp
Hola,
we are running ORACLE 10.2.0.3.0 with installed XML-DB.
HTTP- and ftp-listeners where configured successfully, we are able to register a designed XSD-file within XML-DB. Autogen types and tables where set "true" and default table for root object within xsd and several type objects where also created successful.
Oracle DB is running on a Linux environment, it is possible to establish a WEBDAV-connection to this machine via my Windows client.
As far as I understood the Oracle examples, there should be some kind of automatism. Putting a valid (and registered via xsi:noNamespaceSchemaLocation=<pointing to xsd-file>) XML file into my WEBDAV folder should create an XML object in the XML repository AND create a dataset in the default table.
Last thing doesn´t work.
Any idea?!Can you try this simple example
SQL> set echo on
SQL> spool testase.log
SQL> --
SQL> connect / as sysdba
Connected.
SQL> --
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = OTN
SQL> --
SQL> def PASSWORD = &USERNAME
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user OTN cascade
User dropped.
Elapsed: 00:00:00.18
SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
2 /
old 1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
new 1: grant create any directory, drop any directory, connect, resource, alter session, create view to OTN identified by OTN
Grant succeeded.
Elapsed: 00:00:00.09
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user OTN default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> -- create or replace directory XMLDIR as '&XMLDIR'
SQL> -- /
SQL> var SCHEMAURL varchar2(256)
SQL> VAR XMLSCHEMA CLOB;
SQL> VAR INSTANCE CLOB;
SQL> VAR DOCPATH VARCHAR2(700)
SQL> --
SQL> set define off
SQL> --
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
Elapsed: 00:00:00.01
SQL> begin
2 :SCHEMAURL:= 'http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Vergabemeldung_Formular.xsd';
3 :XMLSCHEMA :=
4 '<?xml version="1.0" encoding="UTF-8"?>
5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
6 <xs:simpleType name="string_5">
7 <xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction>
8 </xs:simpleType>
9 <xs:simpleType name="string_6">
10 <xs:restriction base="xs:string"><xs:maxLength value="6"/></xs:restriction>
11 </xs:simpleType>
12 <xs:simpleType name="string_8">
13 <xs:restriction base="xs:string"><xs:maxLength value="8"/></xs:restriction>
14 </xs:simpleType>
15 <xs:simpleType name="string_20">
16 <xs:restriction base="xs:string"><xs:maxLength value="20"/></xs:restriction>
17 </xs:simpleType>
18 <xs:simpleType name="string_30">
19 <xs:restriction base="xs:string"><xs:maxLength value="30"/></xs:restriction>
20 </xs:simpleType>
21 <xs:simpleType name="string_60">
22 <xs:restriction base="xs:string"><xs:maxLength value="60"/></xs:restriction>
23 </xs:simpleType>
24 <xs:element name="CSBF_Vergabemeldung" xdb:defaultTable="CSBF_VERGABE_INFO_XML">
25 <xs:complexType>
26 <xs:sequence>
27 <xs:element name="CSBF_Vergabemeldung_Info">
28 <xs:complexType>
29 <xs:sequence>
30 <xs:element name="Identnummer" type="string_30"/>
31 <xs:element name="Version_CSBF_Vergabevermerk_Formular" type="string_30"/>
32 <xs:element name="Fertigstellung_Vergabevermerk" type="xs:date"/>
33 </xs:sequence>
34 </xs:complexType>
35 </xs:element>
36 <xs:element name="Strassenbaudienststelle">
37 <xs:complexType>
38 <xs:sequence>
39 <xs:element name="Kennung" type="string_8"/>
40 <xs:element name="Strassenbau_Organisation_Bezeichnung" type="string_60"/>
41 <xs:element name="Adresszeile_2" type="string_60" minOccurs="0"/>
42 <xs:element name="Adresszeile_3" type="string_60" minOccurs="0"/>
43 <xs:element name="Adresszeile_4" type="string_60" minOccurs="0"/>
44 <xs:element name="Strasse" type="string_60"/>
45 <xs:element name="PLZ" type="string_6"/>
46 <xs:element name="Ort" type="string_60"/>
47 <xs:element name="NUTS" type="string_5"/>
48 <xs:element name="Telefon" type="string_20" minOccurs="0"/>
49 <xs:element name="Fax" type="string_20" minOccurs="0"/>
50 <xs:element name="E_Mail" type="string_30"/>
51 </xs:sequence>
52 </xs:complexType>
53 </xs:element>
54 </xs:sequence>
55 </xs:complexType>
56 </xs:element>
57 </xs:schema>';
58 :DOCPATH := '/public/CSBF_Vergabemeldung.xml';
59 :INSTANCE :=
60 '<?xml version="1.0" encoding="ISO-8859-15"?>
61 <CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF
_Vergabemeldung_Formular.xsd">
62 <CSBF_Vergabemeldung_Info>
63 <Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
64 <Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
65 <Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
66 </CSBF_Vergabemeldung_Info>
67 <Strassenbaudienststelle>
68 <Kennung>xxxxx</Kennung>
69 <Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
70 <Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
71 <Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
72 <Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
73 <Strasse>xxxxxxxxxxxxxx</Strasse>
74 <PLZ>xxxxx</PLZ>
75 <Ort>xxxxxxxxxxxxxx</Ort>
76 <NUTS>xxxxx</NUTS>
77 <Telefon>xxxxxxxxxxx</Telefon>
78 <Fax>xxxxxxxxxxx</Fax>
79 <E_Mail>[email protected]</E_Mail>
80 </Strassenbaudienststelle>
81 </CSBF_Vergabemeldung>';
82 end;
83 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaurl => :SCHEMAURL,
5 schemadoc => :XMLSCHEMA,
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => TRUE
10 );
11 end;
12 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.80
SQL> desc CSBF_VERGABE_INFO_XML
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Vergabemeldung_Formular.xsd" Element "CSBF_Vergabemeldung") STORAGE Object-rel
ational TYPE "CSBF_Vergabemeldung3270_T"
SQL> --
SQL> declare
2 V_RESULT BOOLEAN;
3 begin
4 if dbms_xdb.existsResource(:DOCPATH) then
5 dbms_xdb.deleteResource(:DOCPATH);
6 end if;
7 V_RESULT := DBMS_XDB.CREATERESOURCE(:DOCPATH,:INSTANCE);
8 COMMIT;
9 end;
10 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.79
SQL> select count(*)
2 from CSBF_VERGABE_INFO_XML
3 /
1
Elapsed: 00:00:00.15
SQL> set long 10000 pages 0 lines 160
SQL> --
SQL> select object_value
2 from CSBF_VERGABE_INFO_XML
3 /
<?xml version="1.0" encoding="WINDOWS-1252"?>
<CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Verg
abemeldung_Formular.xsd">
<CSBF_Vergabemeldung_Info>
<Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
<Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
<Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
</CSBF_Vergabemeldung_Info>
<Strassenbaudienststelle>
<Kennung>xxxxx</Kennung>
<Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
<Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
<Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
<Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
<Strasse>xxxxxxxxxxxxxx</Strasse>
<PLZ>xxxxx</PLZ>
<Ort>xxxxxxxxxxxxxx</Ort>
<NUTS>xxxxx</NUTS>
<Telefon>xxxxxxxxxxx</Telefon>
<Fax>xxxxxxxxxxx</Fax>
<E_Mail>[email protected]</E_Mail>
</Strassenbaudienststelle>
</CSBF_Vergabemeldung>
Elapsed: 00:00:01.99
SQL> select xdburitype(:DOCPATH).getXML()
2 from DUAL
3 /
<?xml version="1.0" encoding="WINDOWS-1252"?>
<CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Verg
abemeldung_Formular.xsd">
<CSBF_Vergabemeldung_Info>
<Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
<Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
<Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
</CSBF_Vergabemeldung_Info>
<Strassenbaudienststelle>
<Kennung>xxxxx</Kennung>
<Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
<Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
<Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
<Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
<Strasse>xxxxxxxxxxxxxx</Strasse>
<PLZ>xxxxx</PLZ>
<Ort>xxxxxxxxxxxxxx</Ort>
<NUTS>xxxxx</NUTS>
<Telefon>xxxxxxxxxxx</Telefon>
<Fax>xxxxxxxxxxx</Fax>
<E_Mail>[email protected]</E_Mail>
</Strassenbaudienststelle>
</CSBF_Vergabemeldung>
Elapsed: 00:00:00.11
SQL> -
Advise on complex scenario. Correlation based on file name
I need to process all *.xml files in a folder, but I should only process a specific .xml file if I find another one .ctl with the same name.
That is. I may have 3 .xml files in a folder (a.xml, b.xml and c.xml), but as I have only one .ctl in the same folder (b.ctl), I should only process b.xml and do something with it.
I've been struggling to find out a possible way to solve this scenario. I think it's only possible using NFS with the option of "additional files", but I have to use FTP, and it doesn't have that option.
Of course I could implement it using a java module adapter in the sender comm channel for *.ctl files which establishes the ftp connection for the other file (.xml), but I'm trying to avoid this.
Thanks!Hi,
Hopefully this blog will solve your problem..(you have to set your parameter as per your need)
/people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
Sorry Jorge, I misunderstood your question.. above blog will not help in your case..
Update:-
How about writing a script which will scan the source folder and check if there is a file with .ctl extension then it will move the same name file with extension .xml into some other folder and then you can configure your adapter with this second directory path to simply pick the files.
Edited by: Sarvesh Singh on Feb 12, 2010 2:07 AM -
File name based routing in Receiver determination
Hi experts,
I have a requirement to do receiver determination based on file names which are dynamic.To put it clearely, i will be having two files in my source File location and i need to route it based on the file name to two target systems.
The file name are like Month(changes everymonth)_TargetSys1 and month_targetSys2.
I dont need any conversions ,so i am not using any IR objects.
To pick files i kept *.txt in sender channel, and in receiver determination condition i was trying to use context object called 'Filename'.But it doesnt work asthe file name changes every month.
Is there any option to take substring from the input file name (say targetSys2 from month_targetSys2.) and put it as a condition for receiver determination.
There is not DT or structure of the incoming file , as there are no modification to be done with the content.
Regards,
Anikayou need to have the structure in case you want to route it via the xpath.
Else another option is to code the enhanced receiver determination and using a java mapping with dynamic configuration read the filename and then dynamically create the receiver determination.
http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/content.htm
Maybe you are looking for
-
I have gotten 2 messages: You've got a FLIX message! To see it, visit vzwpix.com from an internet accessible computer & follow the directions. You have not been billed a PIX-FLIX charge for this message I did and got some goofy message about Verizo
-
Hello, I worked earlier on Weblogic 8.1 and after a long gap I am coming back to Weblogic Server. And I tried to install & setup Weblogic Server 11g R1 (10.3.5). I successfully installed WL 11g on a Linux machine, configured the domain, and admin ser
-
One digit in customer number missing in Export to excel download
Dear All, We have a customized report for customer collection.The output of this report is as per desired. But when we download it to excel last digit in customer master is missing.That means say customer number is 1100051 while we export
-
How to add entries a jsp file during a Source view
hi all, im currently extending the tags present on BEA. im creating my own custom tag. when i tried to drag and drop it on the current source view of the jsp file.. is it possible for me to check the current source code of the jsp file first before p
-
I am doing tutorials on dynamic pages in Dreamweaver 8. I am doing both php and asp. When I preview an asp page, for instance, it displays properly - from 'Localhost.' When I enter the url of the page in a browser, however, the 'Do you want to open o