Any way to encode/decode PL/SQL record types ?
Hello everyone,
I came to XDK because I was looking for an easy way or working around a JDBC driver limitation. Namely that it does not access PL/SQL record types. I thought the best way was to encode my package's public types into XML streams and wrap up each public routine into a set of routines receiving and exporting data in XML.
I installed XDK 9i/PL/SQL yesterday and tried it on my 8.1.6 db. So far so good.
However, I did not see anything that does not access directly the database. The only preocupation of XSU is to access directly the DB for a variety of select, insert...
Am I wrong ?
I'm looking for a routine that takes an XML varchar, a DTD varchar and some description of my type (to map tags to fields) and parses the whole thing...
Is there anything I could use to do that ???
Thanks in advance...
Alain
Marwim wrote:
You code should be instrumented. Whenever you need to debug/trace you switch it on and get a log fileor log table; it maybe a database parameter or simply a package variable, which you can set at runtime.
This will allow you to debug a production environment where you should never be allowed to change the code or to use adebugger.And very valuable advice this is...
Debugging needs to be part and parcel of a code unit (like a PL/SQL package), where you can execute it (in production or anywhere else) and tell it "+go forth, execute, and debug thyself+".
Similar Messages
-
Dbms_xmlgen using pl-sql record type
Hi
I want to pass pl-sql record type and want to generate xml. Can dbms_xmlgen access pl-sql record type instead of query?
OR please let me know any other package to pass pl-sql record type and generate XML.
Thanks in advanceCan dbms_xmlgen access pl-sql record type instead of query?Don't think so, but can't you pass the individual record components:
SQL> declare
type rec is record
a int,
b varchar2 (30)
r rec;
ctx int;
x xmltype;
begin
r.a := 1;
r.b := 'Michael';
ctx := dbms_xmlgen.newcontext ('select :x id, :y name from dual');
dbms_xmlgen.setbindvalue (ctx, 'x', r.a);
dbms_xmlgen.setbindvalue (ctx, 'y', r.b);
x := dbms_xmlgen.getxmltype (ctx);
dbms_output.put_line (x.getstringval ());
dbms_xmlgen.closecontext (ctx);
end;
<ROWSET>
<ROW>
<ID>1</ID>
<NAME>Michael</NAME>
</ROW>
</ROWSET>
PL/SQL procedure successfully completed.? -
Is there any way to differentiate between R12 gl records and 11I?
Hello all,
is there any way we can tell if a record is r12 or 11I aside from basing this on when we upgraded? We run reports that use reference_XX data from the g_je_lines table. The references have changed for R12 so we need to get the required data 2 different ways.
Thanks.You can use je_header_id.
Since it is sequential, you can say je_header_id >= x is R12. -
PL/SQL Record Type to XMLType
Hi,
I wanted to convert a pl/sql record type automatically with just one command using xmltype.createXML but I am wondering if anyone out there has used it this way or whether it is possible. I can't find any examples anywhere, and I didn't really want to do the hard work of doing it one element at a time using xmlelement & xmlattributes :-).....
e.g.,
l_record emp%rowtype;
l_xml xmltype;
begin
for l_record in (select * from emp)
loop
l_xml := xmltype.convertXML (l_record) ; --> is this possible?? I can do it on a cursor but it doesn't seem to like it if its a record type
end loop;
Thanks in anticipation.
M
Edited by: user12097147 on 3/11/2009 16:48You cannot pass just any record structure to a procedure and expects it to determine its structure and contents and give you XML in return.
Also when you call XMLTYPE(), you are essentially instantiating an object - and calling the constructor method of that class. There are a number of constructors that have different parameter signatures.
If you want XML from a table, then you should be using XML functions.. in the following fashion (there's a number of approaches you can use, depending on your requirements) :
SQL> select xmlElement( "Employee", xmlForest(e.empno, e.ename,e.job) ) as XML from emp e order by e.empno;
XML
<Employee><EMPNO>7369</EMPNO><ENAME>SMITH</ENAME><JOB>CLERK</JOB></Employee>
<Employee><EMPNO>7499</EMPNO><ENAME>ALLEN</ENAME><JOB>SALESMAN</JOB></Employee>
<Employee><EMPNO>7521</EMPNO><ENAME>WARD</ENAME><JOB>SALESMAN</JOB></Employee>
<Employee><EMPNO>7566</EMPNO><ENAME>JONES</ENAME><JOB>MANAGER</JOB></Employee>
<Employee><EMPNO>7654</EMPNO><ENAME>MARTIN</ENAME><JOB>SALESMAN</JOB></Employee>
<Employee><EMPNO>7698</EMPNO><ENAME>BLAKE</ENAME><JOB>MANAGER</JOB></Employee>
<Employee><EMPNO>7782</EMPNO><ENAME>CLARK</ENAME><JOB>MANAGER</JOB></Employee>
<Employee><EMPNO>7788</EMPNO><ENAME>SCOTT</ENAME><JOB>ANALYST</JOB></Employee>
<Employee><EMPNO>7839</EMPNO><ENAME>KING</ENAME><JOB>PRESIDENT</JOB></Employee>
<Employee><EMPNO>7844</EMPNO><ENAME>TURNER</ENAME><JOB>SALESMAN</JOB></Employee>
<Employee><EMPNO>7876</EMPNO><ENAME>ADAMS</ENAME><JOB>CLERK</JOB></Employee>
<Employee><EMPNO>7900</EMPNO><ENAME>JAMES</ENAME><JOB>CLERK</JOB></Employee>
<Employee><EMPNO>7902</EMPNO><ENAME>FORD</ENAME><JOB>ANALYST</JOB></Employee>
<Employee><EMPNO>7934</EMPNO><ENAME>MILLER</ENAME><JOB>CLERK</JOB></Employee>
14 rows selected. -
Can you confirm for me please? - jdbc to pl/sql record types
Hi, I was hoping somebody could confirm the following please? I've been researching this in the Oracle JDBC docs and the Internet, but would feel more comfortable if somebody would confirm my findings.
I have a 10g database pl/sql procedure that takes a pl/sql record type as both IN and OUT parameter. I'm not allowed to modify this legacy procedure, though I may create new supporting code.
My research shows there is no inherit support in JDBC for Oracle pl/sql record types as per the Oracle JDBC docs.
As a solution, if the procedure only returned a record type, my understanding is I could create a ref cursor in pl/sql, as well as a wrapper procedure that calls my original procedure, and returns the record type through the ref cursor. This could then be used by my JDBC code as JDBC supports ref cursors as a return type.
However in my case, as the record type is both an IN and OUT parameter of my procedure, my research so far says JDBC support for ref cursors does not allow the writing of value to the ref cursor to be submitted back to the database. Is this correct?
If this limitation exists, as such the better (and only?) solution is to create a shadow pl/sql procedure that takes all the record elements as separate IN OUT parameters and then create a private record based on the record type and pass it to the original procedure.
Is my research here correct? Any help appreciated.
Thanks & regards,
CM.Chris,
As far as I know, PL/SQL record types are not supported in JDBC.
I believe you may be able to use TopLink.
I think Kuassi Mensah may have some examples in his book Oracle Database Programming.
Alternatively, you could use an Oracle object instead of a PL/SQL record.
This would be similar to what you are suggesting except that instead of a ref cursor, you would transfer the PL/SQL record to an Oracle object.
Good Luck,
Avi. -
Return rows from pl-sql record type
We have a requirement to create function which returns cursor to java application. This cursor will have data from pl-sql record type.
Tried with pipelined function. I have written code below.
CREATE or replace PACKAGE test_pkg IS
TYPE tp_rec IS RECORD(tt_id INTEGER,tt_text VARCHAR2(40));
TYPE obj_tp_recs IS TABLE OF tp_rec;
TYPE obj_tp_recs1 IS TABLE OF tp_rec;
FUNCTION test_func RETURN tp_rec;
function type_out return obj_tp_recs1 PIPELINED;
PROCEDURE test_type (result out sys_refcursor);
END;
CREATE OR REPLACE PACKAGE BODY OMS.test_pkg IS
FUNCTION test_func RETURN tp_rec
AS
currec tp_rec;
BEGIN
currec.tt_id := 1;
currec.tt_text := 'test1';
END;
FUNCTION type_out RETURN obj_tp_recs1 PIPELINED
AS
currec1 test_pkg.tp_rec;
begin
currec1 := test_pkg.test_func;
PIPE ROW(currec1);
dbms_output.put_line(currec1.tt_id);
end;
PROCEDURE test_type (result out sys_refcursor)
AS
BEGIN
OPEN RESULT
FOR SELECT * FROM TABLE(test_pkg.type_out());
END;
END;
SQL> VARIABLE x REFCURSOR
SQL> exec test_pkg.test_type(:x);
PL/SQL procedure successfully completed.
SQL> print xThis code returns no data found exeception from function. How to achieve result 1 and test1 from above code?
Thanks in advanceSQL> VARIABLE x REFCURSOR
SQL> exec test_pkg.test_type(:x);
PL/SQL procedure successfully completed.
SQL> print x
ERROR:
ORA-06503: PL/SQL: Function returned without value
ORA-06512: at "SCOTT.TEST_PKG", line 8
ORA-06512: at "SCOTT.TEST_PKG", line 14
no rows selectedIf you look at test_func body it is missing return statement. Now:
SQL> CREATE OR REPLACE PACKAGE BODY test_pkg IS
2 FUNCTION test_func RETURN tp_rec
3 AS
4 currec tp_rec;
5 BEGIN
6 currec.tt_id := 1;
7 currec.tt_text := 'test1';
8 RETURN currec;
9 END;
10
11 FUNCTION type_out RETURN obj_tp_recs1 PIPELINED
12 AS
13 currec1 test_pkg.tp_rec;
14 begin
15 currec1 := test_pkg.test_func;
16 PIPE ROW(currec1);
17 dbms_output.put_line(currec1.tt_id);
18 end;
19
20 PROCEDURE test_type (result out sys_refcursor)
21 AS
22 BEGIN
23 OPEN RESULT
24 FOR SELECT * FROM TABLE(test_pkg.type_out());
25
26 END;
27 END;
28 /
Package body created.
SQL> exec test_pkg.test_type(:x);
PL/SQL procedure successfully completed.
SQL> print x
TT_ID TT_TEXT
1 test1
SQL> SY. -
Is there any way to hook into the SQL report pagination process?
I have a SQL report (based on EMP) with a radiogroup row selector.
The scenario 1 and 2 are in place
1) When the employee row radio group is clicked the P900007_JOB the text item is populated with the JOB for the employee.
2) When the page is initially displayed or submitted via the button the first row’s radio group is programmatically clicked and therefore populates the additional job information in P900007_JOB
Info (radio Group) Employee No Name
(+) 7369 SMITH
() 7499 ALLEN
() 7521 WARD
P900007_JOB CLERK
1-3 Next>
Once the report has been displayed and the next or previous pagination is used then none of the radio groups will be selected and the data in the P900007_JOB text item will still display the job of the last selected employee row.
What I require is on pagination some sort of mechanism to either
a) Call the page_init() that should then set the first row as selected and populate the text item via the programmatic click. (preferred option)
b) OR blank out the additional text item P900007_JOB.
Is there any way to hook into the pagination process?
I have a work around – Set the ‘Enable Partial Page Refresh’ to ‘No’ but this means a full refresh every time the pagination is used.
Details of my page
Report Region (Based on EMP table) – radio group as a row selector
select APEX_ITEM.RADIOGROUP(1,EMPNO,'X21',null) CHECKRG, EMPNO,
ENAME,
JOB
from EMP
Report Attributes -
Report template :- P900007_ROWTEMPLATE (custom template see later)
Report Attributes Substitution :- id="emp_report" (used in page_init see later)
Enable Partial Page Refresh :- Yes
Columns – All columns are selected as show but job is left out of the template below.
P900007_JOB - Text item in report region (disabled does not save state). Populated with the employees job when the radio group is clicked.
Control region :- HTML region that just holds a button <GO> just to submit the page and redirect back to the same page.
P900007_ROWTEMPLATE (named column row template)
Row template 1
<tr style="cursor: hand; cursor: pointer;" onmouseover="row_mouse_over(this, 1)" onmouseout="row_mouse_out(this, 1)" #HIGHLIGHT_ROW# ">
<td class="t15data" onclick="selectRow('#JOB#');">#CHECKRG# </td>
<td class="t15data">#EMPNO# </td>
<td class="t15data">#ENAME# </td>
</tr>
Before rows
<table class="t15standard" summary="" #REPORT_ATTRIBUTES# id="report_#REGION_STATIC_ID#" >
<th class="t15header" #ALIGNMENT# >Info</th>
<th class="t15header" #ALIGNMENT# >Employee Number</th>
<th class="t15header" #ALIGNMENT# >Name</th>
After Rows
<tr>
<td colspan="99" class="t15afterrows">
<span class="left">#EXTERNAL_LINK##CSV_LINK#</span>
<table style="float:right;text-align:right;" summary="pagination">
#PAGINATION#</table>
</td>
</tr>
</table>
*Javascript in page Header*
<script src="#WORKSPACE_IMAGES#apex_show_hide_region.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
function selectRow(pJob)
/* console.log('pete got here!'+pJob)*/
$x('P900007_JOB').value =pJob;
/* Start Page init*/
function *page_init*()
/* Used to set radio groups on reports */
/*console.log('START pete got here!');*/
var is_checked = false;
var l_check = $x_FormItems($x('emp_report'), 'radio');
/*Loop and set flag if checked*/
for(var i=0,len=l_check.length;i<len;i++)
if(l_check.checked){
is_checked = true;
/*end loop*/
/*If none checked force a click*/
if(!is_checked){
/*no longer need as doing click below*/
l_check[0].checked=true;
/*Force a click on the first radio group - extra details should then be
populated*/
var l_click = l_check[0].click();
/* console.log('END pete got here!');*/
/*END page_init*/
// -->
</script>
*Application shared component.* – This fires a DB packaged procedure when the page is loaded.
P330_PART_NO_HIST
Process Point On load after Body region
Process Text show_hide_memory.part_no_history_details();
*Packaged Procedure* – This kicks off the page_init javascript in the header (earlier) to click on the radio group in the first row.
PROCEDURE part_no_history_details AS
BEGIN
htp.prn('<script type="text/javascript">' || CHR(10));
htp.prn('<!--' || CHR(10));
htp.prn('page_init();'|| CHR(10));
htp.prn('//-->' || CHR(10));
htp.prn('</script>' || CHR(10));
END part_no_history_details;
Thanks Pete
Edited by: Pete @ LSC on 26-Jan-2010 06:56Anybody any ideas? Should I be looking down the route of using my own pagination buttons and adding my code to this?
There seems to be a routine $a_report that I can use for the pagination but I am finding it difficult to get the current first and last record values that I would need to pass. I've seen references to below in the form but when I'm using partial refresh they do not seem to change.
wwv_flow.g_flow_current_min_row
wwv_flow.g_flow_current_max_rows
wwv_flow.g_flow_current_rows_fetched
wwv_flow.g_request
Thanks Pete -
Any way to boost audio input when recording?
Hi; I have been recording speech interviews with Audio-Technica mics on a ProTools set-up and they've sounded great.
I've recently tried recording using the mics in Garageband using a M-Audio Mobile Pre USB, but the audio levels are always too low unless the subject is an inch or two from the mic, which isn't the best way to get quality audio.
Is there any way to boost the audio input when recording in GB or any other tricks people know of?
thx, CharlieI'm actually having the same problem, except I'm recording straight into the computer (no interface).
I tried using an MBox, but the computer won't even recognize it...(if anyone's got suggestions for why that is, I'll gladly take them...).
My main question is the same as Charles's, however - how come the input level is so soft when recording using the "Built-In Input" (where I can use a mic, and have mobility) as opposed to the "Built-In Microphone"? -
Any way to batch change all my title type slide colors?
I need to change about 50 titles I made in a timeline (project) to a different background color. Any way to do that in batch, or do I need to go through one at a time and fix them. Attached is a picture that makes it more clear what I mean.
You'll have to change each title individually. This is where some type of CSS functionality with titles would come in handy.
-
PL/SQL Record Type and Toplink
Can i call PL/SQL procedure having a parameter of record type in toplink. If yes, how it is possible?
Hi,
Record defines a representation of a database row as field=>value pairs.Whenever a query is exceuted the rows in the result set can be accessed thru RECORD interface.Can you be more elaborate on the question.
Are you trying to access the result set obtained after executing the Stored Proc using Record interface or you want to pass the Record as input parameter to Stored proc? -
Dont know if theres an adaptor on the way or if i have to wait for a thunderbolt capable vide recorder....
What ports are available on your digital video recorder?? If Firewire is the only digital interface on your video deck, then even if there was an adapter/cable (which there isn't any currently) that went from Thunderbolt-->Firewire, the speed would still step down to the speed of your firewire connection (400 or 800).
If you are wanting to take advantage of TB speeds (going from computer to video deck), then you may have to wait for awhile until some pro/pro-sumer level video decks come out.
If you already have a video recorder that captures SDI or HDMI (or just want to capture analog)... Blackmagic has a video converter available already...
http://www.blackmagic-design.com/products/ultrastudio3d/
Hope this helps... -
If I have to take an "off-screen" action while recording a video demo slide in Captivate I am forced to END and start a separate video demo to continue.
This fragments my demo and seems an unnecessary set of steps.
Is there a way to pause the recording for long enough, say to clear my throat, and then resume?
Thanks.Hi kjjr54,
Please refer to the link below:
Create Mobile Learning & Elearning Content. Screen Capture, Screen Recorder | Adobe Captivate 8
Hope this helps!
Regards,
Sheena -
Any way to position in some ALV record from other tcode ?
Hi
I have a Z program who calls the tcode FS10N, this tcode has an ALV Grid showing some records (the periods). If we select some period (some record) with cursor and only one click, the record selected heightens and became yellow.
I need in my Z program when it calls FS10N, this tcode appears with some record (some period) selected, just because the user wants to see easier the period he gives in the Z program.
Is this possible ??
I don't think so; i put in the parameters id the values for FS10N appears with the account, company and year giving in the Z program; but how can i select a FS10N period in the Z program ?
Any idea ?
Thanks
FrankHi
Don't have you think to do by yourself?.
The FS10N shows the records of GLT0 table and use fm FDBL_BALANCES_DISPLAY to show the data.
After doing doubleclick it call the std report RFITEMGL (the same assigned to trx FBL3N), so you could directly to do a submit.
See the form CALL_LINE_ITEM_REPORT of include LFDBLF02, here you can see how to fill the table for free-selection.
Max
Message was edited by: max bianchi -
Any way to encode faster ?
Hi
I have a Macbook Pro 2.5Ghz 4gb memory OSX 10.6.6
I encode a lot of EyeTVHD video clips.
It is a slow laborious process. I mean it takes 6 to 12 hours for some.
EyeTV tells me that even its own hardware driven Turbo264 would not enhance encode times with my setup.
My question is what is out there currently that speeds up encoding and burning dvd disks?
Will the new multi core processors speed things up?
Is the only way to buy a new $4000 Mac machine?
*And is it more important to have more GHz or more cores ?*
From what I've read the software has to be able to incorporate these new processors.
And one more question - why does iMovie not import Quicktime h.264 video format but will import h.264 files ?Hi jonsondonson-
The only way to get it to encode faster is to buy a faster machine.
No matter what speed the burner runs at, the Mac can only encode the video based on its processor speed. The more complicated the movie is with special effects and transitions the longer it will take to encode.
Luck-
-DP -
Is there any way to play the metronome without recording?
Sometimes I just want to sit and get the beat in my head first...The "count in" feature doesn't really give me enough time.
P.S.- Hangtime, if you answer this question, I want to personally thank you for all your advice...I just bought a 49 key midi player today and am messing around with it right now!Glad to hear that your happy with the controller (mine is 4 years old now and i'm still very pleased with it)
the best way to accomplish what you want to to create a click track. that way the "count-in" can be any length you desire, 2 bars, 3 bars, or 10 bars:
http://www.bulletsandbones.com/GB/Tutorials.html#allaboutclicktracks
Maybe you are looking for
-
Po Creation With Reference to contract
Dear Experts We are creating the purchase order with reference to contract the contract quantity not copied to po. it is asking to enter the qty. but it should copy the contract quantity. the same contract price also not copied to
-
How can I restore Bonjour?
-
Keying video that has similar colour background, advice please-image included.
Last-year I visited America, and on the last day managed to secure an interview with a WW2 Ace, which had to be done within a very short time span. Unfortunately this left me with a situation that I couldn't really control, and so I am in a situation
-
How much is it to upgrade from Acrobat XI to Acrobat XI Pro?
I don't think folks here can help me but the website just sends me here instead of allowing me to see a phone number or send an email to someone. So stupid.
-
How to move songs from mini to PC?
I have an iPod mini with songs that aren't on my PC. In iTunes, when I try to drag songs from the mini to a local playlist, iTunes doesn't allow it. Any suggestions?