Table having trigger
SQL> exec dbms_wm.enableversioning('shan','view_wo_overwrite');
BEGIN dbms_wm.enableversioning('shan','view_wo_overwrite'); END;
ERROR at line 1:
ORA-20080: invalid 'hist' parameter for EnableVersioning
ORA-06512: at "SYS.LTDDL", line 441
ORA-06512: at "SYS.LTDDL", line 1177
ORA-06512: at "SYS.LTDDL", line 1163
ORA-06512: at "SYS.LT", line 8033
ORA-06512: at line 1
when i enable versioning for table having trigger i am facing above problem. Am i missing something here.
Thanks and Regards,
Satheesh Babu.S
Hello,
Currently, the hist parameter is case sensitive. So, the following should work:
SQL> exec dbms_wm.enableversioning('shan','VIEW_WO_OVERWRITE');
We will allow any case hist parameter in a future release.
Thanks,
Ben
Similar Messages
-
Can i create IN/UP/DE Trigger on a existing table having more than 2L rows
Hi All,
Can i create a INSERT/UPDATE/DELETE Trigger on a existing table having more than 2 lacs records ? if yes (is that works for only some kind of triggers? or for all ?). if not, tell me the reasons and limitations with guidelines.
Thanks in Advance.Hi,
Sure; you can create new triggers for tables that already have rows. The type of trigger and the number of rows already in the table don't matter.
Try it. If the trigger works with a small table in your Development database, then there's no reason to expect it won't work on a larger table in your Production datbase. -
Cannot create temporary table having identity column
Hi experts,
I saw the above error msg while running the following statement:
create local temporary column table #tmp_table (c1 int GENERATED by default AS IDENTITY (start with 1 increment by 1), c2 int)
Could not execute 'create local temporary column table #tmp_table(c1 int GENERATED by default AS IDENTITY (start with ...'
SAP DBTech JDBC: [7]: feature not supported: cannot create temporary table having identity column: C1: line 1 col 48 (at pos 47)
I understand we can support normal column table creation with identity column, but don't know why cannot support temporary column tables with identity column. Is there any configuration that can enable it for temporary column table? Or what can I do to support it indirectly, like writing a trigger to support it or something else?
If not, then is there any future plan for this feature?
Regards,
HuberyHi Hubery,
I've heard this trail of arguments before...
Customer has a solution... they want it on HANA... but they don't want to change the solution.
Well, fair call, I'd say.
The problem here is: there's a mix-up of solution and implementation here.
It should be clear now, that changing DBMS systems (in any direction) will require some effort in changing the implementation. Every DBMS works a bit different than the others, given "standard" SQL or not.
So I don't agree with the notion of "we cannot change the implementation".
In fact, you will have to change the implementation anyhow.
Rather than imitating the existing solution implementation on ASE, implement it on SAP HANA.
Filling up tons of temporary tables is not a great idea in SAP HANA - you would rather try to create calculation views that present the data ad hoc in the desired way.
That's my 2 cts on that.
- Lars -
How to get the rows from a table having some column has any letter
Hi All,
suppose i have a table having columns id(number), code(varchar).
code has alphanumeric characters (ex. ABC123, 67B56 etc).
some codes are only numbers (2344, 7898 etc).
how can i get the rows which have alphabets in the code.
ex:
id code
1 AB45
2 456
3 890
4 67B7
how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
thanks in advance to allThanks to one and all.
i am gettig my required output.
But i have a doubt in the operator.
If i add or remove '[]' in the operator, i am getting different ouputs.
There is a count difference in the result of the operators used.
REGEXP_LIKE(<column>,'[[:lower:]]')
REGEXP_LIKE(<column>,'[[[:lower:]]]')
REGEXP_LIKE(<column>,'[:lower:]')
Can anybody please explain what is the difference in using '[]', in the operator?
What is the correct syntax, whether i have to use two '[]'s or one '[]'.
Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
Any query to get the required output in 8i version?
Thanks in advance to all. -
Submitting multiple job on teh same table via trigger
Hi All,
I have a trigger that run multiple jobs using dbms_job on the same table. I am trying to refresh two materialized views complete via dbms_job.
Issue is when data is inserted into NET_CAB table , the trigger kicks off the bothe procedures but only the first materialized view is refreshed and not the other one.
Attached is the trigger, the procedure and materialized view
<pre>
create or replace
TRIGGER NET_CAB_TRG
AFTER INSERT OR UPDATE OR DELETE ON NET_CAB
DECLARE
pbl NUMBER;
pbl1 number;
BEGIN
SYS.DBMS_JOB.SUBMIT( JOB => pbl,what => 'P_CAB_PROC;' ) ;
SYS.DBMS_JOB.SUBMIT( JOB => pbl1,what => 'P_CABAS_PROC;') ;
END;
</pre>
<pre>
create or replace
procedure P_CAB_PROC
is
BEGIN
dbms_mview.REFRESH('P_CAB','C');
COMMIT;
END;
</pre>
<pre>
create or replace
procedure P_CABAS_PROC
is
BEGIN
dbms_mview.REFRESH('P_CABAS','C');
COMMIT;
END;
</pre>
<pre>
CREATE MATERIALIZED VIEW P_CAB
BUILD DEFERRED
USING INDEX
REFRESH COMPLETE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS
SELECT
seq_nextval AS ID,
NAME,
SEGMENT_ID,
reproject(geometry) AS GEOMETRY
FROM NET_CAB
where sdo_geom.validate_geometry(geometry,0.005) = 'TRUE'
</pre>
<pre>
CREATE MATERIALIZED VIEW P_CABAS
BUILD DEFERRED
USING INDEX
REFRESH COMPLETE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS
SELECT
seq_nextval AS ID,
NAME,
SEGMENT_ID,
reproject(geometry) AS GEOMETRY
FROM NET_CAB
where sdo_geom.validate_geometry(geometry,0.005) = 'TRUE'
AND cis > 4;
</pre>
Edited by: CrackerJack on May 22, 2012 8:58 PMI can run many procedures in a job:
BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
job_name => 'JOB_REPORT_FPD'
,start_date => TO_TIMESTAMP_TZ('2012/05/31 23:30:00.000000 +07:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
,repeat_interval => 'FREQ=MONTHLY;BYMONTHDAY=-1'
,end_date => NULL
,job_class => 'DEFAULT_JOB_CLASS'
,job_type => 'PLSQL_BLOCK'
,job_action => '
DECLARE
BEGIN
ibox_file.fpd_nbot_report;
ibox_file.fpd_nbot_report(''NBOT'');
ibox_file.order_report;
COMMIT;
EXCEPTION
WHEN OTHERS THEN ROLLBACK;
END;
,comments => 'USED FOR REPORTING FPD'
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'JOB_REPORT_FPD'
,attribute => 'RESTARTABLE'
,value => FALSE);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'JOB_REPORT_FPD'
,attribute => 'LOGGING_LEVEL'
,value => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'JOB_REPORT_FPD'
,attribute => 'MAX_FAILURES');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'JOB_REPORT_FPD'
,attribute => 'MAX_RUNS');
BEGIN
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'JOB_REPORT_FPD'
,attribute => 'STOP_ON_WINDOW_CLOSE'
,value => FALSE);
EXCEPTION
-- could fail if program is of type EXECUTABLE...
WHEN OTHERS THEN
NULL;
END;
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'JOB_REPORT_FPD'
,attribute => 'JOB_PRIORITY'
,value => 3);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'JOB_REPORT_FPD'
,attribute => 'SCHEDULE_LIMIT');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'JOB_REPORT_FPD'
,attribute => 'AUTO_DROP'
,value => FALSE);
SYS.DBMS_SCHEDULER.ENABLE
(name => 'JOB_REPORT_FPD');
END;
/ -
Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field
Hello,
I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
Table structures are mentioned below:
OP:
Name Null Type
OP_NBR NOT NULL NUMBER(4) (Primary Key)
OP_DESC VARCHAR2(50)
OP_PAYLOD_XML CLOB
GM:
Name Null Type
GM_NBR NOT NULL NUMBER(4) (Primary Key)
GM_DESC VARCHAR2(40)
OP_NBR NOT NULL NUMBER(4) (Foreign Key)
GM_PAYLOD_XML CLOB
DM:
Name Null Type
DM_NBR NOT NULL NUMBER(4) (Primary Key)
DM_DESC VARCHAR2(40)
GM_NBR NOT NULL NUMBER(4) (Foreign Key)
DM_PAYLOD_XML CLOB
DE:
Name Null Type
DE_NBR NOT NULL NUMBER(4) (Primary Key)
DE_DESC NOT NULL VARCHAR2(40)
DM_NBR NOT NULL NUMBER(4) (Foreign Key)
DE_PAYLOD_XML CLOB
+++++++++++++++++++++++++++++++++++++++++++++++++++++
SELECT
j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
FROM
DE g, DM h, GM i, OP j
WHERE
h.dm_nbr = g.dm_nbr(+) and
i.gm_nbr = h.gm_nbr(+) and
j.op_nbr = i.op_nbr(+)
+++++++++++++++++++++++++++++++++++++++++++++++++++++
I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
Current O/P:
<resultSet>
<Record1>
<OP_PAYLOD_XML1>
<GM_PAYLOD_XML1>
<DM_PAYLOD_XML1>
<DE_PAYLOD_XML1>
</Record1>
<Record2>
<OP_PAYLOD_XML2>
<GM_PAYLOD_XML2>
<DM_PAYLOD_XML2>
<DE_PAYLOD_XML2>
</Record2>
<RecordN>
<OP_PAYLOD_XMLN>
<GM_PAYLOD_XMLN>
<DM_PAYLOD_XMLN>
<DE_PAYLOD_XMLN>
</RecordN>
</resultSet>
Now i want to change my SQL query so that i get following output structure:
<resultSet>
<Record>
<OP_PAYLOD_XML1>
<GM_PAYLOD_XML1>
<GM_PAYLOD_XML2> .......
<GM_PAYLOD_XMLN>
<DM_PAYLOD_XML1>
<DM_PAYLOD_XML2> .......
<DM_PAYLOD_XMLN>
<DE_PAYLOD_XML1>
<DE_PAYLOD_XML2> .......
<DE_PAYLOD_XMLN>
</Record>
<Record>
<OP_PAYLOD_XML2>
<GM_PAYLOD_XML1'>
<GM_PAYLOD_XML2'> .......
<GM_PAYLOD_XMLN'>
<DM_PAYLOD_XML1'>
<DM_PAYLOD_XML2'> .......
<DM_PAYLOD_XMLN'>
<DE_PAYLOD_XML1'>
<DE_PAYLOD_XML2'> .......
<DE_PAYLOD_XMLN'>
</Record>
<resultSet>
Appreciate your help in this regard!Hi,
A few questions :
How's your first query supposed to give you an XML output like you show ?
Is there something you're not telling us?
What's the content of, for example, <OP_PAYLOD_XML1> ?
I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
What's the db version BTW? -
Dropping multiple tables having common prefix in SQL Server 2000/2005
Hi
I used the below to drop tables having common prefix like 'GPN'
DECLARE @id varchar(255) DECLARE @dropCommand varchar(255) DECLARE tableCursor CURSOR FOR SELECT name FROM sys.tables WHERE NAME LIKE 'GPN%' OPEN tableCursor FETCH next FROM tableCursor INTO @id WHILE @@fetch_status=0 BEGIN SET @dropcommand = N'drop table ' + @id EXECUTE(@dropcommand) FETCH next FROM tableCursor INTO @id END CLOSE tableCursor DEALLOCATE tableCursor
The point is this works in SQL2005 but not in SQL2000
In SQL 2000 we get errors like
Server: Msg 137, Level 15, State 1, Line 2
Must declare the variable '@dropcommand'.
Server: Msg 137, Level 15, State 1, Line 2
Must declare the variable '@dropcommand'.
Tried the following as well : SELECT table_name FROM Information_Schema.TABLES WHERE table_name LIKE
but ended up with the same error.
Please let me know where i am going wrong and how i can correct it
PurushothamaHi.
As far as I know SQLS2000 uses syntax:
EXEC sp_executesql @dropcommand
Isn't this a problem?
Talerod -
SQLServer to oracle migration. Issue with table having image data.
Hi,
I am using the SQL Developer version 1.5.0.53 Build MAIN-53.38. I am trying to migrate from sql server database to oracle. Sql server database version is 2005 and oracle database version is 10g (10.1.0.2 and 10.2.0.3). Both Oracle and Sql server databases are on windows-xp.
Everything (including data) migrated well except for the one table having blob (oracle) and image(sqlserver). I am getting the following error in sql developer while migrating data for the blob from sql server to oracle.
Data Move information:Rows : 497 Errors: 10278
Commit failed: Closed Connection
Must be logged on to server
[POCRepository].[td].[REPOSITORY] Closed Connection
Io exception: Software caused connection abort: socket write error
[POCRepository].[td].[REPOSITORY] OALL8 is in an inconsistent state
No more data to read from socket
[POCRepository].[td].[REPOSITORY] No more data to read from socket
Inserting ' ' into column td_POCRepository.REPOSITORY.RP_DATA (Row number 498)
I have created sqldeveloper.cmd file as suggested in other threads and I am using the same java provided with SQL Developer 1.5.0.53.
The database alertsid.log shows the following error messages for this activity.
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [0x34EF9E5] [] [] [] []
ORA-00600: internal error code, arguments: [kghasp1], [0x5F3B718], [], [], [], [], [], []
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [0x34EF9E5] [] [] [] []
The error ORA-00600[kghasp1] refers to the problem with heap memory. I also restarted the database and tried the data migration for only this table but with the same error.
I tried it on both 10g release1 and 10g release 2.
Can someone please help me in resolving this issue.
Thanks
RaghavendraHi Raghavendra,
Are you saying the Microsoft SQL Server bcp dump of image data failed? It has been tested, it results in a hex dump rather than a binary dump, hence the clob to blob, and hextoraw workaround.
What are the version numbers and what is the reproducible test case?
-Turloch
Note that the clob to blob process is automated:
Tools->preferences->Migration->Generation Options->General Options->Generate Stored Procedure for Migrate Blobs Offline
From Help:
Generate Stored Procedure for Migrate Blobs Offline: Causes a stored procedure named CLOBtoBLOB_sqldeveloper (with execute access granted to public) to be created if the schema contains a BLOB (binary large object); this procedure is automatically called if you perform an offline capture. If this option is not checked, you will need to use the manual workaround described in Populating the Destination Database Using the Data Files. (After the offline capture, you can delete the CLOBtoBLOB_sqldeveloper procedure or remove execute access from public.) -
Trouble with the SQL smt to :list tables having more than 1000 rows
Please I trying to list only tables having more than 1000 rows, but the sql stmt below doesn't work, can someone gives me a tips
select table_name from user_tables where table_name in ( select table_name from user_tables where rownum > 1000 ) : The result is no rows!
But I know that I have at lest 50 tables having more than 1000 rows
Thanks a lot for the helpIf your tables are reasonably analyzed, then you can simply query:
SELECT table_name,
num_rows
FROM user_tables
WHERE num_rows >= 1000This will give you quite a reasonable estimate.
Otherwise you have to go for dynamic sql or use the data dictionary to help you generate suitable scripts .... -
PL/SQL Trying to update a table through trigger on the same table
Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
Message was edited by:
user625855CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
DECLARE
current_transport_id NUMBER;
check_value NUMBER;
check_block_id NUMBER;
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
current_transport_id := get_curent_trans_id; --function that gets the current transport_id
check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
IF check_value = 1 AND check_block_id = 0 THEN
create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
ELSE
null;
END IF;
END block_id_trigger;
Ok, I cleaned the code somewhat.
user625855 -
Handling mod_user in a table using trigger
Hi,
I have a table "test" with two columns value and mod_user. Currently the table has a before Update trigger to update the mod_user as system user
Now I have to modify the trigger to satisfy the below criteria
1) In an update statement If I manually set the mod_user, then it should be updated as defined in the update statement.
Eg:
UPDATE test
SET value = 1,
mod_user = 'xyz'
WHERE value = 4;
In the above scenario mod_user should be updated to 'xyz' in the table
2) If I do not mention any set clause for mod_user, then the default windows user should be updated in the table.
UPDATE test
SET value = 1
WHERE value =4;
In the above scenario mod_user should be updated as windows user in the table
The trigger statement I have used does not seem to be working.
CREATE OR REPLACE TRIGGER t_mod_test
BEFORE UPDATE OF value ON test
FOR EACH ROW
BEGIN
:new.mod_user := NVL(SYS_CONTEXT('USERENV','OS_USER'),USER);
END;
Any suggestions on how I can make the scenario working would be highly appreciated.
Thanks in advance
DasIt sounds like you want something like
SQL> create table test(
2 value number,
3 mod_user varchar2(100)
4 );
Table created.
SQL> create or replace trigger t_mod_test
2 before update on test
3 for each row
4 begin
5 if( updating( 'MOD_USER' ) )
6 then
7 null;
8 else
9 :new.mod_user := NVL( sys_context('USERENV', 'OS_USER')
10 ,user );
11 end if;
12 end;
13 /
Trigger created.
SQL> ed
Wrote file afiedt.buf
1 create or replace trigger t_mod_test
2 before update on test
3 for each row
4 begin
5 if( not updating( 'MOD_USER' ) )
6 then
7 :new.mod_user := NVL( sys_context('USERENV', 'OS_USER')
8 ,user );
9 end if;
10* end;
SQL> /
Trigger created.
SQL> insert into test values( 4, 'xyz' );
1 row created.
SQL> update test
2 set value = 1
3 ,mod_user = 'abc'
4 where value = 4;
1 row updated.
SQL> select * from test;
VALUE MOD_USER
1 abc
SQL> update test
2 set value = 2
3 where value = 1;
1 row updated.
SQL> select * from test;
VALUE
MOD_USER
2
JCAVEDDBC64\jcave
SQL>Justin -
*& Report ZRAHUL_ALV_SFLIGHT2
REPORT zrahul_alv_sflight2 NO STANDARD PAGE HEADING.
TYPE-POOLS slis.
DATA: fcat TYPE slis_fieldcat_alv,
it_fcat TYPE slis_t_fieldcat_alv,
fcat1 TYPE slis_fieldcat_alv,
it_fcat1 TYPE slis_t_fieldcat_alv,
fcat2 TYPE slis_fieldcat_alv,
it_fcat2 TYPE slis_t_fieldcat_alv,
lout TYPE slis_layout_alv,
head TYPE slis_listheader,
it_head TYPE slis_t_listheader.
TABLES: SFLIGHT, SCURX, SAPLANE.
DATA: BEGIN OF it_sflight OCCURS 0,
carrid TYPE sflight-carrid, "PK
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
currency TYPE sflight-currency, "FK 1
planetype TYPE sflight-planetype, "FK 2
END OF it_sflight.
DATA: BEGIN OF it_scurx OCCURS 0,
currkey TYPE scurx-currkey, "PK 1
currdec TYPE scurx-currdec,
END OF it_scurx.
DATA: BEGIN OF it_saplane OCCURS 0,
planetype TYPE saplane-planetype, "PK 2
seatsmax TYPE saplane-seatsmax,
tankcap TYPE saplane-tankcap,
weight TYPE saplane-weight,
END OF it_saplane.
SELECTION-SCREEN: BEGIN OF BLOCK blk WITH FRAME TITLE t.
SELECT-OPTIONS: id FOR it_sflight-carrid,
id2 FOR it_sflight-connid.
SELECTION-SCREEN END OF BLOCK blk.
INITIALIZATION.
t = 'enter required criterias'.
lout-zebra = 'X'.
START-OF-SELECTION.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight
WHERE carrid IN id AND connid IN id2.
END-OF-SELECTION.
****FCAT F0R IT_SFLIGHT
fcat-col_pos = 1.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CARRID'.
fcat-outputlen = 10.
fcat-seltext_m = 'PLANE ID'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 2.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CONNID'.
fcat-outputlen = 10.
fcat-seltext_m = 'CONN ID'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 3.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'FLDATE'.
fcat-outputlen = 10.
fcat-seltext_m = 'FLDATE'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 4.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CURRENCY'.
fcat-outputlen = 10.
fcat-seltext_m = 'CURRENCY'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 5.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = ';PLANETYPE'.
fcat-outputlen = 10.
fcat-seltext_m = 'PLANETYPE'.
APPEND fcat TO it_fcat.
CLEAR fcat.
*****GRID DISPLAY
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'CLICK'
i_callback_top_of_page = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'GRID 1'
I_GRID_SETTINGS =
is_layout = lout
it_fieldcat = it_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_sflight
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form header
text
FORM header.
CLEAR it_head.
head-typ = 'H'.
head-info = 'KINGFISHER'.
APPEND head TO it_head.
head-typ = 'S'.
head-key = 'KEY'.
head-info = 'AIRLINES'.
APPEND head TO it_head.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_head
i_logo = 'KING_LOGO'
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "header
*& Form CLICK
text
-->OK text
-->SEL text
FORM click USING ok TYPE sy-ucomm
sel TYPE slis_selfield.
CLEAR it_fcat.
CASE ok.
WHEN '&IC1'.
********SAPLANE RELATION
READ TABLE it_sflight INDEX sel-tabindex.
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE it_saplane WHERE planetype = it_sflight-planetype.
fcat-col_pos = 1.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'PLANETYPE'.
fcat-outputlen = 10.
fcat-seltext_m = 'TYPE OF PLANE'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 2.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'SEATSMAX'.
fcat-outputlen = 10.
fcat-seltext_m = 'MAX SEATS'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 3.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'TANKCAP'.
fcat-outputlen = 10.
fcat-seltext_m = 'FUEL TANK CAPACITY'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 4.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'WEIGHT'.
fcat-outputlen = 10.
fcat-seltext_m = 'WEIGHT F PLANE'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'GRID 2'
I_GRID_SETTINGS =
is_layout = LOUT
it_fieldcat = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = IT_SAPLANE
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*******SCURX RELATION
CLEAR: IT_FCAT2,IT_FCAT.
READ TABLE IT_SFLIGHT INDEX SEL-TABINDEX.
SELECT * FROM SCURX INTO CORRESPONDING FIELDS OF TABLE IT_SCURX WHERE CURRKEY = IT_SFLIGHT-CURRENCY.
FCAT2-COL_POS = 1.
FCAT2-TABNAME = 'IT_SCURX'.
FCAT2-FIELDNAME = 'CURRKEY'.
FCAT2-OUTPUTLEN = 15.
FCAT2-SELTEXT_M = 'CURRENCY'.
APPEND FCAT2 TO IT_FCAT2.
CLEAR FCAT2.
FCAT2-COL_POS = 2.
FCAT2-TABNAME = 'IT_SCURX'.
FCAT2-FIELDNAME = 'CURRDEC'.
FCAT2-OUTPUTLEN = 15.
FCAT2-SELTEXT_M = 'CURRENCY DEC'.
APPEND FCAT2 TO IT_FCAT2.
CLEAR FCAT2.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'GRID 3'
I_GRID_SETTINGS =
IS_LAYOUT = LOUT
IT_FIELDCAT = IT_FCAT2
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_SCURX
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDCASE.
ENDFORM. "click
this program runs fine when one navigation is used......but when both the foreign keys come in picture then its shows sequencialy...cant we jump directly to the third one which i require....
plz guide me.thank u.in short i want help on table having multiple foreign keys....and how to navigate in this when working on ALV reports.....
its easy when using interactive reports by using sy-cucol and sy-curow.....
reply asap.
thank u in advance. -
How to handle tables having volatile data
Hi,
We have a table in which we load millions of data and after validation a huge amount of data is deleted. After that the select statements (performing FTS) becomes slow. If we shrink the space, the queries becomes faster. But shrinking space requires additional time. We can consider creating index on the table. But the indexes will slow down the inserts.
I wanted to know, how do we handle such tables containing data which has volitile nature.
The database version is 10.2.0.5 and platform Windows server 2008.
Regards,Thanks Justin,
We can't truncate the table.
Basically, the application is for a credit card payment gateway. A credit card transaction may be a successful or unsuccessful transaction. All the data is pushed in flat file. The application loads the data(using SQL loader) in a temporary table and if the merchant_id is correct then the data is pushed in permanent table(say T1). The table T1 may contain successful as well as unsuccessful transations (The unsuccessful transactions have to be maintained for 30 days because of business compulsions). Once the validation is done, the successful transations are moved to different table and are deleted from T1.
Here I have referred T1 as a table having volatile data. We can't truncate it as it has still data which is required by business.
Hope I am clear.
Regards, -
How to read table fields form a table having length of 7 characters
HI all,
could you please tell me how to read table fields from a table having length 7 characters, i have requirement that in my ztable i have 30 fields out of which 20 fields are location fields, i want to select 20 fields which have 7 characters length.
please could any body suggest me on this issue.
thanks,
sre.hi,
try like this
create a data variable of type i as
data: len type i.
create internal table for 20 fields as
data:begin of itab,
fld 1 type .......
end of itab.
data:itab type itab1 occurs 0 with header line.
loop at itab2. // original internal table which all fields.
read table itab2 with index sy-tabix.
len = strlen (itab2-fld).
if len eq 7.
move itab2 itab1.
append itab1.
endif.
endloop.
if helpful reward some points.
with regards,
Suresh.A -
Insertion in Table having Column of object array type
Hi!
I want to make an object type and then the VARRAY of the that object type and then make table having column of VARRAY type.
How can i issue an Insert statement to insert values in columns of VARRAY type .
I will be thankful.
regards
ImranSee following discussion http://asktom.oracle.com/pls/ask/f?p=4950:8:11071256505039606339::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1583117527730
and let's thank again Tom !
Maybe you are looking for
-
Lightroom will not import my photos. It did up to a week ago. I have changed cards and cameras (both worked two weeks ago). I can import the photos to Picasa and iPhoto. I get the following error message: Some import operations were not per
-
Adobe AIR Installer.app and Comcast ID
Has anyone had trouble with installing the Adobe AIR Installer.app in order to have a comcast ID on your computer and TV?
-
Pick activity is not working properly while creating two or more file adapt
Hi, pick activity is not working properly while creating two or more file adapter for bpel process. bpel process compiled and deployed succesfully but while observing the wsdl file of deployed process you can find only one file adapter. so it polls o
-
Tried to do fresh reinstall...now I got problems.
For some reason when I restarted my ibook g4 I little icon of the earth would come up, it took extremely long to load, and my laptop was just acting slow. No problem! I'll just start fresh, which I needed to do anyways. I put in the install disk and
-
I have error 9808 what do i do
help me pelase