Default value updated
Hello:
Can anybody provide help to me in this situation:
I have a form for user to choose an item from Pop Up LOV, once the user press the button "choose_item" to submit , the default value "Yes"of the availability of that item will be change to "No"
How can i perform that operation?
Thanks and best regards
So, when the user clicks submit have a process:
UPDATE
table
SET
available='N'
WHERE
id=:P1_ID
Then when you select (for reports etc) then you just do:
SELECT
FROM
table
WHERE
available!='N'
That's if I'm understanding correctly what you are trying to achieve.
Similar Messages
-
Category attributes default values updating
Hi,
I'm developing an application that, upon upload of a file to the specified root folder(through the application), reads some values from a file, creates a folder structure based on those values, and moves the file in the bottom folder. Now, a predefined category should be attached to the file, to enable search by category attributes. My idea is to set the category as required on that bottom folder (or the first), and modify it's attribute default values, so that the file inherits them when moved in it. I have found mshannon's examples in some other thread ( Updating a document with category metadata using updateDocument(): error! ), the first one works only with files, not folders, and the second one doesn't work for me at all, I get an error:
javax.faces.el.EvaluationException: ORACLE.FDK.AggregateError:ORACLE.FDK.AggregateError
here is my code:
public static void updateAttributes() throws FdkException, RemoteException{
login();
FileManager fm = s_WsCon.getFileManager();
Item fajl = fm.resolvePath(prop.getProperty("userhome") + "/root folder/folder1/readme1.txt",
null);
long docID = fajl.getId();
NamedValue[] catInstAtr = new NamedValue[] {
new NamedValue("CUSTOM_138297", "changed value for att1"),
new NamedValue("CUSTOM_138299", "changed value for att2")
NamedValue[] catDef = new NamedValue[] {
new NamedValue(Options.UPDATE_CATEGORY_ID,new Long(139054)),
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, catInstAtr)
NamedValue[] docDef = new NamedValue[] {
new NamedValue(Options.CATEGORY_DEFINITION, catDef)
AttributeRequest[] reqAtr = new AttributeRequest[]{
new AttributeRequest(Attributes.DESCRIPTION, null)
fajl = fm.updateDocument(docID, docDef, reqAtr);
logut();
This example is (I think) only for updating on document level, but I could use a solution for folder-level updating, as I explained before. Can anyone help me?
Thanks,
PedjaPedja,
Here is my code to get category from Folder this is updated version from sample code TestCategory2.java
1. It will get the required category of a folder.
2. gets the internal category attribute names
3. get Category id if uploading file along with category attribute values OR
updating file and also updating previous category instance values..
package oracle.ifs.examples.content.testcases;
import java.util.Map;
import java.util.Properties;
import java.util.*;
// Facade Objects
import oracle.ifs.fdk.AttributeRequest;
import oracle.ifs.fdk.Attributes;
import oracle.ifs.fdk.FdkConstants;
import oracle.ifs.fdk.FdkErrorCodes;
import oracle.ifs.fdk.FdkException;
import oracle.ifs.fdk.FdkExceptionEntry;
import oracle.ifs.fdk.Item;
import oracle.ifs.fdk.Options;
import oracle.ifs.fdk.NamedValue;
import oracle.ifs.fdk.NamedValueSet;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import HTTPClient.HTTPConnection;
import HTTPClient.HTTPResponse;
import HTTPClient.HttpOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
// Web Services Managers
import oracle.ifs.fdk.CategoryManager;
import oracle.ifs.fdk.CommonManager;
import oracle.ifs.fdk.FileManager;
// Framework
import oracle.ifs.examples.content.fdk.FdkSession;
import oracle.ifs.examples.content.fdk.FdkUtils;
import oracle.ifs.examples.content.fdk.Managers;
import oracle.ifs.examples.content.fdk.constants.ItemAttributes;
import oracle.ifs.examples.content.fdk.constants.NamedValueConstants;
import oracle.ifs.examples.content.testcases.AbstractTest;
public class TestCategories3
implements ItemAttributes, NamedValueConstants
public TestCategories3()
public static void main(String[] args)
TestCategories3 tc3= new TestCategories3();
tc3.getCatinfo();
* This is where you write your test program.
public void getCatinfo()
log(this.getClass().getName()+": starting");
FdkSession session = null;
try
AttributeRequest[] requestedAttributes = null;
NamedValue[] sortOptions = null;
Map returnedAttrs = null, map = null;
log("\nAuthenticating as regular test user ...");
session = new FdkSession("http://xxx.com:8320/content/","anakkala","sample");
CommonManager commonM = Managers.getCommonManager(session);
CategoryManager categoryM = Managers.getCategoryManager(session);
FileManager fileM = Managers.getFileManager(session);
// save this attribute request so that it can be used later
AttributeRequest[] AR_CATEGORY_CONFIGURATION_ATTRIBUTES =
FdkUtils.newAttributeRequestArray(Attributes.CATEGORY_CONFIGURATION,
FdkUtils.newAttributeRequestArray(new Object[]
// Is the category configuration enabled
FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_ENABLED),
// Can the category configuration be overridden or is it final
FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_FINAL),
// What are the required categories for the category configuration
FdkUtils.newAttributeRequest(Attributes.REQUIRED_CATEGORIES,
// for the required categories ...
FdkUtils.newAttributeRequestArray(new Object[]
// What is the category classobject display name
FdkUtils.newAttributeRequest(Attributes.DISPLAY_NAME),
// get attributes inherited and introduced by category object
FdkUtils.newAttributeRequest(Attributes.METADATA_ATTRIBUTES,
// get full settings for each of these attributes
FdkUtils.newAttributeRequestArray(METADATA_ATTRIBUTE_ATTRIBUTES)
// Are there any attribute overrides for this category config?
FdkUtils.newAttributeRequest(Attributes.ATTRIBUTE_OVERRIDES,
// get full settings for each of these attribute overrides
FdkUtils.newAttributeRequestArray(ATTRIBUTE_OVERRIDE_ATTRIBUTES))
log("\nLooking up folder /d-rco/C1/L1/folder1 ...");
// convert attribute request map to AttributeRequest[]
requestedAttributes = AR_CATEGORY_CONFIGURATION_ATTRIBUTES;
Item folder =fileM.resolvePath(
"/d-rco/C1/L1/folder1",
requestedAttributes);
log("folder id is="+folder.getId());
log("\nProcessing requested attributes - goal: generate override ...");
//returns a map
returnedAttrs = FdkUtils.getAttributesMap(folder);
Item categoryConfig = (Item)
returnedAttrs.get(Attributes.CATEGORY_CONFIGURATION);
returnedAttrs = FdkUtils.getAttributesMap(categoryConfig);
// is CategoryConfiguration enabled?
Boolean ccEnabled = (Boolean) returnedAttrs.
get(Attributes.CONFIGURATION_ENABLED);
// is CategoryConfiguration final? false=subfolders can override
Boolean ccFinal = (Boolean) returnedAttrs.
get(Attributes.CONFIGURATION_FINAL);
// what are the attribute overrides for this category configuration
log("\nAttribute overrides ...");
Item[] attributeOverrides = (Item[]) returnedAttrs.
get(Attributes.ATTRIBUTE_OVERRIDES);
FdkUtils.log(attributeOverrides);
// what are the requred categories for this category configuration
log("\nRequired categories ...");
Item[] reqCategories = (Item[]) returnedAttrs.get(Attributes.REQUIRED_CATEGORIES);
FdkUtils.log(reqCategories);
log("After printing required categories");
if(ccEnabled.booleanValue() && !ccFinal.booleanValue()
&& reqCategories != null && reqCategories.length >= 1)
// Folder /<domain>/<basecontainer>/L1/F3.EC has an enabled category
// configuration that can be overridden and has required categories
// present ...
Item category = null;
for (int i=0; i < reqCategories.length; i++)
returnedAttrs = FdkUtils.getAttributesMap(reqCategories);
log( "xxx name="+((String) returnedAttrs.get(Attributes.DISPLAY_NAME) ));
if ( ((String) returnedAttrs.get(Attributes.DISPLAY_NAME)).
equals("BG_Serv_Req"))
category = reqCategories[i];
break;
log("category id="+category.getId());
if (category != null)
NamedValue[] internalCategoryAttrs = null;
try {
internalCategoryAttrs =getInternalCategoryAttrNames("BG_Serv_Req",session);
}catch(Exception e)
log("error getting internal names");
e.printStackTrace();
log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[0].getValue());
log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[1].getValue());
NamedValue[] categoryInstanceAttributes = new NamedValue[] {
// use the internal attribute name for all attributes
new NamedValue((String)internalCategoryAttrs[0].getValue(), "XNXNXNXN 234"),
new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNKKSKSK 1234")
NamedValue[] categoryDef = new NamedValue[] {
// the id of the category object class for which this new category will be an
//instance of
new NamedValue(Options.CATEGORY_CLASS_ID, new Long(category.getId())),
// the updated values of the category instance
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
String sourceFile="test.doc";
String folderPath = "C:\\upload";
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
Item doc = fileM.resolveRelativePath(folder.getId(),sourceFile, requestedAttributes);
log("START ORACLE TEST CODE FROM TAR");
// this will get the category instance id
AttributeRequest categoryAR = new AttributeRequest();
categoryAR.setAttributeName(Attributes.CATEGORIES);
AttributeRequest[] attrRequests = new AttributeRequest[]
{ categoryAR};
Item myDoc = commonM.getItem(doc.getId(), attrRequests);
NamedValue[] requestedAttributesNV = myDoc.getRequestedAttributes();
int length = requestedAttributesNV == null ? 0 :
requestedAttributesNV.length;
Item[] itemCategories = null;
log("length="+length);
for (int i = 0; i < length; i++)
log("requestedAttributesNV[i].getName()="+requestedAttributesNV[i].getName());
if(requestedAttributesNV[i].getName().equals(Attributes.CATEGORIES))
itemCategories = (Item[]) requestedAttributesNV[i].getValue();
length = itemCategories == null ? 0 : itemCategories.length;
log("length="+length);
long categoryInstanceId = 0;
for (int i = 0; i < length; i++)
log("Category instance " + itemCategories[i].getName() + " has id " +
itemCategories[i].getId());
categoryInstanceId = itemCategories[i].getId();
log("END ORACLE TEST CODE FROM TAR");
/* If the document does not exist in OCS */
if (doc == null) {
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
NamedValue[] nvdoc = FdkUtils.newNamedValueArray(
new Object[][] { { Attributes.NAME,sourceFile} }
Item def = fileM.createDocumentDefinition(nvdoc,requestedAttributes);
int uploadStatusCode = uploadContent(
session,
getSampleFileStream(sourceFile,folderPath),
(String) FdkUtils.getAttribute(def,Attributes.URL)
log("Upload Status to definition file: "+uploadStatusCode);
nvdoc = FdkUtils.newNamedValueArray(
new Object[][]
{ Attributes.NAME,sourceFile},
{ Options.USE_SAVED_DEFINITION, new Long(def.getId())},
{ Options.DESTFOLDER, new Long(folder.getId()) },
// apply category instance informationnew
{ Options.CATEGORY_DEFINITION, categoryDef }
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
doc = fileM.createDocument(nvdoc,null,requestedAttributes);
}else /* if document already exist in OCS */
log(sourceFile+" file exists so updating ...");
int uploadStatusCode = uploadContent(
session,
getSampleFileStream(sourceFile,folderPath),
(String) FdkUtils.getAttribute(doc ,Attributes.URL)
log("uploadStatusCode="+uploadStatusCode);
FileInputStream fi= getSampleFileStream(sourceFile,folderPath);
log("category id using in update="+ category.getId());
NamedValue[] updatecatdef = new NamedValue[] {
//new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(category.getId())),
new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(categoryInstanceId)),
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES,
new NamedValue[] {
new NamedValue((String)internalCategoryAttrs[0].getValue(), "AH234 V2"),
new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNHGZ12 V2")
NamedValue[] nv = FdkUtils.newNamedValueArray(
new Object[][]
{ Attributes.NAME,sourceFile},
{ Attributes.DESCRIPTION,"Sample file"},
//{Options.CONTENTSTREAM, fi},
{ Options.CATEGORY_DEFINITION, updatecatdef }//Newly added for category upload
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
// THIS IS WHERE WE ARE GETTING ERROR
fileM.updateDocument(doc.getId(),nv,requestedAttributes);
System.out.println("doc = fm.updateDocument is complete ........." );
} // end if (Document Confidentiality category present)
} // end if category configuration enabled / overridable etc
catch (FdkException fe)
FdkUtils.log(fe);
fe.printStackTrace();
catch (Exception e)
// java.net.MalformedURLException;
// java.rmi.RemoteException;
// javax.xml.rpc.ServiceException;
// org.apache.axis.AxisFault
log("Fatal exception occurred in run():");
e.printStackTrace();
finally
if (session != null)
session.disconnect();
log("\n"+this.getClass().getName()+": ending");
private FileInputStream getSampleFileStream(String filename,String path)
throws FileNotFoundException
FileInputStream stream = null;
if (filename != null && filename.length() >= 1)
if (path.length() >=1 && !path.endsWith("/"))
path += "/";
stream = new FileInputStream(new File(path+filename));
return stream;
public int uploadContent(
FdkSession session,
InputStream inputStream,
String destinationURL
throws Exception
int statusCode = -1;
if (inputStream == null) return statusCode;
HTTPConnection conn = null;
try
URL url = new URL(destinationURL);
conn = session.getHttpConnection(url);
byte[] buffer = new byte[8192];
int count=0;
HttpOutputStream outputStream = new HttpOutputStream();
HTTPResponse response = conn.Put(url.getFile(), outputStream);
try
while ((count = inputStream.read(buffer)) != -1)
outputStream.write(buffer, 0, count);
finally
outputStream.flush();
outputStream.close();
statusCode = response.getStatusCode();
finally
if (inputStream != null)
inputStream.close();
if (conn != null)
conn.stop();
conn = null;
return statusCode;
// Handle the response. Note that a successful response may not be
// 200, but may also be 201 Created, 204 No Content or any of the other
// 2xx range responses.
public void log(String s)
System.out.println(s);
public NamedValue[] getInternalCategoryAttrNames(String categoryName,FdkSession session) throws Exception
NamedValue[] returnNV = null;
Map attmap = new HashMap();
attmap.put(Attributes.METADATA_ATTRIBUTES,
FdkUtils.newAttributeRequestArray(
new String[] { Attributes.ATTRIBUTE_NAME,
Attributes.DISPLAY_NAME }));
AttributeRequest[] request = FdkUtils.getAttributeRequestArray(attmap);
Item cat = FdkUtils.getCategoryObject(session, null, categoryName, request);
log("inside method cat id="+cat.getId());
/** ANAKKALA START **/
NamedValue[] catNV = cat.getRequestedAttributes();
if( catNV != null && catNV.length >0)
for (int i=0; i<catNV.length; i++)
if(catNV[i].getName().equals("METADATA_ATTRIBUTES"))
//log("** CatNV.getName="+catNV[i].getName()+" value="+catNV[i].getValue());
Item[] meta = (Item[]) catNV[i].getValue();
log("meta length="+meta.length);
returnNV = new NamedValue[meta.length];
for (int j=0; j<meta.length; j++)
log("--Item getname="+meta[j].getName()+" value="+meta[j].getId()+" gettype="+meta[j].getType()+" gettypedesc="+meta[j].getTypeDesc());
returnNV[j] = new NamedValue(meta[j].getName(),meta[j].getName());
NamedValue[] metaNV = meta[j].getRequestedAttributes();
log("---metaNV length="+metaNV.length);
for(int k=0; k<metaNV.length; k++)
log("------metaNV.getName="+metaNV[k].getName()+" value="+metaNV[k].getValue());
/** ANAKKALA END **/
//NamedValue[] ret = null;
return returnNV; -
Default value updation in table
Hi,
I want to update default value 'X' in ztable field through report.How to set the field value always containing X only.Hi Anitha,
Can you a bit clarify your question ? - I understand if the ZTable field value is 'X' you need to update it right ?
Then , fetch the entries of the tables for which the field values is 'X' and modify the field value as per the business requirement and update the same table. You can use the work areas while updating the ZTable.
Thanks,
SK -
Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
Thanks.Hi Anagha,
So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
1. Add buisness rule which can set a default value when Date = NULL/Blank
2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
3.Go to that table and add a after update trigger like
if uda_<entityid>_<attributeid(Date attribute)> = default value
update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
I will check on this too from my side.
By the way AFAIK i dont think so calendar control integration is possible . -
Default value in LOV field in Create and Update page in OAF
Hi All,
I am unable to default LOV field in Create and Update page in OAF.
I tried in below way :
OAMessageLovInputBean lovBean1 = (OAMessageLovInputBean)webBean.findChildRecursive("AAA");
But I am getting developer mode exception, so please guide me how i can set the default value for create and update page instead of using code in process request method in controller.
ThanksHi,
1) In case of create, you can default the value either in EOImpl or in AM while initializing the row:
//in EOImpl
public void create(AttributeList attributeList)
super.create(attributeList);
setXXAttribute(<value>);
//in AM, VO new row initialization :-
VOImpl VO = getVO1();
VO.setMaxFetchSize(0);
VORowImpl row = (VORowImpl)VO.createRow();
row.setXXAttribute(<value>);
VO.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
2) In case of update, execute the VO (also set the where clause if required) in PR method of update page.
--Sushant -
BAPI_PO_CHANGE taking default values for zaro value Condition update
Hi,
I am using std BAPI_PO_CHANGE for line item condition type value update.
I want to update the condition value with zero, however it is picking some default value 10 $.
I want to know from where it is picking that value.
wa_item-po_item = ls_po_detail-line_item_number.
wa_item-final_inv = c_x.
APPEND wa_item TO lt_item.
wa_itemx-po_item = ls_po_detail-line_item_number.
wa_itemx-po_itemx = c_x.
wa_itemx-final_inv = c_x.
APPEND wa_itemx TO lt_itemx.
wa_cond-itm_number = ls_po_detail-line_item_number.
wa_cond-cond_type = ls_po_detail-condition_type.
wa_cond-cond_value = ls_po_detail-unit_price .
wa_cond-currency = c_curr.
wa_cond-change_id = c_insert.
APPEND wa_cond TO lt_cond.
wa_condx-itm_number = ls_po_detail-line_item_number.
wa_condx-itm_numberx = c_x.
wa_condx-cond_type = c_x.
wa_condx-cond_value = c_x.
wa_condx-currency = c_x.
wa_condx-change_id = c_x.
APPEND wa_condx TO lt_condx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wa_po_no-ebeln
TABLES
return = lt_return
poitem = lt_item
poitemx = lt_itemx
pocond = lt_cond
pocondx = lt_condx.Hi,
Did you check what is there in ls_po_detail-unit_price ??
Check this links might help you.
Re: BAPI_PO_CHANGE not updating Condition Price
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
Regards and Best wishes. -
MySQL Default Values with Updates
This is a bit off topic, I'm hoping someone can help me here so I don't have to join the MySQL email list.
I would like to update a row in a table to use the mysql default values. So if TableA has FieldA which had a default value of 1, and now that value is 2, I would like to change this back to 1. Is there an easy way to do this?
Is there a command in MySQL I can use? Something like:
update TableA set FieldA = DEFAULT
Thanks for your time.
TysonNot according to the documentation (of version 3, anyway). You could delete the record then insert it, not mentioning the field you want to set to default.
-
Default values for Insert and Update
What is the best way to default the current sysdate for a date column on a table when doing an insert or update through a form? And related to this, what is the best way to default the current user (APP_USER) for a varchar2 column when doing an insert or update through a form?
For these columns, I want to display them on a report, but they should be hidden on the form because I would like to have the app default the values to sysdate and APP_USER. However, when I have tried to use the table default values in "user interface defaults" and using either :APP_USER or &APP_USER or SYSDATE, it only shows this literal value on the form (item is not hidden while I debug this). It does not show the actual value I'd want, such as "user1". Does this make sense?
Thanks for your help.
-ReidI think triggers are the best device.
Scott -
After FF update the page setup is gone and back to default values
we use FF as default browser for our web application (desktop), delivering it as default browser on the hardware we deliver and as the advised web browser for desktops.
The very annoying thing is that after updates to newest versions (it lately happened with update to FF 24) the page settings are not kept.
Instead they are back to the default values as if it was a new installation. We use the page settings to have clean prints. That is: without disturbing headers and footers and with margins to 0 (zero).
I 've been searching for a while why this happens and could find a solution. As customers are vigorously complaining now, we have to reconsider our browser policy.0.03937" isn't that 1mm?
Those "size" values will be displayed in inches if the Letter / Legal / other American paper sizes are set, and in mm for the "A" paper sizes used elsewhere. So if someone would be using A4, a 1mm setting would appear as 1.0 - not 0.03937 .
From what I have seen, only 2 digits after the decimal point should appear. Those ''(or similar)'' with 15 digits has been mentioned frequently here as occurring with broken printer settings.
As far as "why" with a fresh installation, I have no idea. Any chance your company is using a custom Firefox configuration file (cfg) to set your own default prefs? And those old prefs are configured as the default for all your installations? ''One way to check that would be to create a new Profile and see if those prefs appear automatically in the new Profile before printing anything. No printing prefs should appear as "user set" - or maybe only those??''
Until a few weeks ago "we" weren't aware that those prefs had changed with Firefox 6.0. This support article - https://support.mozilla.org/en-US/kb/fix-printing-problems-firefox - needed to be edited, after a user mentioned that he didn't have the ''older'' preferences and that article was misleading. I started investigating with every version from Firefox 2.0 up to Firefox (Nightly) 27.0, and discovered those prefs had been changed in Firefox 6.0 over 2 1/2 years ago. I had a number of other support contributors verify my findings in the Contributors forum; this article was edited as a result.<br /> -
Hi Team,
Am using BULK INSERT Format file option to load data into table from .txt file here am facing an issue i.e ibased on input file i need to insert default values to some columns of table so we can not declare it on table level, Can we give default values in
format file ? if we can give how it is ? or Any alternate possibilities to this scenario instead of BULK INSERT ?
Thanks,
SudhakarThanks for your response, here i don't have any rights to change table structure the table is created by different team, my work is to load data from file to table. Is there any chance to supply default values by*XML* format file instead of *.fmt* file
please let me know the possibility.
Again, no. If you want to supply default values that are not present in DEFAULT constraints in the table definition, you will need to write your own code. There are plentyfull of options, and I have mentioned some already.
Here are some more:
* Table-valued parameters, see here for examples:
http://www.sommarskog.se/arrays-in-sql-2008.html
* Use BULK INSERT to load data to a staging table, and then apply the default values when you copy from staging to target.
Erland Sommarskog, SQL Server MVP, [email protected] -
How to load a default value in to a column when using sql loader
Im trying to load from a flat file using sql loader.
for 1 column i need to update using a default value
how to go about this?Hi!
try this code --
LOAD DATA
INFILE 'sample.dat'
REPLACE
INTO TABLE emp
empno POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
ename POSITION(06:15) CHAR,
job POSITION(17:25) CHAR,
mgr POSITION(27:30) INTEGER EXTERNAL NULLIF mgr=BLANKS,
sal POSITION(32:39) DECIMAL EXTERNAL NULLIF sal=BLANKS,
comm POSITION(41:48) DECIMAL EXTERNAL DEFAULTIF comm = 100,
deptno POSITION(50:51) INTEGER EXTERNAL NULLIF deptno=BLANKS,
hiredate POSITION(52:62) CONSTANT SYSDATE
)-hope this will solve ur purpose.
Regards.
Satyaki De. -
SQLLDR - how to set a default value for an empty string
I'm using SQLLDR to load data from a flat file on Oracle 10g 10.2.0.4 EE, Linux RHEL 4 update 6. Seems like my question is simple, but darned if I can't find the solution.
My source file (comma delimited extracted form a different RDBMS) has some (not all) rows where the output for a string is "", and not NULL. How do I check for empty string and add a default value in the control file? The target column is non-nullable
Here's my current control file - however, the column attributeName where sometimes the source record is "" does not get evaluated as NULL.
load data
infile 'mydata.del'
badfile 'mydata.bad'
discardfile 'mydata.dsc'
into table mydata
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
(l_metadata,
company,
className,
attributeName "decode(:vc_attributeName,null, 'none')",
attributeDefault)
{code}
When I tried decode with "", I received the following error:
{code}SQL*Loader-350: Syntax error at line 11.
Expecting "," or ")", found ", 'none')".
attributeName "decode(:vc_attributeName,"", 'none')", {code}
This does not work either:
{code}
load data
infile 'mydata.del'
badfile 'mydata.bad'
discardfile 'mydata.dsc'
into table mydata
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
(l_metadata,
company,
className,
attributeName NULLIF attributeName = BLANKS ,"decode(:vc_attributeName,null, 'none')",
attributeDefault) I get the following in the log:
Table COMPANYMETADATA, loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
L_METADATA FIRST * , O(") CHARACTER
COMPANY NEXT * , O(") CHARACTER
CLASSNAME NEXT * , O(") CHARACTER
ATTRIBUTENAME NEXT * , O(") CHARACTER
NULL if ATTRIBUTENAME = BLANKS
SQL string for column : "decode(:attributeName,null, 'none')"
ATTRIBUTEDEFAULT NEXT * , O(") CHARACTER
Record 1: Rejected - Error on table COMPANYMETADATA, column ATTRIBUTENAME.
ORA-01400: cannot insert NULL into ("SRV5"."COMPANYMETADATA"."ATTRIBUTENAME")
{code}
Any help is appreciated -
Edited by: kpw on Feb 9, 2009 11:10 AMHello,
I just loaded following data successfully in my_data table using the same control file I posted. Yes it will evaluate "" as null and replace with none, remember in control file you have this option, "optionally enclosed by '"'.
#my_data.dat
"myname1", "attribname1"
"myname2", "attribname2"
"myname3", "attribname3"
"myname4", ""
#my_data.ctl
load data
into table my_data
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
my_name char(30),
vc_attributeName "decode(:vc_attributeName,null, 'none', :vc_attributeName)"
{code}
Here is the output log file
{code}
Control File: my_data.ctl
Data File: mydata.dat
Bad File: mydata.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table MY_DATA, loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
MY_NAME FIRST 30 , O(") CHARACTER
VC_ATTRIBUTENAME NEXT * , O(") CHARACTER
SQL string for column : "decode(:vc_attributeName,null, 'none', :vc_attributeName)"
Table MY_DATA:
4 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 18560 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 4
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Mon Feb 09 18:17:35 2009
Run ended on Mon Feb 09 18:17:36 2009
Elapsed time was: 00:00:00.98
CPU time was: 00:00:00.10
{code}
Hope this helps clearing your dobuts
Regards -
Text Box/Area and default value
Is it possible to display a Text Box (or Text Area) in a Form page assigned a default value and prevent the user to change it? I need to register the actual user submitting the form. I have done this in WebDB22 Text Box and #user function but in Portal 3.0.6.6.5 it seems to be impossible to prevent the user to change the text value. Deselecting Validation Options, Updatable does not seems to help. Why?
The equivalent of Webdb #user function in portal is #portal30.wwctx_api.get_user.
If you specify this as a default value for a field it will be the same as #user. Also, "inseratble" and "updatable" checkboxes control the presence of a column in INSERT and UPDATE statements, so unchecking any of those checkboxes will remove the column from a respective statement.
Thanks,
Dmitry -
Does GTC generate default value for Password attribute.??
I am using GTC as trusted source reconciliation.
My doubt is if I don’t map the password attribute does it generate default value to the password attribute in user form??
I have a random password generator in pre-insert, first i tried as below which didn't work later after updating it worked fine.
IF (password=null)
Generaterandampassword
SetPassword= Generaterandampassword
If i use adapter as above it not generating random password. i see that password as 'temp' to all the users.
I am thinking gtc generates a value to password filed even if we don't pass any value... am i right?? Please let me know..
Thanks..
Edited by: IDMuser19 on Aug 17, 2010 10:30 AMHey,
See if this helps.......
http://www.oracle.com/technology/obe/fusion_middleware/im1014/oim/obe12_using_gtc_for_reconciliation/using_the_gtc.htm
Regards,
Sunny Ajmera -
SRM 4.0- How to set the default values for product type (01) only for SC
The radio button Service should not be visible.
Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
How to set the default values for product type (01) only for SC
We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
Here we can set defalut value 01 but it is not correct one since same search help is using several places.
We need to limit the search help results only for SC.
Kindly help out me ASAP.The easiest way to set defautl values is to edit the batch class.
Goto the characteiristic and go to update values.
In here you probably have something like 0 - 100 as a spec range.
On the next line enter the default value within this range. At the end of the line, click in the box in the column labelled "D". This indicates the defautl value for the characteristic.
If you need to you can do this in the material classification view as well.
Just to be clear, these values will only show up in the batch record. You can not have defautl values in resutls recording screens.
FF
Maybe you are looking for
-
Site crashes when trying to open a music file
On this site for about four months or more, when I try to open most music files, the site instantly crashes. The music software is called Scorch. == URL of affected sites == http://www.sibeliusmusic.com/
-
Reversal of reversals not permitted in case of returns&payments FICA (ISU)
We are constantly facing a problem on which we would like to have comments from you. Problem:- A payment comes and clears a receivable. A return is posted for the payment and the user later realizes that the return was posted incorrectly. Now, a reve
-
BPC Detail error/reject log not created in the PrivatePub/user/temp folder
Hi, We have a custom import package that imports data from a comma seperated txt file in to BPC. If all the data members in the data file are valid dimension members the package is successful and the package log file is created in the PrivatePub/user
-
Viewing Stylesheet in Design view
HI, Two of us are working on the same website, sharing the same files. In our site set up we both are using the same shared drive with the files. When I view a page in design view it looks fine. When the other person views the page in design view i
-
Can I retime the audio by a fraction of a frame?
I recorded Audio separately on a digital voice recorder and after 11 minutes there is a sync drift of 1 - 2 frames. By using the Retime Editor I can drag the audio the necessary frame to get it almost spot on. I seem to recollect hearing that audio c