How to CREATE VIEW to merge two tables each of which has CLOB-typed column
I failed in creating a view to merge two tables that have CLOB-type column each.
The details are:
Database: Oracle 9i (9.2.0)
Two tables "test" and "test_bak", each of which has the following structure:
ID Number(10, 0)
DUMMY VARCHAR2(20)
DUMMYCLOB CLOB
The following operation fails:
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test
union
select id, dummy, dummyclob from test_bak;
I was announced:
select test.id, test.dummy, test.dummyclob
ERROR in line 2:
ORA-00932: inconsistent data type: required - , but CLOB presented.
But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
1) one table, with CLOB-typed column
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test;
2) two tables, without CLOB-typed columns
create view dummyview (id, dummy) as
select id, dummy from test
union
select id, dummy from test_bak;
I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
many thanks in advance
Dong Wenyu,
No.
But you could do this:
SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
FROM your_table1 tab1, your_table2 tab2, (
SELECT primary_key, ...
FROM your_table1
UNION
SELECT primary_key, ...
FROM your_table2
) source
WHERE source.primary_key = tab1.id (+)
AND source.primary_key = tab2.id (+)
In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
d.
Similar Messages
-
How can i view a attached file in OAF pages which has been attached
Dear all,
Hope you are well.
i have a table region from that i have attached a file named"file1.text" against a primary key.
now i want to view that attached file in a oaf page.
how can i view that attachment.
would you please explainHi again,
Personalize that table
1-Add Attachment Image column
2-Set the *View Instance (ViewObject that feeds table)
3-Add Entity under the Attachment image
4-Set *Entity as same with your entity value
5-Insert Allowed =>false, Update Allowed => false Show All => true
6-Add a primary key under the Entity
7-Set View Attribute with your primary key column like PersonId
Thanks.
Anil -
How to create the reation between two tables without creating relation
Hi,
I have three tables.( A,B and C)
I created relation between A,B and A,C.
I want to create the relation between B,C without using realtion in oracle forms.
Please do the needful.ok, now i understand your problem. It is a case of one-many-many relation between three blocks.
In this situation what i personally follow that - save records in between when it ask for a commit. And i shall advice you to follow that only. This is the safe and easy method.
Otherwise,
1> make your third block a non-database block.
2> When finish entering/modifying each data set related to 2nd block - insert/update/delete the data grammatically into a temporary table. and after that clear the 3rd block.
3> you need to reload the record in 3rd block from the temporary table when you move to a record of 2nd block that has already been entered.
4> now when you finally commit your form the insert/update/delete record from the temporary table into the final 3rd table.
Now follow which ever steps is suitable for you.
Regards,
Tarun -
How to create view for xmltype table in oracle
hi:
Can some one help me how to create view for xmltype table in oracle?
XMLType do not have column
SemThank you !!
I read it and become very hard to implement what I want to do.
Can you give me example please?
My main goal to create view for xmltype table is to XQuery the XML data?
Do you have any other suggestion?
Please help
Ali_2 -
ORA-01776: I can't insert on a view comprised by two tables
Good morning:
I'm trying to do an insertion on a view comprised by the join of two tables (departments and employees) and it failed.
The view is this one:
CREATE OR REPLACE FORCE VIEW "EMPDPTO" ("EMPLOYEE_ID", "LAST_NAME", "EMAIL", "HIRE_DATE", "JOB_ID", "DEPARTMENT_ID", "DEPARTMENT_NAME") AS
SELECT employee_id, last_name, email, hire_date, job_id, d.department_id, department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
My insertion command
INSERT INTO empdpto
VALUES(743, 'Bermejo', '[email protected]', '12/12/09', 'IT_PROG', 10, 'Administration');
throws a ORA-01776: it's not possible to modify more than one base table through a join union.
On the other side I've seen in documentation that in certain circunstances is possible to do an insertion on a complex view.
Is it possible to do an insertion on a view comprised by two tables?. Under what circunstances?.
ThanksFrom SQL Reference CREATE VIEW section Notes on Updatable Views http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8004.htm#i2065510
>
If you want a join view to be updatable, then all of the following conditions must be true:
The DML statement must affect only one table underlying the join.
For an INSERT statement, the view must not be created WITH CHECK OPTION, and all columns into which values are inserted must come from a key-preserved table. A key-preserved table is one for which every primary key or unique key value in the base table is also unique in the join view.
For an UPDATE statement, the view must not be created WITH CHECK OPTION, and all columns updated must be extracted from a key-preserved table.
>
The first condition is not true for the view you have created.
Edited by: P. Forstmann on 26 janv. 2010 20:17 -
Help view to get two table entries in search help
Hi,
I have created the help view for join two tables and that help view was called in the selection method for creating search help of the custom table field. since it has show inthe selection screen , it is fetching only one table entries. and the shown entries are displaying but not passing.
Please provide the steps to get the two table entries and the displayed entries should pass.
Thanks in Advance,
sivaHi sivanag,
1. Try your view with SE16/SE16N to see if it really finds what you expect
2. Use the same data elements in help view as on selection screen
3. read documentation and F1 help on all fields you see in the search help definition - especially only field marked as EXPORT parameter will be put back on screen.
But, sincerely, I don't know what your selection-screen looks like.
Regards,
Clemens -
How to create radio button between two slection screen
hello all.
could you please guide me how to create radio button between two SELECTION-SCREEN in screen painter.
Thank you,
srinivashi
SEE THIS CODE
REPORT ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).
******DATA DECLARATIONS**********
DATA : BEGIN OF IT_PLANT OCCURS 0,
MATNR LIKE MARA-MATNR,
WERKS LIKE MARC-WERKS,
PSTAT LIKE MARC-PSTAT,
EKGRP LIKE MARC-EKGRP,
END OF IT_PLANT.
DATA : BEGIN OF IT_PONO OCCURS 0,
EBELN LIKE EKKO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
END OF IT_PONO.
TABLES EKKO.
********END OF DATA DECLARATIONS*********
********SELECTION SCREEN DESIGN ***********
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R3 RADIOBUTTON GROUP G2 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R4 RADIOBUTTON GROUP G2.
SELECTION-SCREEN COMMENT 5(20) TEXT-004 FOR FIELD R4.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
******END OF SELECTION SCREEN DESIGN****************
<b>rEWARD IF USEFULL</b> -
Hi Experts,
I need to create view from joining 4 Tables in SAP R/3 in SE11 Transaction. Can you please let me know step by step the procedure to create the view.
Thanks
PadmaHi Padma,
Welcome to SDN . Please use the below link to get the information about view
Re: how to create a view?
But please search SDN before posting and post the message in the correct forum ( ABAP) to get the faster response.
Thanks & Regards,
Raja -
How to create an arrow in a table
How to create an arrow in a table in numbers.
If you have plus or minus numbers, I want to know a green arrow on the increase is positively or a red arrow if it is negative numberMaybe something like this?
-
How to create t-code for a table and how to create transaction variant???
Hi,
I have created a custom table zsark.
Now my requirement is : I have to create a transaction variant zsark_var for sm30 and table zsark. I have to disable the output of the first screen. I have to assign the transaction variant to the transaction code of table zsark.
Now,
1. how to create transaction code to a table. Can any one give me the
staps??
2. how to create transaction variant for the above requirement???
Thanks & Regards,
SarkarHi
1 Goto SE93 transaction
2 Choose 5th option Transaction with parameters
3 Give transaction : SM30, Check Skip Initial Screen Press Enter
4 Goto Bottom left corner, click F4 select viewname, on right hand side give table name
5 Press one more time F4, choose update , mark it X on right side.
6 save the transaction.
Thanks
sandeep
reward if helpful -
How can I view more than two pages at a time?
How can I view more man two pages at a time?
As a muscian reading digital sheets on Reader, being able to veiw as many as 3 to 5 pages at a time would be more helpful. Also, if it was possible to view any number of pages at time such as pages 1 and 2, 2 and 3, 3 and 4, or 5,6,7,and 8 instead of just 1 and 2 or 3 and 4 etc. my experience would be even better. thanks.The only way I could make Reader show 4 pages was to
set View to 2 pages scrolling
zoom out to display four pages:
But for me that it to small to read anything... -
How to create a calendar for two years in GL
how to create a calendar for two years in GL
Hi,
- Login into Oracle EBS and select a responsiblity with GL Superuser drants (e.g. General Ledger Super User)
- Navigate to Setup + Financials + Calendars and open the GUI Accounting (Navigation for R12)
- Query the used calendard (used from jour Set of Books/ Ledger via the GUI
- Enter for each Period (= Period Type 13, 16, 18,...) one Record, have a look to the existing data, used the same logic.
In the GUI, defined the calendar for 2 Years
Dirk -
How to create screen resolution in bdc table control
hi gurus
can anyone suggest me
how to create screen resolution in bdc table control
thanks®ards
mark.Hi ,
Using CTU_PARAMS table for screen resolution .
For this sample code.
This is for Transation FB60.
report ZZFB60
no standard page heading line-size 255.
tables t100.
PARAMETERS : p_file1 like rlgrap-filename,
p_doctyp like RF05A-BUSCS,
p_invdat like INVFO-BLDAT,
p_posdat like INVFO-BUDAT.
CONSTANTS : C_TRANS_FB60(4) VALUE 'FB60'.
*Parameter string for runtime of CALL TRANSACTION
data : l_option type ctu_params,
l_subrc type sysubrc.
DATA : l_mstring(150).
data accnt type char17.
data : day type char2,
month type char2,
year type char4,
date1 type char10,
date2 type char10.
data : cnt(2) TYPE n,
cnt1 type i,
fld(25) TYPE c.
data : begin of excel occurs 0,
fieldname(255) type c,
end of excel.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
data: begin of t_record occurs 0,
BUKRS(004),
ACCNT(017),
XBLNR(016),
WRBTR1(016),
WAERS(005),
SECCO(004) ,
SGTXT(050),
HKONT(010),
WRBTR2(017),
MWSKZ(002),
GSBER(004),
KOSTL(010),
end of t_record.
*Internal Table for Header Data
DATA : BEGIN OF t_head OCCURS 0,
BUKRS(004), "Company Code
ACCNT(017), "Account or Vendor
XBLNR(016), "Reference
WRBTR1(017), "Amount in document currency
WAERS(005), "Currency
SECCO(004), "Section Code
SGTXT(050), "Text
END OF t_head.
*Internal table for Item Data
DATA : BEGIN OF t_item OCCURS 0,
ACCNT(017), "Account
HKONT(010), "GL Account
WRBTR2(017), "Line item Amount in document currency
MWSKZ(002), "Tax Code
GSBER(004), " Business Area
KOSTL(010), "Cost centre
END OF t_item.
DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDC_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
*include bdcrecx1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM file_selection.
PERFORM data_upload.
PERFORM table_control.
start-of-selection.
l_option-defsize = 'X'.
l_option-dismode = 'A'.
l_option-updmode = 'S'.
day = p_invdat+6(2).
month = p_invdat+4(2).
year = p_invdat+0(4).
concatenate day month year into date1 SEPARATED BY '.'.
day = p_posdat+6(2).
month = p_posdat+4(2).
year = p_posdat+0(4).
concatenate day month year into date2 SEPARATED BY '.'.
*perform open_group.
loop at t_head.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPLACHD' '1000'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_field using 'BKPF-BUKRS' t_head-bukrs.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RF05A-BUSCS' p_doctyp.
perform bdc_field using 'INVFO-ACCNT' t_head-accnt.
perform bdc_field using 'INVFO-BLDAT' date1.
perform bdc_field using 'INVFO-BUDAT' date2.
perform bdc_field using 'INVFO-XBLNR' t_head-xblnr.
perform bdc_field using 'INVFO-WRBTR' t_head-wrbtr1.
perform bdc_field using 'INVFO-WAERS' t_head-waers.
perform bdc_field using 'INVFO-SECCO' t_head-secco.
perform bdc_field using 'INVFO-SGTXT' t_head-sgtxt.
cnt = 1.
cnt1 = 1.
loop at t_item where accnt = t_head-accnt.
*if cnt > 4.
*cnt = 4.
*endif.
if cnt1 gt 1.
CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
perform bdc_field using fld 'X'.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '=0005'.
endif.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '/00'.
CONCATENATE 'ACGL_ITEM-HKONT(' cnt ')' INTO fld.
perform bdc_field using fld t_item-hkont.
CONCATENATE 'ACGL_ITEM-WRBTR(' cnt ')' INTO fld.
perform bdc_field using fld t_item-wrbtr2.
CONCATENATE 'ACGL_ITEM-MWSKZ(' cnt ')' INTO fld.
perform bdc_field using fld t_item-mwskz.
CONCATENATE 'ACGL_ITEM-GSBER(' cnt ')' INTO fld.
perform bdc_field using fld t_item-gsber.
CONCATENATE 'ACGL_ITEM-KOSTL(' cnt ')' INTO fld.
perform bdc_field using fld t_item-kostl.
perform bdc_field using 'BDC_CURSOR' fld.
*CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
*perform bdc_field using fld 'X'.
cnt1 = cnt1 + 1.
*cnt = cnt + 1.
*if cnt > 1.
*perform bdc_dynpro using 'SAPMF05A' '1100'.
*perform bdc_field using 'BDC_OKCODE' '=0005'.
**perform bdc_field using 'BDC_OKCODE' '=0006'.
*endif.
endloop.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
*perform bdc_transaction using 'FB60'.
CALL TRANSACTION C_TRANS_FB60 USING IT_BDCDATA options from l_option
MESSAGES INTO IT_BDC_MESSAGES.
perform error.
perform errordownload.
endloop.
*perform close_group.
*Form data_upload
FORM data_upload .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = p_file1
FILETYPE = 'DAT'
TABLES
DATA_TAB = t_record.
ENDFORM. " data_upload
*Form file_selection
FORM file_selection .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'p_file1'
IMPORTING
file_name = p_file1.
ENDFORM. " file_selection
Form BDC_DYNPRO
FORM BDC_DYNPRO using program dynpro.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
endform.
*Form BDC_FIELD
FORM bdc_field using fnam fval.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
Table Control
FORM table_control .
LOOP AT t_record.
ON CHANGE OF t_record-accnt.
MOVE-CORRESPONDING t_record TO t_head.
APPEND t_head.
ENDON.
loop at t_head.
t_item-accnt = t_head-accnt.
t_item-hkont = t_record-hkont.
t_item-wrbtr2 = t_record-wrbtr2 .
t_item-mwskz = t_record-mwskz .
t_item-gsber = t_record-gsber .
t_item-kostl = t_record-kostl.
APPEND t_item.
endloop.
If t_record-level = 'H'.
t_head-bukrs = t_record-text1.
t_head-accnt = t_record-text2.
t_head-xblnr = t_record-text3.
t_head-wrbtr1 = t_record-text4.
t_head-waers = t_record-text5.
t_head-secco = t_record-text6.
t_head-sgtxt = t_record-text7.
APPEND t_head.
else.
t_item-accnt = t_head-accnt.
t_item-hkont = t_record-text1.
t_item-wrbtr2 = t_record-text2.
t_item-mwskz = t_record-text3.
t_item-gsber = t_record-text4.
t_item-kostl = t_record-text5.
APPEND t_item.
endif.
ENDLOOP.
ENDFORM.
FORM error .
LOOP AT IT_BDC_MESSAGES.
IF IT_BDC_MESSAGES-msgtyp = 'E'.
SELECT single * FROM t100 WHERE
sprsl = it_BDC_MESSAGES-msgspra
AND arbgb = IT_BDC_MESSAGES-msgid
AND msgnr = IT_BDC_MESSAGES-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ELSE.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
form errordownload.
*down the internal table to excel file.
call function 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'c:/Error.xls'
TABLES
data_tab = it_mess
fieldnames = excel
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_filename = 6
invalid_pivot_fields = 7
download_problem = 8
others = 9.
endform.
Reward if useful
Regards,
Narasimha
Edited by: narasimha marella on May 13, 2008 12:12 PM -
How to create dependent LOV in Advanced Table.
Hi,
How to create dependent LOV in Advanced Table. Pls help send me the steps.
Thanks in Advance,
Hanimi....Hi,
Not sure whether you need dependent LOV or dependent poplist. But anyways, you can refer the below link for Dependent LOV
http://oraclearea51.com/component/content/article/98-oa-framework/372-dependent-lov-in-oaf.html
and for Dependent Poplist refer the below link:
http://oraclearea51.com/component/content/article/98-oa-framework/370-dependent-poplist-in-an-advanced-table-in-oaf.html
Regards,
Sudhakar Mani
http://oraclearea51.com/sudhakarmani -
How to create IDOC for customer defined table
hi,
How to create IDOC for customer defined table Records and how to send this IDOC to target system.
what message type will be used and on receiving system how to post these records.
thankx.
pillac.Hi,
You need to create a custom message type and custom IDOC type for this with whatever fields you want send. You need to create segments (WE30), IDOC type (WE30), Message types (WE81) and assign the message type to the IDOC type (WE82).
You will have trigger the IDOC using a Report or something after doing the partner profile settings.
Similary in the target system also, you will have do all the settings.
Take a look the links to find out what settings needs to be done.
http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
http://www.sappro.com/downloads/OneClientDistribution.pdf
Regards,
Ravi
Note : Please mark the helpful answers and close the thread if the issue is resolved.
Maybe you are looking for
-
What is the prioritization of data when syncing to different computers?
All of the bookmarks, passwords, etc. that I want to keep are on my '''laptop'''. If I've set up my Firefox Sync account on my ''desktop'', and I add my '''laptop '''to that account, will the "syncable" data from my ''desktop ''overwrite all the "syn
-
Duplicating an object a certain distance away
For the life of me, I cannot remember what this is called, or where to find it in the menus. It doesn't have the word "duplicate" in it, but it should! You select an object and then go to a dialog box and set up how many times you want to duplicate
-
Hi, Can anyone help me out What is interface and how it is going to be create as our business requirement? How do i create interface to intergrate DCS system to PP. sap
-
Hi, Latest LR 5.7 installed. I am printing with ImagePrint RIP which is accessed via "edit it" drop down under "Photo" menu selection. LR makes a tiff copy of the image every time I print appending -edit### [### is a number] each time. I have che
-
Running solaris 10 on new machine. Have older x86 software I would like to bring into use. Does anyone know if versions older than 8/9 are available to download (free). ?v2.5 Thanks, HH