Need help in concating column
Hi,
When i try to concat column iam getting below error. Column having more than 4000 char
ORA-22813: operand value exceeds system limits
create table emp2 as select * from emp where 1=2;
insert into emp2
select * from emp where deptno=10;
insert into emp2
select * from emp2 where deptno=10 ;
Please help me to concat column.
Iam using oracle 10g
Hi,
Below is my code. I used to concat order_release_refnum-value coumn which is having more than 4000 bytes.
SELECT ORR.ORDER_RELEASE_GID,ORR.ORDER_RELEASE_XID "Number",
(SELECT LOCATION_NAME FROM LOCATION WHERE LOCATION_GID = ORR.SOURCE_LOCATION_GID)||CHR(10)||(SELECT ADDRESS_LINE FROM LOCATION_ADDRESS WHERE LINE_SEQUENCE = 1 AND LOCATION_GID = ORR.SOURCE_LOCATION_GID)||CHR(10)||(SELECT 'Attn: '|| WM_CONCAT(REMARK_TEXT) FROM ORDER_RELEASE_REMARK WHERE REMARK_QUAL_GID = 'CONTACT' AND ORDER_RELEASE_GID = ORR.ORDER_RELEASE_GID)||chr(10)||(SELECT CITY||','||PROVINCE||','||POSTAL_CODE||' '||COUNTRY_CODE3_GID FROM LOCATION WHERE LOCATION_GID = ORR.SOURCE_LOCATION_GID) "SUPPLIER",
(SELECT LOCATION_NAME FROM LOCATION WHERE LOCATION_GID = ORR.DEST_LOCATION_GID)||CHR(10)||(SELECT ADDRESS_LINE FROM LOCATION_ADDRESS WHERE LINE_SEQUENCE = 1 AND LOCATION_GID = ORR.DEST_LOCATION_GID)||CHR(10)||(SELECT 'Attn: '|| WM_CONCAT(REMARK_TEXT) FROM ORDER_RELEASE_REMARK WHERE REMARK_QUAL_GID = 'CONTACT' AND ORDER_RELEASE_GID = ORR.ORDER_RELEASE_GID)||chr(10)||(SELECT CITY||','||PROVINCE||','||POSTAL_CODE||' '||COUNTRY_CODE3_GID FROM LOCATION WHERE LOCATION_GID = ORR.DEST_LOCATION_GID) "BILL-TO",
(SELECT WM_CONCAT(ORDER_RELEASE_REFNUM_VALUE) FROM ORDER_RELEASE_REFNUM WHERE ORDER_RELEASE_REFNUM_QUAL_GID = 'FREIGHT_TERMS' AND ORDER_RELEASE_GID = ORR.ORDER_RELEASE_GID) "Payment Terms" ,
(SELECT COUNTRY_CODE3_GID FROM LOCATION WHERE LOCATION_GID = ORR.SOURCE_LOCATION_GID) "Country of Origin",
(SELECT LOCATION_NAME FROM LOCATION WHERE LOCATION_GID = ORR.SERVPROV_GID) "Carrier",
(SELECT SUM(SHIP_UNIT_COUNT) FROM SHIP_UNIT WHERE TRANSPORT_HANDLING_UNIT_GID <> 'LINE_ITEMS' AND ORDER_RELEASE_GID = ORR.ORDER_RELEASE_GID) "Total Packages",
(SELECT SUM(UNIT_WEIGHT) FROM SHIP_UNIT WHERE TRANSPORT_HANDLING_UNIT_GID <> 'LINE_ITEMS' AND ORDER_RELEASE_GID = ORR.ORDER_RELEASE_GID) "Total Gross Weight"
FROM ORDER_RELEASE ORR
WHERE &P_ORDERRELEASE --ORR.ORDER_RELEASE_GID ='201011-01'
Similar Messages
-
Need help with complex column creation command
Hello, all
I need help with a complex column creation command and SQL anywhere help is not sufficient for it.
Here is the situation:
I need to write a generic DDL "alter table" command, which can add/modify columns without knowing in advance if they already exist in the destination table.
Is there a command, which looks like:
alter table "table1" add (on existing modify) column1 <datatype> <default> ?
Thank you,
ArcadyHi.
I don't think this is supported in alter table command. But you can code that inside an if statement which queries systables & syscolumns. Your code should be something like that:
if (select count(*) from sysobjects, syscolumns where sysobjects.id = syscolumns.id and sysobjects.name = 'some_table' and syscolumns.name = 'some_column') < 1
begin
alter table some_table add some_column numeric(12) not null
end
This is an example..
Andreas. -
Need help with custom column in BI Publisher
Hi Guru's
I have started working with BI Publisher Recently and need with below issue
Can you please let me know how can i create a custom column like % based on two existing measures in the report
I tried creating it in obiee report and used that SQL to create BI Publisher Report , but the result column in obiee is not working as expected in BI Publisher,
can some one please help me with this
Thanks a lot in advance.This column can be calculated in BIP RTF template. But if it is a column inside a FOR-loop
then it may need to be calculated slightly different.
Like I said, get the xml data and rtf then send it to me : [email protected]
and will get it fixed for you.
thanks
Jorge -
Hi,
Need a help in using a date columns, I have the below 2 columns (mm/dd/yyyy hh:mi:ss) and I want to exactly find the number of hours and minutes between those 2. please help me.
Start time - 9/2/2010 8:12:03 AM
End time - 9/3/2010 9:12:03 AM
Thanksthis might help:
with t as
select to_date('9/2/2010 8:12:03 AM', 'mm/dd/yyyy hh:mi:ss PM') Start_Time
,to_date('9/3/2010 9:12:03 AM', 'mm/dd/yyyy hh:mi:ss PM') End_Time from dual
select trunc((t.End_Time - t.Start_Time) * 24) as Hour_difference
,trunc((t.End_Time - t.Start_Time) * 24 * 60) as Min_difference from t -
Need help with discount column
Hi,
I have managed to create an invoive after discovering that I had LiveCycleDesigner included with Creative Suite 3
I only have very basic skills in this area, so please bear with me
I'm hoping what I am after is easy enough for someone out there to help me with.
As you can see, I have created the below columns.
The amount column is... Show: calculate* Quantity * Unit Price (with unit price being the Binding name under the Object tab)
So what I would like to do is add the discount variable in and need to know the script to enable this.
The Binding names are Quantity, Decgription, UnitPrice, ItemDiscount and Amount.
I got somewhere with the amount column as... Show: calculate* Quantity * UnitPrice * ItemDiscount / 100
But this left me with the actual discount in the amount column rather than the amount - discount.
I tried a few other ideas, but couldn't seem to get it right so I thought it best to get those who know to give me the right answer.
The other question is after I open the template with Adobe Reader, and fill it out , is it possible to save the resulting document as a 'standard' PDF?
So far I have had to export as jpg and then convert to PDF. I'm sure I must be missing something obvious....
I'm using windows 7 and LiveCycle Designer 8
Thanks
MartinHi,
Thanks for your help.
Wasn't sure how to apply the maths to the script and get it to work:)
They both worked perfectly
Is it possible for the Amount field to be left blank unless data is enetered in the other columns?
Right now the Preview PDF has a coloum of $0.00 under amount
As for saving the PDF
When I go to Save As in Adober Reader I get the following message
I've had a look through both the LiveCycle and PDF documents but have been unable to find any adjustable settings that might change this.s
I presume the Feild Display Pattern Szzz,zz9.99 is the correct way to remove the $ signs?
Thanks again
Martin -
Need Help for Pivoting Columns in table
I have a data like below in the table
col1 col2 col3 col4
a b 10 jan-11
aa b 20 feb-11
aab b 30 mar-11
Need desire o/p like
col1 col2 jan-11 feb-11 mar-11
a b 10
aa b 20
aab b 30
Can anyone help me on this? decode is not the option here because my table gets dynamic data and rows count can vary too(eg. 2000).
Thanks,
-KPPlease try searching the forum BEFORE you ask a question.. There are NUMEROUS posting son the subject:
http://forums.oracle.com/forums/search.jspa?objID=f75&q=pivot
Thank you,
Tony Miller
Webster, TX
Never Surrender Dreams!
JMS
If this question is answered, please mark the thread as closed and assign points where earned.. -
Need help on Unpivot (Columns to rows conversion)
Could you please help me to do unpivot using sql?
Table creation and insertion scripts:
create table REQ
ID NUMBER,
VALUE VARCHAR2(20)
insert into REQ (ID, VALUE)
values (1, 'HI,HELLO, KARTHI');
insert into REQ (ID, VALUE)
values (2, 'ARE,YOU,FINE,BHAR');
insert into REQ (ID, VALUE)
values (3, '100,200,300');
commit;
I need to view the data in the below format
ID VALUE
1 HI
1 HELLO
1 KARTHI
2 ARE
2 YOU
2 FINE
2 BHAR
3 100
3 200
3 300However, I would take care on the performance issue.So let's use the model clause:
SQL> set autotrace on
SQL> select id
2 , v
3 from req
4 model
5 partition by (id)
6 dimension by (0 i)
7 measures (value v)
8 rules iterate (10) until (instr(v[iteration_number+1],',') = 0)
9 ( v[iteration_number+1] = substr(v[iteration_number],instr(v[iteration_number],',')+1)
10 , v[iteration_number] = substr(v[iteration_number],1,instr(v[iteration_number],',')-1)
11 )
12 order by id
13 , i
14 /
ID V
1 HI
1 HELLO
1 KARTHI
2 ARE
2 YOU
2 FINE
2 BHAR
3 100
3 200
3 300
10 rijen zijn geselecteerd.
Uitvoeringspan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=3 Bytes=75)
1 0 SORT (ORDER BY) (Cost=3 Card=3 Bytes=75)
2 1 SQL MODEL (ORDERED FAST) (Cost=3 Card=3 Bytes=75)
3 2 TABLE ACCESS (FULL) OF 'REQ' (TABLE) (Cost=2 Card=3 By
tes=75)
Statistics
48 recursive calls
0 db block gets
11 consistent gets
0 physical reads
0 redo size
528 bytes sent via SQL*Net to client
271 bytes received via SQL*Net from client
6 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
10 rows processedRegards,
Rob. -
Needed help to add columns from one table to another table
Hi,
I have emp and dept tables. I think most of all might know what columns it's contain. Now I want to create table emp_dept with all emp and dept table columns.
I have wrote the below query it's worked too. But I think there should be some more other queries to get accomplish the same task. Plz let me know.
create table emp_dept as select a.*, b.dname, b.loc from emp a full outer join dept b on a.deptno = b.deptno where 1=2
Thanks for your time..Hi,
1004909 wrote:
Hi,
I have emp and dept tables. I think most of all might know what columns it's contain. Now I want to create table emp_dept with all emp and dept table columns.
I have wrote the below query it's worked too. But I think there should be some more other queries to get accomplish the same task. Why do you think that?
Plz let me know.
create table emp_dept as select a.*, b.dname, b.loc from emp a full outer join dept b on a.deptno = b.deptno where 1=2"WHERE 1 = 2" means you want to create the table, but not put any rows in it. In that case, theere's no need for a full outer join; a simple inner join would do just as well.
There is no single "right" or "best" table. (Most of us would have differerent jobs if there were.)
It does, however, make sense to talk about the "right" or "best" table for some specific purpose .
The emp and dept tables in the scott schema are great for transaction processing, where rows are frequenctly INSERTed, UPDATEd and/or DELETEd. For example, if department 10 moves from New York to Pune, you only have to find and UPDATE 1 row, and that one UPDATE will affect all employees in departemnt 10, regardess of how many there are.
What purpose will the emp_dept table have? Why is the table design used in the scott schema not best for you?
One possibility is that you need a tale that is very fast to query, even though it may be very inefficient for transactions. For example, you might want a data warehouse that is only refreshed once a day, and were you can run several common queries quickly, without joining the emp and dept tales.
Another possibility is that your data model (that is, what are the entities and the attributes) is different. For example, you may have a model where employees King and Miller both work in department 10, but King's location is New York, but Miller's is Pune.
In either of these situations, the table you posted migt be the best design. Why are you asking the question? What is the problem with the emp_dept table you posted? -
Need help with 3 column fixed in internet explorer
Hi, I'm having a major problem that won't go away. I'm using
an 3 column fixed style sheet, which renders fine in Safari and
Firefox, but won't in Internet explorerer. I always get about a
10px space between the left column and the content area that is
transparent. ( you can see the background.) Also the spry menu bar
is off to the right on i.e. ( don't know if that info. matters or
not) ANY suggestions would be appreciated! Tim from this forum has
been more than kind and re-wrote the whole code for the page. The
copy he sent me rendered fine, but when I deleted my files and
added his still had the problem. ( only this time the space is on
the left, last time on the right.) He did get the spry tabs to work
for me! I'm sure it's something stupid I'm missing on my end. Tim
is unbelieveably talented and way too nice to help me like this.
Anyone have any suggestions so I can leave poor Tim alone for a
little while!!! Thanks muchHello,
Somehow a LOT of whitespace got added into a number of tags
in the code in
your copy vs the one I sent.
I removed it all and it works fine.
I sent you the page again.
Take care,
Tim
"kidcoconut" <[email protected]> wrote in
message
news:fpjs9q$8ns$[email protected]..
> Hi, I'm having a major problem that won't go away. I'm
using an 3 column
> fixed
> style sheet, which renders fine in Safari and Firefox,
but won't in
> Internet
> explorerer. I always get about a 10px space between the
left column and
> the
> content area that is transparent. ( you can see the
background.) Also the
> spry
> menu bar is off to the right on i.e. ( don't know if
that info. matters or
> not)
> ANY suggestions would be appreciated! Tim from this
forum has been more
> than
> kind and re-wrote the whole code for the page. The copy
he sent me
> rendered
> fine, but when I deleted my files and added his still
had the problem. (
> only
> this time the space is on the left, last time on the
right.) He did get
> the
> spry tabs to work for me! I'm sure it's something stupid
I'm missing on my
> end.
> Tim is unbelieveably talented and way too nice to help
me like this.
> Anyone
> have any suggestions so I can leave poor Tim alone for a
little while!!!
> Thanks much
> -
Need help with summing column when using if-then-else
Using logic
<?xdofx:if INVOICE_BILL_AMT_IN_INV_CURR is null then INVPROC_BILL_AMOUNT else INVOICE_BILL_AMT_IN_INV_CURR end if?> for column field.
Having trouble summing the column using the logic above.
Any suggestions would be very much appreciated.
Thanks,
NancyThanks Tim,
That worked. Got rid of my error. However, if the field is null (=''), I get a total.
11.05 + 1429.70 = 1440.75
If the not null (!='') I am not getting a total.
103.74 + 173.13 =
BTW, recently took XML class. Leta Davis highly recommended your blog and I have gotten a lot of great tips from it.
Thanks,
Nancy -
Need help understanding a column in v$undostat
Version: 9.2.0.4.0, Solaris
Undo type: AUTO
Undo size: 600 MB
UNDO_RETENTION = 900 (15 min)
When I do
select * from v$undostat
Column name: NOSPACEERRCNT
The thing I dont understand is that: when I get non-zero rows for that column does it mean that users got error since No Free undo space available?
Issue is NO development users (of DB) complained with any error when the NOSPACEERRCNT had non-zero value?
--- Oracle notes ---
NOSPACEERRCNT (NUMBER)
Identifies the number of times space was requested in the undo tablespace and there was no free space available. That is, all of the space in the undo tablespace was in use by active transactions. The corrective action is to add more space to the undo tablespace.Can we ignore that no space errors ? The application code should not because this error means involved queries got some ORA-XXXX errors and have been rolled back and normally the application code should have either retried to run the queries or rolled back the corresponding transactions.
What this is ssolderrcnt,nospaceerrcnt columns means ?See the SQL Reference.
Message was edited by:
Pierre Forstmann -
Need help with af:column and skinning
Hallo,
ADF Faces and skinning is in general a great opportunity to get projects done - thx for this.
- I use a af:table with af:column with sortable="true".
- This works great, but the customer want's to have the icon for sorting to the left side of the label.
- I have created my own skin for this and can change the sorting icon, but I cannot place it to the left side of the label:
af|column::sort-ascend-icon {
content:url(/skins/espa/sort_ab_h.gif);
Has anyone done this? Is this possible?
Thx, WilliLooking at the source gives a clear picture - it can't be done.
Now I am switching over to less comples jsf components and additional implementations.
Thx, Willi -
CTL(control file) need help to load column data in test file as row data
Dear Experts,
My data file having data like
COMPANY1 SUPP1 SUPPTYP1 SUPPDISTANCE1...SUPP100 SUPPTYP100 SUPPDISTANCE100
COMPANY2 SUPP1 SUPPTYP1 SUPPDISTANCE1...SUPP100 SUPPTYP100 SUPPDISTANCE100
i am trying to load in to oralc table desc as bellow and trying to load this into row data how can i do?
this ctl will load only for first suppliler only how can i load rest 99 supplier
LOAD DATA
INFILE '/data/Supplier.dat'
INSERT
INTO SUPPLIERDETAIL
COMP_CD position(1:8) char(8),
SUPPLR_ID position(9:15) char(7),
LOC_ID position(16:20) char(5),
SUPPLR_DIST position(21:24) char(4),
SUPPLR_TYP position(25:) char(1)
Many thanks
KalingaI take it that you are running the process on UNIX box based on '/data/Supplier.dat'.
Try to –
1. Break the records into multiple lines > Try using awk/ or perl
COMPANY1 SUPP1 SUPPTYP1 SUPPDISTANCE1...SUPP100 SUPPTYP100 SUPPDISTANCE100
COMPANY2 SUPP1 SUPPTYP1 SUPPDISTANCE1...SUPP100 SUPPTYP100 SUPPDISTANCE100
Should appear in your output file as –
COMPANY1 SUPP1 SUPPTYP1 SUPPDISTANCE1
COMPANY1 SUPP100UPPTYP100 SUPPDISTANCE100
COMPANY2 SUPP1 SUPPTYP1 SUPPDISTANCE1
COMPANY2 SUPP100UPPTYP100 SUPPDISTANCE100
2. Output from 1 -> Save it to a file
3. Pass the output (point 2) as the Input file for the CTL to read
Etbin’s Solution is fine but don’t forget you have for each row 100 occurrences of Supplier information – so that makes 100 INTO Table’s code to put into your CTL file.
Shailender Mehta -
Need help with a calculated column - is there any way to reference a value in the current row?
Hey guys,
I'm a bit of a DAX newbie, and I'm running into a block. I'm creating a Power View report about IT tickets. We are going to be creating a cube to automate the data soon, I'm currently working with a flat Excel Data Table of data to demonstrate the Power
View reporting capabilities to the team. I need the default display to show the top 4-5 items basked on the Ticket Count. The three applicable columns I'm using are the TicketID, the ContactReason, and the AssetCategory - all three are
text. One slide will show the top five Contact Reasons by Ticket Count, and the other will show the top five Categories by Ticket Count. The users will see this default view, but will be able to change it to see differently ranked items or can clear the
ranking slicer altogether.
What I've accomplished so far is to create the Calculated Field [Ticket Count] = COUNTA(Table1[TicketID])
And 2 other calculated fields:
[Contact Rank] = RANKX(ALL(Table1[ContactReason]),[Ticket Count],,,DENSE)
[Asset Rank] = RANKX(ALL(Table1[AssetCategory]),[Ticket Count],,,DENSE)
If I were creating a Pivot Table, this would be great. These fields calculate everything the right way. The problem is, I need to have a Rank slicer on each slide and the calculation by itself contains no data - with no data, there's nothing to slice. I
realized I need to actually have columns of data so I can create a slicer. I need each row of the table to show the same [Contact Rank] for every instance of a particular ContactReason (and the same for the [Asset Rank] and AssetCategory).
The RANKX formulas pasted into the Calculated Column section only show a value of 1 - with no Pivot table summarizing the fields, it's counting each row's ticket once, giving every line the tied Rank of #1.
I've solved the problem in Excel by creating 2 Pivot Tables on a separate sheet that have the data field and the calculated field for ContactRason and AssetCategory. Then on my Excel Data Table, I've added two columns that do a VLOOKUP and pull over a the
Calculated Rank from each Pivot Table that match the ContactReason and AssetCategory fields. This works on the flat Excel Data Table now, but will not be a solutions when we start pulling the data from the cube (and there is no flat table).
What I think I need is an Expression for the RANKX formula that can give me, for each row, the count of all of the times a ContactReason shows up in an entire column. There's only about 100,000 lines of data and each ContactReason or AssetCategory
may show up several thousand times. But if I can get the expression to return that count, then the RANKX formula should work in the Column. If it wasn't a DAX formula, I'd use a COUNTIF and say 'Count the entire ContactReason column anytime it's equal to the
ContactReason on THIS row', but in DAX I don't know how to reference a single value in a row. I've tried the CALCULATE() formula, but it seems like the filter needs a specific value, and doesn't work on a dynamic "cell" value.
Any help would be greatly appreciated! (I hope it all makes sense!)If I've understood you correctly then the ALLEXCEPT function may be what you're after and it could be applied in a similar way to the following...
=
RANKX(
ALL(Table1),
CALCULATE(
COUNTROWS(table1),
ALLEXCEPT(Table1, Table1[ContactReason])
DENSE
If this has missed the mark, would it be possible to clarify the requirement further?
Regards,
Michael Amadi
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
Website: http://www.nimblelearn.com
Blog: http://www.nimblelearn.com/blog
Twitter: @nimblelearn -
Need help in sorting a alphanumeric DB column in BO report.
Hi All,
We have a DB column (Data type = varchar2).. with values..
1
1
1.1
1.1.1
1.1.1.1
1.2
1.2.1
1.3
1.3.1
1.3.1.1.1
Desired
1
1.1
1.1.1
1.1.1.1
1.2
1.2.1
1.3
1.3.1
1.3.1.1.1
2
etc..
We need to sort this column in BO report.. any idea.. we have sorted it in the Query which is giving right output in pl/sql developer but in BO sorting is not showing properly.
Could you help please to achieve this?
Thanks and Regards,
PriyashreeThe Record Sort Expert appears when you choose the Record Sort Expert command from the Report menu.
Use the Record Sort Expert to define how you want the records in your report to be sorted for printing. You can add and remove a sort field and define the sort direction (ascending or descending) for the data in your report.
In my version Record Sort appears as a A over a Z with Arrows pointing from A to Z, and Z to A. It is next to group expert, which looks like a mountain with an arrow pointing up. Both are on the "Expert" tool bar.
Maybe you are looking for
-
Synching problems with calendar using MobileMe
Ever since upgrading my iPad to version 4.3.3, my calendar fails to sync with my PC. It syncs just fine with MobilMe but MobileMe is not synching with the PC. I upgraded MobleMe on the PC to version 1.6.6. I am running Outlook 2007 on my PC.
-
Down Payment Process in Asset Accountng
Hi, I want to know , what is the process of Down Payment in Asset Accounting I know the Tcodes, but i want to know what happens in each Tcode level F-47 next F-48 next F-90 next F-54 next AIAB next AIBU Pls send me Rgds sunfico
-
Hyperlink to webpage not working??
I am attempting to make a hyperlink (to a webpage) of an object on a slide (a circle). After clicking on the object, opening the Inspector, checking "Enable as a Hyperlink" and then beginning to type the URL in the proper place, the Inspector box imm
-
IPad 2 keeps freezing, soft reset has no effect
Hi there, My iPad 2 has frozen 3 times in the past week and will only respond once I restore it. This has just started happening and it's almost every day now. I've tried all the suggestions, all aspects of the screen freezes including the red slide
-
Ipod Touch Sleep/Wake button not working
Okay people I've had my 1st generation iPod touch since April of 2008...all of a sudden ( a few months ago) my sleep/wake button just stops working. Then recently it began to work again like for 4 days and then it just S T O P P E D ....A G A I N!!!