Get datafile name in database column using ctl file - SQLLDR
I have a shell script(ksh) and calling control file using SQLLDR. I want to pass the datafile name in database table column. Can anyone give an example of this. Appreciate your response.
--TV2703
Create the control file dynamically before you start SQL*Loader
Something like
echo LOAD DATA > load.ctl
echo INTO TABLE dept >> load.ctl...
Another option is to use external tables
Similar Messages
-
Getting the name of the column using MDM API
Hi I want to know the Column name from fieldId, can any one help me on this. I am using the following code to get the data but i nedd column name to which the data is refering
ArrayList mdmData=new ArrayList();
RecordResultSet rs=(RecordResultSet)obj;
FieldId field[];
for(int i=0;i<rs.getRecords().length;i++)
field=rs.getRecords()<i>.getFields();
for(int j=0;j<field.length;j++)
mdmData.add(rs.getRecords()<i>.getFieldValue(field[j]));
Regards,
SandeepHi Sandeep,
When you fetched the FieldID from FieldProperties object. There is one more method to this class named FieldProp.getName(). This returns you the Name of the Field. You can store that too if you need it later.
Thanks
Namrata -
Order By Clause on Non-Database Column using Forms
How to Sort by using Order by Clause on Non-Database Column using Forms6i
Eugene,
What is the error message/ number you are seeing? If you run "select name from tblperson order by name" do you still get an error? -
Query to get the name of the tables used in a View?
Hi,
Could you please help me in getting the name of the tables used in a perticular view?
Please help me out...
thnx in advance.
Thnx,
Bits
Edited by: Bits on Sep 14, 2009 2:15 PMThere is no data dictionary table that stores this directly.
- You could get the DDL used to create the view and parse that SQL. Depending on how complex the view might be, this could be relatively easy or highly complex.
- You could get a recursive list of the objects that the view depends on (from ALL_/USER_/DBA_DEPENDENCIES) and trace those dependencies back to all the tables that the view depends on. If your view calls functions, however, this may or may not be what you're looking for. If you are selecting from just one table in the FROM clause but you are calling a function that references a dozen tables, do you want one row? Or thirteen? What about tables referenced in a correlated subquery in the WHERE clause?
Justin -
Get period name on query to use it in report
i want get period name on query to use it in report
the query
get period name on query to use it in report
SELECT itm.item_number item_no,
itm.description item_desc1,
mtl.organization_code,
cpt.cost_cmpntcls_code,
cpt.cost_cmpntcls_desc,
adj.cost_analysis_code,
adj.adjust_qty,
adj.adjust_qty_uom,
adj.adjust_cost,
adj.reason_code,
rsn.reason_desc,
adj.organization_id,
adj.period_id,
adj.cost_type_id
FROM cm_adjs_dtl adj,
mtl_item_flexfields itm,
cm_cmpt_mst cpt,
cm_reas_cds rsn,
mtl_parameters mtl
WHERE adj.inventory_item_id = itm.inventory_item_id
AND adj.organization_id = itm.organization_id
AND adj.cost_cmpntcls_id = cpt.cost_cmpntcls_id
AND adj.reason_code = rsn.reason_code
AND adj.organization_id = mtl.organization_id
/* AND adj.period_id = :period_id
AND adj.cost_type_id = :p_cost_type_id */
AND adj.delete_mark = 0
AND adj.reason_code = 'ADJ'
and adj.cost_analysis_code = 'EXP'See Link between mtl_material_transactions,org_acct_periods, gl_period_statues
Hope this answers your question,
Sandeep Gandhi -
"How to get distinct values of sharepoint column using SSRS"
Hi,
I have integrated sharepoint list data to SQL Server reporting services. I am using the below to query sharepoint list data using sql reporting services.
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<Parameters>
<Parameter Name="listName">
<DefaultValue>{GUID of list}</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue>{GUID of listview}</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>9999</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
By using this query, I am getting a dataset which includes all the columns of sharepoint list. Among these columns, I wanted to display only 2 columns (i.e Region and Sales type) using chart. I have created a Region parameter but when I click preview, the drop down box is giving me all the repeatative values of region like RG1,RG1,RG1,RG2,RG2,RG2,RG2,RG3.......... I wanted to display only distinct values of Region parameter so that whenever end user select region from the parameter drop down, it will display the respective value of Sales type column.
Also when I select only RG1 parameter, it is giving me a chart including the sales type of all the Regions. (it should display me only the sales type of RG1) How can I link these 2 columns so that they will display the values respectively.
I would really appreciate if anyone can help me out with this.
Thanks,
Sam.Hi Sam,
By code, the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results.
In this case, we could use the custom code to get distinct records.
Here are the detailed steps:
1. Create a hidden parameter that gets all the records in one field.
Note: Please create another dataset that is same of the main dataset. This dataset is used for the parameter.
2. Create a function that used to remove the duplicate records.
Here is the code:
Public Shared Function RemoveDups(ByVal items As String) As String
Dim noDups As New System.Collections.ArrayList()
Dim SpStr
SpStr = Split(items ,",")
For i As Integer=0 To Ubound(Spstr)
If Not noDups.Contains(SpStr(i).Trim()) Then
noDups.Add(SpStr(i).Trim())
End If
Next
Dim uniqueItems As String() = New String(noDups.Count-1){}
noDups.CopyTo(uniqueItems)
Return String.Join(",", uniqueItems)
End Function
3. Create another parameter that will be used for filtering the maindata.
Please set the available value to be =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",")
And the default value to be the value you what such as the first value:
=Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",").(0)
4. Go to the main dataset. Open the property window of this dataset.
5. In the “Filters” tab, set the filter to be:
Expression: <The field to be filter>
Operator: =
Value: =Parameters!Region.Value
The parameter “Region” should be the parameter we created in the step3.
Now, we should get distinct values of SharePoint columns.
If there is anything unclear, please feel free to ask.
Thanks,
Jin
Jin Chen - MSFT -
How to get string value from database table using Visual Studio 2005?
Hi,
Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
Im using the below code to get the values from database table
bool Table::Get(char* FieldName,int& FieldValue)
try
_variant_t vtValue;
vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
FieldValue=vtValue.intVal;
CATCHERRGET
sprintf(m_ErrStr,"Success");
return 1;
Im using the below code to get the values.
AIErr getProjects()
char buf[5000];
int i;
std::string catName;
::CoInitialize(NULL);
Database db;
Table tbl;
errno_t err;
err = fopen(&file,"c:\\DBResult.txt","w");
fprintf(file, "Before Connection Established\n");
//MessageBox(NULL,CnnStr,"Connection String",0);
if(!db.Open(g->username,g->password,CnnStr))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
fprintf(file, "After Connection Established\n");
if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
int ProjectID;
int UserID;
int ProjectTitle;
char ProjectName[ProjectNameSize];
if(!tbl.ISEOF())
tbl.MoveFirst();
ProjectArrCnt=0;
for(i=0;i<128;i++)
buf[i]='\0';
int j=0;
while(!tbl.ISEOF())
if(tbl.Get("ProjectID",ProjectID))
fprintf(file,"Project ID: %d ",ProjectID);
ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
sprintf(buf,"%d",ProjectID);
//MessageBox(NULL, buf,"f ID", 0);
j++;
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
//if(tbl.Get("ProjectTitle",ProjectName))
if(tbl.Get("ProjectName",ProjectName))
MessageBox(NULL,"Inside","",0);
fprintf(file,"ProjectTitle: %s\n",ProjectName);
//catName=CategoryName;
ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
//sprintf(buf,"%s",ProjectName);
MessageBox(NULL,(LPCSTR)ProjectName,"",0);
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
ProjectArrCnt++;
//MessageBox(NULL, "While", "WIN API Test",0);
tbl.MoveNext();
//MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
::CoUninitialize();
//sprintf(buf,"%s",file);
//MessageBox(NULL,buf,"File",0);
fprintf(file, "Connection closed\n");
fclose(file);
for(i=0;i<ProjectArrCnt;i++)
sprintf(buf,"%i",ProjectInfo[i].ProjectID);
//MessageBox(NULL,buf,"Proj ID",0);
//MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
return 0;
In the above code im geeting project D which is an integer value. But not able to get the project name.
Please some one guide me.As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.
-
ActiveSync Input Form -- To take AD Resource name from Database column
Hi All,
My authorative source is a database table called dbTable.
I am using an input form to provision into Active Directory. The Active Directory resource name is stored in a dbTable column. I first tried to hardcode the name of AD and do the provisioning, it worked. But wen I tried to take the name of the AD from my dbTable column using
<Field name='waveset.resources'>
<Comments>Add the AD account user inducted.</Comments>
<Expansion>
<block trace='true'>
<filterdup>
<appendAll>
<ref>waveset.resources</ref>
<list>
<ref>activeSync.resourceNm</ref>
</list>
</appendAll>
</filterdup>
</block>
</Expansion>
<Disable>
<block trace='true'>
<neq>
<ref>feedOp</ref>
<s>create</s>
</neq>
</block>
</Disable>
</Field>
It didnt work.
Plz, can anyone tell me how to bring the name of the AD resource in my input form for provisioning into that AD.
I need help. Plz treat it as urgent coz i can't move further without this being solved.Hello, first try to trace the value, using <ref>activeSync.resourceName</ref> should work,
also read the example in Identity Manager documentation (PDFs) called: "Example: Disabling Accounts through ActiveSync Capable Adapters"
Regards,
Edgar Torres -
How to get the name of the currently used display variant
Dear all,
I found the user-exit EXIT_SAPLGRAP_001 for programming download authorization.
With us no standard user is allowd to download data from R/3. With the user-exit it would be possible to allow certain downloads. one problem i solved already.
For programming the second authorization i need the name of the currently used display variant in RKPEP000. Where can i get the name. I tried user-exits for RKPEP000, but i didn't find the name. I didn't find it in SYST either.
Thanks and reargs
MonikaFirst you need to enter those names. Right-click the songs (Windows) or go to File>Get Info (All Platforms), then go to the second tab from the left to insert the information.
-
Get comp name and apply expression using it.
Hey Guys,
So basically, I've created a Vignette script using cc spotlight. The only problem is, in order to link some expression between comps, I had to rename the main comp the vignette is being applied to.
Is there a way to get the name of a comp (the current item) and place it inside of an expression?
Here is a link to my script. It should make more sense when you check it out.
http://rapidshare.com/files/456403457/VB_Vignette3.jsx
Thanks for your help.
-TylerYeah, that's the problem......
I need to get the name of the "active item" (a comp in this case) and use that name inside of an expression.
Any thoughts?
Thanks!
(Dan you're awesome!, love three d corner pin;) -
How can i get rulefiles name in appllication with using custom java code.
Hi.
I want to get rulefiles names from analytic service with using java api.
How can i get rulefiles name. Which api can i use for this issue?Hi,
Use IEssCube.getOlapFileObjects() api to retrieve rule files.
Insert this code snipid in your code, it will list all the rule files.
IEssCube cube = olapSvr.getApplication("Sample").getCube("Basic");
IEssIterator itr = cube.getOlapFileObjects(IEssOlapFileObject.TYPE_RULES);
IEssBaseObject[] rfs = itr.getAll();
System.out.println("Rule file count: "+rfs.length);
for (int i = 0; i < rfs.length; i++) {
System.out.println("RuleFile"+i+": "+((EssOlapFileObject)rfs).getName());
you can also list data files and other file objects by changing IEssOlapFileObject.TYPE in getOlapFileObjects()
Regards
Rajeev Singh -
How can I get the name of the column in Cursor
hi,
how can i derive the name of the columns in cursor
e.g
suppose I have a cursor
cursor c is select * from emp;
c1 c%rowtype.
for c1 in c
I want to display the name of the column how can I do. i don't
remember the name, but i need it to be displayed tooo.
thanx in advance
SreekantYou can only do this by DESCing the tables in the cursor and
then coding eg. v_no := c1.empno;
APC -
Database Recovery using Archive files
Dears,
Due to some issue our database get crashed.
We have saturday night offline backup and archive backup till yesterday night.
We have restored offline backup and system is Up but it is on saturday night state.
We want to apply these archive files to make the system state to current.
In restore our control file also get replace with our saturday night control file status.
We have copied our archive files in oraarch directory.
Now when using brtools I am applying archive files:
Command executing in brtools:
recover from '/oracle/<SID>/oraarch' database
it shows
unknow command beginning
No recovery required
On sqlplus also when I execute
sql>recover database;
It shows no recovery required.
When I give command:
sql>recover database using backup control file;
it ask for some {file name| AUTO | CANCEL}
I give first file name of oraarch it shows "Can not access the file".
File permissions are ok.
I give AUTO, It also then do not do anything.
Please suggest the correct method to make my system in latest current date.
ShivamHi Shivam,
This is absolutely normal that during the restore your control files will be replaced by the old one which were backed up during database backup.
Logic is that you can not apply the redolgs which are having the timestamps older than your restored datafile's / controlfile's timestamp.
If your DB is not yet opened, you can check the status of your database using below command which will tell you, till what timestamp your data is restored or currently available.
select to_char(CHECKPOINT_TIME,'yyyy-mm-dd:hh24:mi:ss') from v$datafile where file#=1;
>
> From command I want to know "from backup control file"....Do SAP take backup of control file as in system only old is
>
> available.
> Shivam
>
recover database using backup controlfile..... this command does not backup the controlfile . this will make use of old controlfile only which came along with the restore and start the recovery using this controlfile only.
Its just make use of available controlfile ..No backup will be triggered.
Please make a note that after DB restore; ..recovery is possible only in case database is not yet opened in OPEN state.
Cheers !!!
Ashish -
Passing file name dynamically to sql loader ctl file
Hi,
I am new to scripting and I have a complex requirement involving writing a script.
Requierment:
I need to upload a CSV file from a FTP server into oracle table using SQL Loader. The file name resembles like APF0912312359.csv represents 31-DEC-2009 23:59 and there will be multiple files in same day indicated by differnt timestamp as its filename. Once I load a file using SQL loader, I need to move the file to another directory for archival.
Since the sql loader ctl file has a fixed file name, I would like to know how I can pass the file name dynamically to ctl file to load a new file every time it runs.
Any help is greatly appreciated..
Bye
Sudheer
Edited by: user2138419 on Oct 28, 2009 4:08 PMI agree with Pradeep in regards to declaring the file names on the command line. However, I do have a concern regarding presenting the password on the command line as any user that can issue a ps (assuming Unix ~= Linux here) would be able to read it while the sqlldr command is running.
Unfortunately, you may not always have the option of declaring the files on the command line. I was recently challenged with this in a Windows 2003 Server environment running SQL*Loader: Release 10.2.0.1.0. In this environment I found that I am able to set a variable file name in a calling batch file and use that value in the control file successfully. Just to demonstrate the approach:
Batch file:
set IN_FILE=’c:\inbound\load_me.txt’
sqlldr user/pswd@db PARFILE=’c:\parameters.txt’
Parameter file:
errors=500000
rows=50000
control=%CTL_FILE%
bad=%BAD_FILE%
discard=%DSC_FILE%
log=%LOG_FILE%
Control file:
LOAD DATA
INFILE ‘%IN_FILE%’
INSERT
INTO TABLE table_to_be_loaded
I’m really interested to see if this would work on Unix.
-Luke -
How to get the filename in mapping when using sender File adapter?
hi Experts,
I have scenario where XI reads the input file using Sender file adapter.
The file name is configured in the communication channel.
In my message mapping it is possible to read this file name?
Thanks
gopalHi Gpoal,
Use Dynamic Configuration - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards,
Geetha
Maybe you are looking for
-
Cannot save multiple tabs in firefox 4.0. NO OPTION
in new firefox, i canno save multiple tabs....there no option about.
-
Weird screen doing stuff itself
iPad 2 from october '11 First few months were fine other than magnet in screen cover thing messing with orientation when I turned the screen. Took it off and I was happy. It works now. But the new issue Is that the extreme right part of my screen som
-
Comparing vector/waveform scopes between two clips
Is there a way to bring up the scopes for two separate clips to compare them as one can do in Premiere? I use the 2-up function often to compare clips visually, but it just does not cut it for some corrections.
-
How to create paging in air application
hi , I have created an air application which takes the data from a feed. I ve to create paging for my Richtext which wiil hold the description of my image.i took the length of the description from the feed using substring using the following code va
-
Losing smart camera connection when using web server on NI1762 smart camera
Hi I am using 2 smart cameras ( old NI1762 and the new NI1772) with Vision builder 2011 . I am trying to find a way to retrieve data and image to a Visual Basic 6 application. i could not find an elegant way to do it , so instead , i am sending TCP