Create hash value for clob column ?
Hi,
does anybody know a way to calculate a hash value for a clob column (9i) ?
DBMS_UTILITY.GET_HASH_VALUE could only handle varchar2(4000).
Thank you!
Regrads
Michael
Message was edited by:
mseiwert
I can't reproduce it on my 10.2.0.4.0. CTL file:
load data
INFILE *
Replace into table samp
fields terminated by ","
trailing nullcols
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
BEGINDATA
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"Loading:
SQL> Create table samp
2 (
3 no number,
4 col1 clob,
5 col2 clob
6 );
Table created.
SQL> host sqlldr scott/tiger control=c:\temp\samp.ctl log=c:\temp\samp.log
SQL> select * from samp
2 /
NO
COL1
COL2
1
asdf
assasadsdsdsd"sfasdfadf"sdsdsa,ssfsf
2
sfjass
dksadk,kd,ss"dfdfjkdjfdk"sasfjaslaljs
NO
COL1
COL2
SQL> SY.
Similar Messages
-
How to set default values for boolean columns
I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
I've tried to set default value at column level:
<Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
<Default>TRUE</Default>
</Field>
and at content type level:
<FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
But in any case, when i create a new item with this content type, default value is applied.
Can anyone tell how to set default values for boolean columns?
Thanks in advance,
Regards,
SergioIn the field definition you can set
<Default>1</Default>
or
<Default>0</Default>
How to set the default value Null? -
Limitation for CLOB columns? - ORA-01704: string literal too long
Hello!
I'm trying to update a CLOB column with more than 35000 characteres, but I get "ORA-01704: string literal too long".
The code:
declare
l_clob clob;
begin
update test set test = empty_clob()
WHERE ID = 1
returning test into l_clob;
dbms_lob.write( l_clob, length('A...here 35000xA...A'), 1,'A...here 35000xA...A');
end;
Is there any limitation for CLOB columns?
Thanks for help.
Danieluser605489 wrote:
32768 characteres :)Actually it's 1 character less than 32K...
*32767*
SQL> declare
2 v_vc varchar2(32768);
3 begin
4 null;
5 end;
6 /
v_vc varchar2(32768);
ERROR at line 2:
ORA-06550: line 2, column 17:
PLS-00215: String length constraints must be in range (1 .. 32767)
SQL>I guess it comes from a legacy thing where signed words (2 bytes) are/were used to represent a value. As the most significant bit of the word is used to represent the sign of the number the range goes from -32768 to 32767. -
Calling a user defined function as default value for a column
Hi All
Can we call a user defined function as default value for a column ??
for example:
create or replace function test1 return number is
begin
return 10;
end;
create table testt
(id as test1,
name varchar2(20));
getting error:
Error at line 1
ORA-02000: missing ( keywordThanks
Ashwani
Edited by: Ashwani on Jan 16, 2012 1:19 AMHi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
Regard
Helios -
Generate Sequential values for a column
Hi,
I had a column in named 'ID' in the block of my form. I want to generate sequential values for the column without using sequence. Suppose if the table does not have any data it has display the starting value what i am providing.(ex. 101).If the data is there in the table If i am executing the query in the last null record it has to show the maxvalue+1 for that column. where can I write the code to get this logic? How to write the code? Can any body please solve my problem?
Thanks in advance
user1Why don't you want to use a sequence? Do the ORDID values have to be sequential without any gaps in between?
If so, this requirement is quite hard to achieve in multi-user environment.
Some approaches:
Select the next available value from the database when creating a new record , e.g. in the WHEN-CREATE-RECORD-Trigger:
DECLARE
CURSOR crMax IS
SELECT NVL(MAX(ORDID), 0)+1
FROM ORD;
BEGIN
OPEN crMax;
FETCh crMax INTO :ORD.ORDID;
CLOSE crMax;
END;Pros: The user can see the new value when he starts entering the data.
Contras: When another user uses the same form to create a new record between the point of time user 1 starts entering the record and the point of time he saves, the same number will be taken again which will fail on insert for the second user (i assume there is a Unique Key on ORDID).
Result: This approach is not suitable in a multi-user environment.
Second approach:
Use the same logic as in approach 1, but select the next available number in the PRE-INSERT-trigger of the block:
Pros: The problem of approach 1 with two users getting the same number gets much more unlikely, for in general the COMMIT goes quite short after the PRE-INSERT has fired, so there will only be problems if both users save at the same moment.
Contras: Problem with duplicate numbers can still occur iunder special circumstances. The number is not shown until the Insert is issued against the database.
Result: This approach is possible, but you have to decide if the restrictions are bearable for your situation.
Further approaches:
Create a "Number table" either with just one record and one column which contains the next suitable number (lets say TAB_ORDID with column NEXT_ORDID) or with a number of records containing the next suitable numbers.
Then with the usage of SELECT FOR UPDATE you can lock a record, take the number from it and either update the row to the next value (one row apporach)or delete the row retrieved (multi row approach). Both cases require some more complex logic for retrieving the next number and can cause some trouble in multi-user-environments (ending up in all users who want to create records waiting for the one user who started and did not save correctly) if the locks are not handled correctly. -
Hide row values for certain column in GRR2
Hi Experts,
Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
Could somebody let me know is there an way to get this addressed.
Thanks in advance
Best Regards,
gjHow was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
I have a smiliar issue of hiding certain rows for few columns. -
Default value for a column in Table Control
Hi friends, can i set dinamcally a default value for a column in table control?, this column is check type. This default value must appear in empty rows,
thanksADD A MODULE AS Module yyyy In ur PAI.
as
In PAI.
LOOP at itab.
Module YYYY
ENDLOOP.
Module YYYY.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ITAB-VAL.
ITAB-VAL = 'XXXXXXXX' "(DEFAULT VALUE)
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
End module.
*note
make this event work only if the previous column is filled okay.
the display will be in display mode on the screen as screen-input = 0.
see that in the table control u can get the table field for all the rows even though you are processing on some fields .
so what u do is make that particular filed masked(no i/p field and populate the field that will be better instead of populating all the columns okay.
hope this helps you out ,
regards,
vijay. -
Default Value for a column in matrix
Hi,
How to set default value for a column in matrix which is of type combo(Yes/No).
The cell has combo in it
ManojHi Manoj,
The column is set as combo. Now you need to tell SBO what constituates a Y or N. In my example my Column "Col6" must display Yes if the RENTED column = 1 and No if the RENTED column = 0. (I'm obviously using a datasource to tie the data to the matrix)
oMatrix = frm.Items.Item("YourMatrixID").Specific
oColumns = oMatrix.Columns
oColumn = oColumns.Item("Col6")
oColumn.DataBind.SetBound(True, "@VIDEO", "U_RENTED")
oColumn.ValOn = "1"
oColumn.ValOff = "0" -
Setting default values for a column
Hi,
I have a table having some default values for the columns. I am using a PreparedStatment to insert into this table. For null values I am using setNull(..) method but the default values given for the columns are not inserted for null values.
eg: INSERT INTO TEST VALUES(?,?);
where TEST table contains two columns col1 and col2 with default values 'AA' and 'BB' respectively. My requirement is to make sure that when null values are specified for the columns then the database default should be picked up. using setNull(..) method doesn't help.
Thanks in advance.
GyanDefault value for a column can be picked up from DatabaseMetaData class.
The below snippet shows that: -
DatabaseMetaData metaData = connection.getMetaData();
ResultSet resultSet = metaData.getColumns(null, null, "TEST", "COL%");
while ( resultSet.next() )
String defaultValue = resultSet.getString("COLUMN_DEF");
String datatype = resultSet.getString("DATA_TYPE");
System.out.println("defaultValue = " + defaultValue);
System.out.println("datatype = " + datatype);
} -
Pro*C & SQLDA with NULL value for predicate column
Hi: I am using a C program to update a table via a dynamic sql (method 4) and SQLDA. In the update statement predicate, I have place holders (as in TBLCOL=:C000). One of the columns in the predicate contains null values, so I set L[n] = 0, V[n] = pData (which pData[0] = '\0'), *(I[n]) = -1, and T[n] = 5 (for text). I cannot find the row that I know is there.
I cannot change my statement to contain TBLCOL IS NULL, since I don't know ahead of time if I'm looking for rows with null values for this column. The Pro*C manual says that by setting the appropriate *(I[n]) = -1, it indicates to Oracle to simulate the "IS NULL" clause, and update the appropriate rows. In my case, I receive 1403 as SQLCODE when I use TBLCOL=:C000 vs TBLCOL IS NULL. What am I doing wrong? Thank you for your help.You should include these columns as well;
ChangeType (see mxi_changetype)
ValOwner (repository)
UserID ("jobid=<>", usermskey, GUI (mmc), DG (dyngrp), reconcile)
IdAudit (This is the event task (add and del member for assignments)
ParentAuditId (AuditID of parent which last updated the attribute, not consistent)
ChangedBy (Holds the MSKEY of the user which last changed the attribute)
ExpiryTime
to make sure you get a fuller picture of the audit record.
Your selection does not cover all events and descriptions
br,
Chris -
How to have a common value for a column using sql loader
Hi Have a sql loader file which looks like below. But I am not getting how insert the same value for the column in all rows.
id,
crt_user_id
BEGINDATA
1;"system"
2;"system"
3;"system"
So, instead of entering the crt_user_id as system in all rows, can we place the value at the top after the column name?Thanks Srini. your hint/suggestion helped me in finding the solution.
LOAD DATA
INFILE *
BADFILE './TEST.BAD'
DISCARDFILE './TEST.DSC'
APPEND INTO TABLE TEST_TABLE
Fields terminated by ";" Optionally enclosed by '"'
ID,
crt_user_id CONSTANT 'SOME CONSTANT VALUE'
BEGINDATA
1
2
3
so by using CONSTANT key word, we can avoid tying the same value in the data -
Generating MD5 hash value for any specific flat file
Hi experts,
I am developing a program that will generate flat files and also I should generate the MD5 Hash value for each and every flat files. My question is how can I generate the MD5 hash value for the generated .txt files.
Thanks in advance
ShabirYou can use functions
MD5_CALCULATE_HASH_FOR_CHAR for text file
MD5_CALCULATE_HASH_FOR_RAW for binary -
Create subordinate values for Characteristics
Hi ,
I am using BAPI to create the characteristic
CALL FUNCTION 'BAPI_CHARACT_CREATE'
EXPORTING
charactdetail = gs_charactdetail
keydate = gv_keydate
TABLES
charactdescr = gt_charactdescr
charactvaluesnum = gt_charactvaluesnum
charactvalueschar = gt_charactvalueschar
charactvaluescurr = gt_charactvaluescurr
charactvaluesdescr = gt_charactvaluesdescr
charactreferences = gt_charactreferences
charactrestrictions = gt_charactrestrictions
return = gt_return .
But there is no way which i can create suboridinate values for (charactvalueschar) . Please let me know how can i create soubordinate values for char values
Reagrds
Rameshdescribe your problem.
It does not really matter if you use standard batch input or IDOC, both will lead to the same result.
However, object 0150 and CLFMAS are 2 different things.
0150 is characteristics while CLFMAS is classification
if you want classify with standard batch input then you should use 0130 instead of 0150. -
Problem in Loading data for clob column using sql ldr
Hi,
I am having problem in loading data for tables having clob column.
Could anyone help me in correcting the below script for ctrl file inorder to load the data which is in mentioned format.
Any help really appreciated.
Table Script
Create table samp
no number,
col1 clob,
col2 clob
Ctrl File
options (skip =1)
load data
infile 'c:\1.csv'
Replace into table samp
fields terminated by ","
trailing nullcols
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
Data File(1.csv)
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"
Error Encountered
ORA-01461: can bind a LONG value only for insert into a LONG column
Table sampThanks in advanceI can't reproduce it on my 10.2.0.4.0. CTL file:
load data
INFILE *
Replace into table samp
fields terminated by ","
trailing nullcols
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
BEGINDATA
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"Loading:
SQL> Create table samp
2 (
3 no number,
4 col1 clob,
5 col2 clob
6 );
Table created.
SQL> host sqlldr scott/tiger control=c:\temp\samp.ctl log=c:\temp\samp.log
SQL> select * from samp
2 /
NO
COL1
COL2
1
asdf
assasadsdsdsd"sfasdfadf"sdsdsa,ssfsf
2
sfjass
dksadk,kd,ss"dfdfjkdjfdk"sasfjaslaljs
NO
COL1
COL2
SQL> SY. -
Create LOV's for all columns at the time of folder creation
Hi,
I know we can automatically create the LOV's for all the columns of a database table when creating the folder in the EUL. Is this a good practice or should I create LOV's on demand? What is the disadvantage of creating more LOV's than needs to be used other than the disk storage? I also know it is not a good idea to have an LOV on a field that has a lot of values. I am tempted not to create the LOV's in the beginning, but then it becomes a high maintenance issue if I have to come back and create many LOV's later. Thank you for your input.Yes, it is not a good idea to create LOVs for all the columns. LOVS should be created only for the columns where parameters will be used. More the number of LOVs, slower the response in opening up your Discoverer reports and if you are using Disco Viewer, the page might take a long time to open up and frustrate the users.
Also it is a good practise to have LOVs defined on the lookup tables or where there are distinct values in the table and not from where these values are used in the table.
regards
http://www.infocaptor.com <--- Free Discoverer Monitoring Dashboards
Maybe you are looking for
-
How to run Berkeley DB XML on AMD 64-bit Windows XP platform?
Hi, I have used Berkeley DB XML on a 32-bit Windows XP platform but now I have to run Berkeley DB XML on a 64-bit AMD platform with Windows XP. After reading a few posts about that, I started to build Berkeley DB XML in 64-bit mode. I am doing the bu
-
MBP A1278 Battery Drain during sleep
So I've been having issues with my Mid 2010 MBP A1278. I always charge it to 100%, but quickly overnight it drains and in a couple days goes to zero without using it at all. Does anyone have any tips? Right now I'm using OS X 10.8.5, but upgading
-
App store and ibook malfunction
my app store and ibooks have what looks like a stop sign through them. I was not using any of the apps at that time. They are no longer opening and when i click on them it states that they are not supported by the type of Mac i have. what can I do? I
-
I scratched the label off on a £25 gift card and it removed the code. How can I get the code for the card?
-
Does anyone know where there is a good tutorial for centering spry menu bars? Can this be done by changing rules in the spry menu .css file, or do I have to add code in code view? thanks!