Name of table that I need.
Hi,
I have been asked to produce report on the organization hierarchy of the organization in our hr/payroll system. I need the information avalibale on the HRMS Manager > Work Structure > Oraganization > Organization Hierrarchy screen. So far I have managed to work out where half of the information comes from.... this is the HR_Organization_Structure table . I manged to find this out after reviewing the ERD diagrams I have.
But unfortunatly I can't locate where the other half of this information comes from... This is the surbordinates information. Could soemone please advise me of the table I need to look at for the surbordinate information.
How do you generally identify the table you need, There are so many tables with organization in the naming, it will take me ages to ever find out what each table holds. My ERD isnt detailed enough to cover the table that holds surbordinates information. Does anyone have a bigger more detailed HR/Payroll ERD diagram? or is there a quicker/easier way of me identifying the table I need.
All advise would be very much appreciated.
Thanks in advance
Slow_moe wrote:
Maybe it is a reasonable question... in the HR forum! However, if you don't understand that it doesn't
make any sense whatsoever to many/most of the users here in the general SQL forum,
then you are certainly slower than me. Want my nick? :-)
Please don't respond.LOL, so one ought to be slaughted for asking in the wrong forum... I see where you're coming from though, and the reason for the ourburst.... It's totally unheard of... :-(
All credit to you Mr Fast... I take it you're beyond mistake especially a petty one like that.
On a second note a simple advice like previous contributer might have suffix... and if you cant do that... please do me a favour... Dont respond to my post.... I dont need your help!!! ... I know, I know, I know it must be my lost... knowing how clever you must be. :-(
Similar Messages
-
Tables that I need to check after the installation of OIM11G server
Hi All,
I just wanted to know what are all the tables that I have to check if my database is correctly configured for OIM11G or not. I configured my design console to the server that was installed at client environment. Everything looks fine except some issue with the form designer. If I try to save by giving the Table Name and Description I am getting the following error. I am able to login to the database through SQL Developer and able to create tables with the database user id which I used while installing OIM.
This is the error while creating the form
Error Keyword: DAE.DB_READ_FAILED
Description: Could not execute database read. The database encountered a problem with the specified SQL query.
Remedy: Check the database query. Contact your system adminstrator.
Action: E
Severity: H
Help URL:
Detail:
com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_READ_FAILEDDetail: SQL: select err_key, err_code, err_desc, err_rowver, err_remedy, err_count, err_last_occurance, err_action, err_help_url, err_severity from err where err_code='DOBJ.GET_INSERT_PERMISSION_FAILED'Description: Got a null connectionSQL State: Vendor Code: 0Additional Debug Info:com.thortech.xl.orb.dataaccess.tcDataAccessException
I logged in as XELSYSADM. and the group System Administrator has all the permissions ALLOW INSERT, WRITE ACCESS, DELETE ACCESS to the following permissions.
1.Form Information
2.Form Designer
3.Form.Lookup Definition
Wanted to know if my database is correct and all the scripts were run while installing the OIM Server.
can you help me to check if there is something to check at my database/ table space/tables?
This is w.r.t the problem I am facing.
Unable to Create/Update Forms in design console(OIM11G)Hi Venu,
1-You are able to download OIM Data Dictionary by Oracle metalink and check it:
go to all sources |search button on Oracle metalink.
1.1-Xellerate/OIM 9.x Data Dictionary [ID 377992.1]
1.2- OIM 11.1.1.3.0 Data Dictionary [ID 1164914.1]
Thru it you can check all entities, atributes, keys, views and relationships of OIM Data Model.
2-You follow all steps below, right?
http://download.oracle.com/docs/cd/E14571_01/install.1111/e10033/before.htm#BABEGHAC
I hope this help.
THiago Leoncio Guimaraes -
I have changed my Apple ID name and I want to change it on iCloud, however I am not able to delete the previous account because I need to turn off the Find my iPhone - and for that I need to log in with the old name and that is not working. Help anyone?
Hey tulgan,
This link will provide information on what to do after you change your Apple ID:
Apple ID: What to do after you change your Apple ID
http://support.apple.com/kb/HT5796
Welcome to Apple Support Communities!
Take care,
Delgadoh -
Table name input. and output i need all rows and columns using procedures
hi,
question: table name input. and output i need all rows and columns by using procedures.
thanks,
To AllAn example of using DBMS_SQL package to execute dynamic SQL (in this case to generate CSV data in a file)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
END LOOP;
-- DBMS_OUTPUT.PUT_LINE(v_finaltxt);
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
ELSE
v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
END CASE;
END LOOP;
-- DBMS_OUTPUT.PUT_LINE(v_finaltxt);
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required. -
Table that has the hier text names and the corresponding hier ID
Hi,
Would anyone happen to know the table that has the hier name text as it appears from the infoObject level and the corresponding Internal hierarchy ID (unique ID) for data element RSHIEID. I would want ot be bale to match the text name o f the hier to the hier ID.
Thanks
WillTrying to make it simpler taking the 0material hierarchy note that the 0material has been loaded with 3 different hierarchies:
fields in the H table:
HIEID - 434FLR9O6DX0XXJS3CLIYZODD (Refers to the particular hierarchy as mentioned I have 3 hierarchies loaded to 0Material)
OBJVERS - Active and so on
NODEID - 4 digit internal number of the hierarchy
These are the Keys that identifies the hierarchy uniquely in my case the 1st hierarchy.
Now if you want to find the nodes then based on the example above I will take the hierarchy id ie 434FLR9O6DX0XXJS3CLIYZODD for the field HIEID that would give me all the nodes of this hierarchy
Note: the HIEID for a particular hierarchy can be found from the HEADER info
Thanks,
Raj -
Source table has an xml column that I need to query before splitting into 2 tables.
Hi
I have a source table with an xml column that I need to query on the nodes and then depending on what data is in the node then to split it into 2 different tables. I don't think I can use conditional split so I am looking at just a straight Execute SQL Task.
Has anyone got any ideas on any other way of doing this?
Thanks for the help in advance.
DaveHi TheDish,
Your goal arguably can me accomplished using pure T-SQL only encompassing XPath or XQuery.
E.g. the XQuery would retrieve the nodes as explained in http://sqljudo.wordpress.com/2013/12/02/xpath-for-the-sql-server-dba/
And then you may want to use the WHERE clause to extract - insert the nodes that go to one or another table.
I don't see why SSIS is necessary, but you can run the same queries in two Data Sources, or Execute SQL Tasks (that capture a resultset).
Arthur
MyBlog
Twitter -
Need to know plugins name and matchname that run on the GPU
Hi,
I need to find all plugins (name and matchname) that works on the GPU.
Currently I found Mettle ShapeShifter and VideoCopilot Elements.
If you have a one of those plugins that run on the GPU, can you place it on a timeline, run this script and paste the result here ?
Thanks
function findFX(){
function gothruEachLayer(comp){
var compFX = []
for (var i = 1; i <= comp.numLayers; i++) {
var fx = comp.layer(i).property("Effects")
for (var ii = 1; ii <= fx.numProperties; ii++) {
var fxName = fx.property(ii).matchName;
compFX.push("[" +fx.property(ii).matchName +":"+fx.property(ii).name+"]")
return compFX
var myWindow = new Window ("dialog");
var myMessage = myWindow.add ("edittext", [0, 0, 1200, 1000], gothruEachLayer(app.project.activeItem), {multiline: true});
myWindow.show ( );
findFX()thanks, there might be a some of those that run on the GPU. I'll need to finish my search in the next week or so.
I think I'll have to download some trials to do that. But first I'll have to find out which plugin are GPU accelerated.
Right now, I know that VideoCopilot Element is, as both Mettle plugins Freeform and Shapeshifter, there is both CROSSPHERE .Koizumi plugins that are available on aescripts.com.
There is also the new CS6 renderer, ADBE Picasso. -
Need to update a table that contains large volume of xml data
Hi,
i want to update a table that contains large amount of XML data.
when execute the query it shows an error .
Xml parsing is failed .But tghe data in xml is well formed.don't know why its happening .
Pls help me on this.
Thanks,
Fahadbelow is my code..
pls do the needful.
create or replace
PROCEDURE SPFETCHRETRIEVEDATA (
p_txteordernum IN trnorderitem.TXTEORDERNUM%TYPE,
p_intversionnum IN trnorderitem.INTVERSIONNUM%TYPE ,
p_interrorcode OUT NUMBER)
AS
------variable declaration---
v_xmlorderitem XMLTYPE;
v_trnsiebelmodification XMLTYPE;
diff XMLTYPE;
BEGIN
BEGIN
select xmlorderitemxml into v_xmlorderitem
from trnorderitem
where TXTEORDERNUM= p_txteordernum
AND INTVERSIONNUM= p_intversionnum;
END;
--insert into tempxml values ('xmlorderitem',v_xmlorderitem);commit;
BEGIN
SELECT TrnSiebelModificationXML into v_trnsiebelmodification
from trnsiebelmodification
where TXTEORDERNUM= p_txteordernum
AND INTVERSIONNUM= p_intversionnum
AND TXTSIEBELFIELDNAME='Asset XML';
-- insert into tempxml values ('trnsiebelmodification',v_trnsiebelmodification);commit;
-- EXCEPTION
-- WHEN TOO_MANY_ROWS THEN
-- dbms_output.put_line('Statement return multiple rows');
END;
--------comparing differences between xml data and storing into a variable -----------
BEGIN
select xmldiff(v_xmlorderitem, v_trnsiebelmodification)
into diff
from dual;
--insert into tempxml values ('diffxml',diff);commit;
if diff IS NOT NULL THEN
UPDATE trnsiebelmodification
SET TXTACTIONTYPE='Update2'
WHERE TXTEORDERNUM= p_txteordernum
AND INTVERSIONNUM= p_intversionnum
AND TXTSIEBELFIELDNAME='Asset XML';
ELSE
UPDATE trnsiebelmodification
SET TXTACTIONTYPE='No Change2'
WHERE TXTEORDERNUM= p_txteordernum
AND INTVERSIONNUM= p_intversionnum
AND TXTSIEBELFIELDNAME='Asset XML';
END IF;
END;
END SPFETCHRETRIEVEDATA;Edited by: BluShadow on 11-Sep-2012 14:13
added {noformat}{noformat} tags. Please read: {message:id=9360002} and learn to do this yourself. -
I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.
Thanks for your response. I do believe I have the information needed for each form on a separate line in Excel. There is a first name, middle name, last name, city, and zip column. And field is entered on a different line for all the information. I'm really stuck.
-
My husband gave me his iPod touch, even after resetting all settings, and even though I have a user name and password, whenever I need to update apps it shows his previous user name, and is asking for his password. How do I fix that?
dom59 wrote:
Ok, when I go into my Apple ID account, everything looks right. It does show my user name. It's only on the iPod that it shows my husband's previous user name, and it asks for his password. Everything in iTunes and my account looks right. The issue only seems to be with the actual device, iPod Touch 4th gen.
There is more than one way to access the Apps Store and the iTunes store. One is via iTunes on your computer, and the other is via the apps on your iPod.
Just because you are logged in on your computer does not mean you are logged in on your iPod.
The reason your husband's user name comes up is because he was the last one to log on. You can change that by going to Settings>Store. Tap the Apple ID, Tap Sign Out, Tap Sign In, Tap Use Existing Appel ID, enter your e-mail address and Apple ID password, and tap OK. -
Name of the Table that stores the Possible Agent ID's for a Task.
Hi,
Could you please tell us the table that would store the Agent ID's that are assigned to a particular task? For e.g we have assigned a few user names to Task TS00007986 ( Requisition release) through OOCU, we would like to know in which table we would find those usernames assigned to that task.
Thanks.Hi,
I'm not on SAP at the moment.
But isn't it stored in the HR relation table (is it HRP1001?)
Anyways I'll check in a couple of hours if this is the case.
Also activate the SQL trace ST05 just before you go to agent assignment
Kind regards, Rob Dielemans
Edited by: Rob Dielemans on Sep 30, 2010 1:27 PM -
How to come up with a magic number for any table that returns more than 32KB?
I am in a unique situation where in I am trying to retrieve values from multiple tables and publish them as XML output. The problem is based on the condition a few tables could retrieve data more than 32KB and a few less than 32KB. Less than 32KB is not an issue as XML generation is smooth. The minute it reaches greater than 32KB it generates a run time error. Just wondering if there is any way to ensure that the minute the query's results is greater than 32 kb, it should break say - if the results is 35KB, then I should break that result into 32 KB and 3kb; once done then pass this data to be published as an XML output. This is again not just for one table, but all the tables that are called in the function.
Is there any way?? I am unable to get any ideas nor have I done anything so complex from production support stand point. Would appreciate if someone can guide me on this.
The way it is, is as follows:
I have a table called ctn_pub_cntl
CREATE TABLE CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id NUMBER(18)
,table_name VARCHAR2(50)
,last_pub_tms DATE
,queue_name VARCHAR2(50)
,dest_system VARCHAR2(50)
,frequency NUMBER(6)
,status VARCHAR2(8)
,record_create_tms DATE
,create_user_id VARCHAR2(8)
,record_update_tms DATE
,update_user_id VARCHAR2(8)
,CONSTRAINT ctn_pub_cntl_id_pk PRIMARY KEY(ctn_pub_cntl_id)
Data for this is:
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_SBDVSN'
,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.TSZ601.UNP'
,'SAP'
,15
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_TRACK_SGMNT_DN'
,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.WRKORD.UNP'
,'SAP'
,30
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_FXPLA_TRACK_LCTN_DN'
,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.YRDPLN.INPUT'
,'SAP'
,30
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.TSZ601.UNP'
,'SAP'
,120
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
,TO_DATE('04/23/2015 11:50:00PM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.YRDPLN.INPUT'
,'SAP'
,10
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_FIXED_PLANT_ASSET'
,TO_DATE('04/23/2015 11:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.WRKORD.UNP'
,'SAP'
,10
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_OPRLMT'
,TO_DATE('03/26/2015 7:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.WRKORD.UNP'
,'SAP'
,30
INSERT INTO CTNAPP.ctn_pub_cntl
(ctn_pub_cntl_id
,table_name
,last_pub_tms
,queue_name
,dest_system
,frequency
VALUES
(CTNAPP_SQNC.nextval
,'TRKFCG_OPRLMT_SGMNT_DN'
,TO_DATE('03/28/2015 12:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
,'UT.TSD.WRKORD.UNP'
,'SAP'
,30
COMMIT;
Once the above data is inserted and committed, then I created a function in a package:
CREATE OR REPLACE PACKAGE CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
IS
TYPE tNameTyp IS TABLE OF ctn_pub_cntl.table_name%TYPE INDEX BY BINARY_INTEGER;
g_tName tNameTyp;
TYPE tClobTyp IS TABLE OF CLOB INDEX BY BINARY_INTEGER;
g_tClob tClobTyp;
FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_count OUT NUMBER ) RETURN tClobTyp;
END CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH;
--Package body
CREATE OR REPLACE PACKAGE BODY CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
IS
doc xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
child_node xmldom.DOMNode;
child_elmt xmldom.DOMElement;
leaf_node xmldom.DOMNode;
elmt_value xmldom.DOMText;
tbl_node xmldom.DOMNode;
table_data XMLDOM.DOMDOCUMENTFRAGMENT;
l_ctx DBMS_XMLGEN.CTXHANDLE;
vStrSqlQuery VARCHAR2(32767);
l_clob tClobTyp;
l_xmltype XMLTYPE;
--Local Procedure to build XML header
PROCEDURE BuildCPRHeader IS
BEGIN
child_elmt := xmldom.createElement(doc, 'PUBLISH_HEADER');
child_node := xmldom.appendChild (root_node, xmldom.makeNode (child_elmt));
child_elmt := xmldom.createElement (doc, 'SOURCE_APLCTN_ID');
elmt_value := xmldom.createTextNode (doc, 'CTN');
leaf_node := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
leaf_node := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
child_elmt := xmldom.createElement (doc, 'SOURCE_PRGRM_ID');
elmt_value := xmldom.createTextNode (doc, 'VALUE');
leaf_node := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
leaf_node := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
child_elmt := xmldom.createElement (doc, 'SOURCE_CMPNT_ID');
elmt_value := xmldom.createTextNode (doc, 'VALUE');
leaf_node := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
leaf_node := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
child_elmt := xmldom.createElement (doc, 'PUBLISH_TMS');
elmt_value := xmldom.createTextNode (doc, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
leaf_node := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
leaf_node := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
END BuildCPRHeader;
--Get table data based on table name
FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_Count OUT NUMBER) RETURN tClobTyp IS
vTblName ctn_pub_cntl.table_name%TYPE;
vLastPubTms ctn_pub_cntl.last_pub_tms%TYPE;
BEGIN
g_vProcedureName:='GetCtnData';
g_vTableName:='CTN_PUB_CNTL';
SELECT table_name,last_pub_tms
INTO vTblName, vLastPubTms
FROM CTN_PUB_CNTL
WHERE ctn_pub_cntl_id=p_nInCtnPubCntlID;
-- Start the XML Message generation
doc := xmldom.newDOMDocument;
main_node := xmldom.makeNode(doc);
root_elmt := xmldom.createElement(doc, 'PUBLISH');
root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
--Append Table Data as Publish Header
BuildCPRHeader;
--Append Table Data as Publish Body
child_elmt := xmldom.createElement(doc, 'PUBLISH_BODY');
leaf_node := xmldom.appendChild (root_node, xmldom.makeNode(child_elmt));
DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT','''YYYY:MM:DD HH24:MI:SS''');
vStrSqlQuery := 'SELECT * FROM ' || vTblName
|| ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
-- || ' AND rownum < 16'
DBMS_OUTPUT.PUT_LINE(vStrSqlQuery);
l_ctx := DBMS_XMLGEN.NEWCONTEXT(vStrSqlQuery);
DBMS_XMLGEN.SETNULLHANDLING(l_ctx, 0);
DBMS_XMLGEN.SETROWSETTAG(l_ctx, vTblName);
-- Append Table Data as XML Fragment
l_clob(1):=DBMS_XMLGEN.GETXML(l_ctx);
elmt_value := xmldom.createTextNode (doc, l_clob(1));
leaf_node := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
xmldom.writeToBuffer (doc, l_clob(1));
l_clob(1):=REPLACE(l_clob(1),'<?xml version="1.0"?>', NULL);
l_clob(1):=REPLACE(l_clob(1),'<', '<');
l_clob(1):=REPLACE(l_clob(1),'>', '>');
RETURN l_clob;
DBMS_OUTPUT.put_line('Answer is' ||l_clob(1));
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.put_line('There is no data with' || SQLERRM);
g_vProcedureName:='GetCtnData';
g_vTableName:='CTN_PUB_CNTL';
g_vErrorMessage:=SQLERRM|| g_vErrorMessage;
g_nSqlCd:=SQLCODE;
ctn_log_error('ERROR',g_vErrorMessage,'SELECT',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR : ' || SQLERRM);
ctn_log_error('ERROR',g_vErrorMessage,'OTHERS',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
END GetCtnData;
PROCEDURE printClob (result IN OUT NOCOPY CLOB) IS
xmlstr VARCHAR2 (32767);
line VARCHAR2 (2000);
BEGIN
xmlstr := DBMS_LOB.SUBSTR (result, 32767);
LOOP
EXIT WHEN xmlstr IS NULL;
line := SUBSTR (xmlstr, 1, INSTR (xmlstr, CHR (10)) - 1);
DBMS_OUTPUT.put_line (line);
xmlstr := SUBSTR (xmlstr, INSTR (xmlstr, CHR (10)) + 1);
END LOOP;
END printClob;
END CTN_PUB_CNTL_EXTRACT_PUBLISH;
If you notice my query:
vStrSqlQuery := 'SELECT * FROM ' || vTblName
|| ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
|| ' AND rownum < 16'
The minute I comment
|| ' AND rownum < 16' ;
, it throws an error because this query returns around 600 rows and all of those rows need to be published as XML and the tragedy is that there is a C program in between as well i.e. C will call my packged functions and then will do all the processing. Once this is done will pass the results back to C program. So obviously C does not recognise CLOB and somewhere in the process I have to convert the CLOB to VARCHAR or instead of CLOB I have to use VARCHAR array as a return type. This is my challenge.
Anyone that can help me to find out the required magic number and also a brief know how, I would appreciate that. Many thanks in advance.Not sure I understand which part is failing.
Is it the C program calling your packaged function? Or does the error occur in the PL/SQL code, in which case you should be able to pinpoint where it's wrong?
A few comments :
1) Using DOM to build XML out of relational data? What for? Use SQL/XML functions.
2) Giving sample data is usually great, but it's not useful here since we can't run your code. We're missing the base tables.
3) This is wrong :
vStrSqlQuery := 'SELECT * FROM ' || vTblName || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
A bind variable should be used here for the date.
4) This is wrong :
elmt_value := xmldom.createTextNode (doc, l_clob(1));
createTextNode does not support CLOB so it will fail as soon as the CLOB you're trying to pass exceeds 32k.
Maybe that's the problem you're referring to?
5) This is most wrong :
l_clob(1):=REPLACE(l_clob(1),'<?xml version="1.0"?>', NULL);
l_clob(1):=REPLACE(l_clob(1),'<', '<');
l_clob(1):=REPLACE(l_clob(1),'>', '>');
I understand what you're trying to do but it's not the correct way.
You're trying to convert a text() node representing XML in escaped form back to XML content.
The problem is that there are other things to take care of besides just '<' and '>'.
If you want to insert an XML node into an existing document, treat that as an XML node, not as a string.
Anyway,
Anyone that can help me to find out the required magic number
That would be a bad idea. Fix what needs to be fixed.
And please clearly state which part is failing : the C program or the PL/SQL code?
I'd vote for PL/SQL, as pointed out in [4]. -
How do you find a table that doesn't have a specific word in it.
I have two questions.
questions 1
How do you find a table that doesn't have a specific word in it by using a query on the whole database?
questions 2
How would i list all of my cars names in my database not showing duplicates?
I have tried, tried and tried some more to get both of these, but I guess i don't know how to query a specific word.
I also don't know how to query everything in just 1 column name.
If anyone could help with these that would be great I have been trying queries for over an hour now and no luck.
Thanks798837 wrote:
I tried the all_tab_columns, just like you did it, however that just gives me the column name I am looking for what is not in a column.
For example I need to find all the tables where mustang is not = 'red' but using a single query i need to find all of the tables.
As for number 2
I am looking for something like this
select distinct column_name
from all_tab_columns
where column_name ='AcertainColumn';Now I'm even more confused. In your example, is MUSTANG a column name? Or is it the value of a MODEL column in the CARS table? And how could that possibly relate to something that exists in multiple tables?
If your data model is at all reasonable, I would expect that you would just want
SELECT *
FROM cars
WHERE model = 'Mustang'
AND color != 'Red'but I can't see how this would relate to data stored in multiple tables.
Justin -
How do I build a table that can be filled in by the user?
I'm trying to build a form where the user can easily add a qty to order a size. I haven't been able to do this other than adding a text field for every option. Can you build a table that would do the same thing (see my sample below)? Even better, is there a way to get it to total? All ideas appreciated!
Small
Med
Large
XL
Total
Style A
Style BHi,
You already have a good start at generating the table. All you need to do is change the cells from static text to either a numeric field or text field. You can do this by dragging a numericField from the Object Library and placing it inside the cell.
Once you have the numeric field in place, you can edit the properties, font, alignment, currency, validation, etc. Then copy and paste the field into similar cells and change the names, for example A_small, B_small etc.
The "Total" numeric field could have a Formcalc in the calculate event:
$ = A_small + A_med + A_large + A_xl
This is on the basis of a static table where you design all of the rows that will be available to the user.
You can also set up dynamic tables where the uer can add additional rows. There are plenty of good examples in the LC help and on the forums.
Good luck,
Niall -
JOIN 2 tables that have same column ?
I need to learn how to join two tables that both have the same column name:
tbl1 - idskey
tbl2 - idskey
the idskey column holds a id_number
When I do the JOIN I would like to make sure that only Distinct records are joined from both tables and that any duplicates are removed in the final join. So if:
Tbl1 has a idskey of: 12345
and
Tbl2 has a idskey of: 12345
In the final JOIN I want to remove one of those duplicates.
I actually need to join 3 tables that have the same linking column names for the join, but if I learn how to do this correctly on 2, that will be a start.
10g for db, thanks!Hi,
SELECT DISTINCT and GROUP BY are the most common ways to get unique results from non-unique keys. Exactly how you use them depends on exactly what you want to do.
SELECT DISTINCT guarantees that no two rows in the result set, conisdering all columns, will be identical.
GROUP BY produces one row from a set of rows that have a common feature. The values on that row may be a composite of values from various rows in that set (e.g., an average).
Please post a small, specific example. For instance:
"I have two rows in tbl1 ...
and these fhtee rows in tbl2 ...
Notice how there is one row with idskey=12345 in tbl1 but two such rows in tbl2.
How can I get theses results ...
where only one row has idskey=12345?"
Maybe you are looking for
-
How do I empty External Hard Drive Trash
My trash will only empty when I turn off the LeCie external hard drive, then when I restart the LeCie, the trash has the all the items/folders back like before. Any suggestions on emptying the external hard drive? It says that I have 1146 GB availabl
-
Safari flickering while scrolling up and down in os mavericks
Hello, I installed OSX Mavericks since yesterday, and I'm facing certain issues while using Safari. While trying to scroll up /down the screen flickers. Same thing applies while opening App Store. Haven't noticed it in any other app (i.e. Chrome). I'
-
How to locate "save" on download ?
I am able to downlaod Adobe as I see the bar downloading but I can't find a "save" featufe as required. Hos o I save and successfully install?
-
Edit a local copy of Project in Visual Studio Without Setting "Edit" flag in TFS
My local drive is mapped to TFS; every time I open up a project in Visual Studio and open up a file; the status of "Pending Changes" in TFS is updated to "Edit". How do I avoid that to happen?
-
Multiple domain Single repository
Hi all, We have a set up of multiple 8.1 SP2 domains running in SunOS, one for each developer. During the developement process, we want all the developers to access the same repository. How can we do this ? Thanks, Karthi.