It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I'm new to Oracle. I need to add a varchar2 field to an existing table which is 50 bytes in length.
I right clicked on the table like this:
...Then I arrive at this field:
I do not know what to do here. I was expecting to see a 'type', 'size'and 'units' prompt like in the schema-design-GUI view (where I would enter ~varchar2, 45, and bytes respectively). I don't know what to make of the precisions and scale fields; I thought those were for numbers.
You're adding a column. Give it a name ("Column Name"), a type (select from "Data Type" drop-down), and a length ("Precision"). If it's a NUMBER type, you can give it a scale (place to the right of the decimal). In your specific example, give your column a name, leave data type drop-down at VARCHAR2, and specify 50 for precision.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 months ago.
Improve this question
I was wondering if you can help with below
I need to write have a conditional column for 3 month prior to review date
So, I have "review dates" column which contains review dates, and need something along the lines of "IF 3 months left before "Review Date" them then ALERT, otherwise NO ALERT"
Ideally to have rolling code so I don't have to alter it manually every time dates change
Any help will be greatly appreciated
Not sure how to approach
Yeap, I guess you can! but compare against what ? Today's date? If It is so, then Please create a new calculated column, and try this code! let me know If It is what you are looking for!
Logical_Result =
VAR NowIsTheTime =
NOW ()
RETURN
IF (
DATEDIFF ( YourTable[ReviewDate], NowIsTheTime, MONTH ) < 3,
"ALERT",
"NO ALERT"
)
If we test it on a table as column, It gives us:
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a table that contains an xml document stored as a clob.
TabA
----
Name varchar2(30) (PK)
Definition clob
other attributes
Note: "Definition" is the clob column that stores the XML.
Typical data volume: 1500 rows.
My requirement is to do some kind of recon and only process those rows on a daily basis that have undergone change to the XML and process those rows that have come in as new.
Identifying rows that came in new and processing only them is easy and can be done with "minus" on the name.
But, is there a good way to identify the XMLs in the existing rows that have undergone change ?
For eg: If an element within an XML has been removed or its attributes changed from the previous day, then I should be able to process that "Name" row.
Example of the typical XML in the table:
<?xml version="1.0" encoding="UTF-8"?>
<dataMart asOfDriver="EFFECTIVE_DATE" chainedData="false" classification="" convertUsingFxRate="false" coreEntityIndicator="false" createdAt="2011-12-22T17:41:11.002" createdBy="user1" description="" entitled="false" entitlementDriver="false" hierarchicalFlag="false" innerJoin="false" intent="Intermediate" lastUpdatedAt="2012-07-26T16:11:42.424" lastUpdatedBy="p459807" martType="SPOT" martUsage="Persistent" ownerRole="Meta Model SSC" preAggregatedData="false" referenceDataIndicator="false" retention="" rollupFunction="" staticAggregationOnly="false" status="ACTIVE" tags="">
<name>Name1</name>
<sources>
<source isDefault="false" name="S1"></source>
</sources>
<rowType-mapping>
<rowType identifier="0">
<element alias="E1" name="E1" source="" sourceAlias="" sourceType="system" trackSource="false">
<description localDescription="false"></description>
<validationRule type="None"></validationRule>
<mapping columnName="E1" function="" tableName="TABA"></mapping>
<Opaque />
</element>
More element tags
...<element> </element>
</rowType>
</rowType-mapping>
<parameters>
<parameter filter="N" name="P1">
<![CDATA[PM]]>
</parameter>
</parameters>
</dataMart>
Any pointers would be much appreciated.
I would recommend using trigger to log changed items to another table. Process what ever was logged in the log table for a particular day.
On how to compare two XMLs refer to this
It would only be possible if you keep a record of your previous (old) xml in a log or temp table before updating the New XML.
By the looks of the question, it seems that you not only want to compare the XML with its previous version but also find out "what has changed?".
A good way to compare and find what has changed is to do a diff between the old and new XML. Here is a package which does a diff on CLOB. See if you can use it to fit your needs.
Or
You can convert the CLOB to Varchar using dbms_lob.substr( clob_column, for_how_many_bytes, from_which_byte ); and then do something like below to do a diff on the two new VARCHARs-
SELECT LTRIM(RTRIM(TRANSLATE('abcdef','abc',RPAD(' ',LENGTH('abcdef'))))) val
FROM dual;
VAL
----------
def
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am using this LINQ query
var db = new XYZ();
var product = (from cp in db.CatalogProducts
where cp.ProductID == productId
select cp).FirstOrDefault();
Running this query gives me an error
Invalid column name 'Cracker Cruncher'.
Invalid column name 'crushing torque'.
Invalid column name 'Slicing velocity'.
Can any one help me in this matter?
Gautam
Issue Resolved.. Just now I checked that Some1 has made drastic changes to DB without informing me.. Thanks for keeping up with me
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I try to import 90 records from a .txt-file into a table in: Administration > Administration Area > Periodic > Data export/import > Definition Groups
I've made a new Definition Group, set the name and type (Custom) of it and Selected the Default file name.
In the Table setup I deleted all records and selected the table where I want to import the records, Import status = Import.
After clicking on the import-button in the Definition group-window I'm getting error-messages for every record and no data is imported:
ERROR message sais: Cannot create a record in ZIP/postal Codes (CLIAddressZipCode).
ZIP/postal Code: , . The record already exists.
EXAMPLE OF A RECORD:
1440;Les Frèchaux;175557;BRAINE-LE-CHÂTEAU
The 1st field is the zipcode, the 2nd is the street, the 3rd is the ID, the 4th field is the city.
UPDATE:
I will try to add an if-statement: to check if the record already exists, if not the record will be inserted.
Check for unique indexes in table CLIAddressZipCode (this is not a standard table).
This problem arises when your input contain two records which have the same values in the index fields.
The second record will throw the error when inserted saying: The record already exists.
It's probably a related table that it's inserting into and/or a blank '' record at the very beginning/end. CLIAddressZipCode is custom. Perhaps you're inserting into AddressZipCode, and there is code that will insert into CLIAddressZipCode or vice versa and one of those tables contains the duplicate data.
Could the data be concatenated in some way? eg 12345 is concatenated to 1234 which is the same as 1234.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 12 years ago.
I have a Generic List of objects. Those objects have 4 properties. 3 are set by LINQ earlier in the app. Is it possible to insert the 4th property into the existing List using LINQ to SQL without looping through each object in the List?
EDIT
For reference sake, one of the first properties is an ID on the record, so I will know with each object in the List what the 4th property should be in the database, but I was hoping to do it without a For Loop as the List might be rather huge.
I'm not sure I 100% understand, but in your LINQ query you could do something like this:
var result = from r in Repository
select new MyType()
{
Value1 = r.Value1,
Value2 = r.Value2,
Value3 = r.Value3,
Value4 = "MyValue",
}
Untested, but the general idea should work.