FM to create Object Type(ET) - LSO
Hi all,
Can you please suggest me the function module which is used to create an object type "ET" which involves infotypes namely 1000, 1001, 1026. There's one LSO function module which is used typically when a student is booked into a new static Web Based Training Course Type (D), which automatically creates the ET.
Suggestions will be appreciated and suitable points will be rewarded.
Thanks in advance,
Vaishnavi.
Hi Vaishnavi,
If you have implementation knowledge on LSO, please can you help me?
plz mail me at [email protected]
Thanks in advance.
sadana.
Edited by: sadana saphr on May 21, 2008 9:22 AM
Similar Messages
-
Exception '1250' is not defined for method 'CREATE' object type 'MESSAGE'
Dear experts,
I set up the document distribution (SWU3, backgroundjob SMTP, activated the workflows, flagged the linkages, etc). Now, I have still a error:
Exception '1250' is not defined for method 'CREATE' object type 'MESSAGE'
Does anyone know what the cause of exception 1250 could be?
Thanks in advance and kind regards,
Samuelhi,
SAP ITS is SAP Internet Transaction Server which provides connection between SAP ERP system and html client.
Check with bassis, i think TCP/IP or work station application not configured yet. i guess?
Benakaraja
??P -
Creating object type u0093no objectu0094
We have created No objcet table SBO will create only code and name fields but create document table SBO will create DocEntry and also the Extra fields that will help to link to other documents.
Above things that we have clear idea
Could u tell me creating object type no object can we insert the data ..??
Or its compulsory to using UDO?using .srf is it possible ??? i have sending u code
error form bad datasource.. form Unique id 'MPPeriod',item unique id ' cmbppt'
but we check all unique id that is correct
Public Class payperiod
Private WithEvents SBO_Application As SAPbouiCOM.Application
Dim AddStarted As Boolean
Dim RedFlag As Boolean
Private oform As SAPbouiCOM.Form
Private oCodetext As SAPbouiCOM.EditText
Private noteedittext As SAPbouiCOM.EditText
Private daystext As SAPbouiCOM.EditText
Private worktext As SAPbouiCOM.EditText
Private starD As SAPbouiCOM.EditText
Private endD As SAPbouiCOM.EditText
Private Sub SetApplication()
AddStarted = False
RedFlag = False
'// Use an SboGuiApi object to establish connection
'// with the SAP Business One application and return an
'// initialized application object
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
SboGuiApi = New SAPbouiCOM.SboGuiApi
'// by following the steps specified above, the following
'// statement should be sufficient for either development or run mode
sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
'// connect to a running SBO Application
SboGuiApi.Connect(sConnectionString)
'// get an initialized application object
SBO_Application = SboGuiApi.GetApplication()
End Sub
Public Sub New()
MyBase.New()
SetApplication()
addmenuitems()
End Sub
Private Sub DrawForm()
Dim oitem As SAPbouiCOM.Item
Dim oCombopptype As SAPbouiCOM.ComboBox
Try
LoadFromXML("PayPeriodMaster.srf")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
oform = SBO_Application.Forms.Item("MPPeriod")
'''''''''combo for pay type
oitem = oform.Items.Item("cmbppt")
oCombopptype = oitem.Specific
oCombopptype.ValidValues.Add(CStr(3), "Employee")
' oCombopptype.ValidValues.Add(CStr(SAPbouiCOM.BoStatusBarMessageType.smt_Success), "Labour")
oCombopptype.ValidValues.Add(CStr(4), "Labour")
''''''' combo for code
oitem = oform.Items.Item("txtcode")
oCodetext = oitem.Specific
'''''''' startdate
oitem = oform.Items.Item("txtSDate")
starD = oitem.Specific
''''''''''end date
oitem = oform.Items.Item("txtEDate")
endD = oitem.Specific
''''''''''days in period
oitem = oform.Items.Item("txtDPrd")
daystext = oitem.Specific
'''''''''''' working days
oitem = oform.Items.Item("txtWDays")
worktext = oitem.Specific
''''''' notes''''''''''''
oitem = oform.Items.Item("txtNotes")
noteedittext = oitem.Specific
End Sub
Private Sub addmenuitems()
Dim oMenus As SAPbouiCOM.Menus ' the menus collection
Dim oMenuitem As SAPbouiCOM.MenuItem ' the new item
'get the menus collection from the application
oMenus = SBO_Application.Menus
Dim ocreationPackage As SAPbouiCOM.MenuCreationParams
ocreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuitem = SBO_Application.Menus.Item("2048") 'sales menu id
oMenus = oMenuitem.SubMenus
ocreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
ocreationPackage.UniqueID = "mnu1"
ocreationPackage.String = "Payperiod"
ocreationPackage.Enabled = True
ocreationPackage.Position = 15
Try
' if the menu already exist thus code will fail
oMenus.AddEx(ocreationPackage)
Catch ex As Exception ' menu already exist
MessageBox.Show("menu already exist")
End Try
End Sub
Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
If (pVal.MenuUID = "mnu1") And (pVal.BeforeAction = False) Then
Try
Dim f As SAPbouiCOM.Form
f = SBO_Application.Forms.Item("MPPeriod")
f.Select()
Catch ex As Exception
DrawForm()
End Try
End If
End Sub
Private Sub SBO_Application_StatusBarEvent(ByVal Text As String, ByVal MessageType As SAPbouiCOM.BoStatusBarMessageType) Handles SBO_Application.StatusBarEvent
If MessageType = SAPbouiCOM.BoStatusBarMessageType.smt_Error And AddStarted = True Then
RedFlag = True
End If
End Sub
Private Sub LoadFromXML(ByRef FileName As String)
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
'// load the content of the XML File
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\" & FileName)
'// load the form to the SBO application in one batch
SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
End Sub
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim oDocRec As SAPbobsCOM.Recordset
Dim f As SAPbouiCOM.Form
Dim s As String
' Events of the Blanket Agreement form
If (FormUID = "MPPeriod") Then
If (pVal.Before_Action = True) Then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.ItemUID = "1" Then
Dim objRecser As SAPbobsCOM.Recordset
objRecser = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
' SBO_Application.MessageBox("hi")
' objRecser.DoQuery("INSERT INTO [@MastPayPeriod]( Code,Name,U_PayPeriodTypeCode, U_PayPeriodCode, U_StartDate, U_EndDate, U_DaysInPeriod, U_WorkingDays, U_Notes) VALUES (1,1,'" & oform.Items.Item("cmbppt").Specific.Value & "','" & oform.Items.Item("txtCode").Specific.Value & "',& '"oform.Items.Item("cmbSDate").Specific.Value & "','"& oform.Items.Item("cmbEDate").Specific.Value & "','" & oform.Items.Item("txtDPrd").Specific.Value & "','" & oform.Items.Item("txtWDays").Specific.Value & "','" & oform.Items.Item("txtNotes").Specific.Value & "')")
objRecser.DoQuery("INSERT INTO [@MastPayPeriod](Code,Name,U_PayPeriodTypeCode, U_PayPeriodCode, U_StartDate, U_EndDate, U_DaysInPeriod, U_WorkingDays, U_Notes) VALUES (1,1,'" & oform.Items.Item("cmbppt").Specific.Value & "','" & oform.Items.Item("cmbCode").Specific.Value & "','" & oform.Items.Item("txtSDate").Specific.Value & "','" & oform.Items.Item("txtEDate").Specific.Value & "','" & oform.Items.Item("txtDPrd").Specific.Value & "','" & oform.Items.Item("txtWDays").Specific.Value & "','" & oform.Items.Item("txtNotes").Specific.Value & "')")
End If
End If
If (pVal.Before_Action = False) Then
If (pVal.ItemUID = "2") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
End If
End If
End If
End Sub
'Private Sub SaveAsXML(ByRef Form As SAPbouiCOM.Form)
' Dim oXmlDoc As Xml.XmlDocument
' Dim sXmlString As String
' oXmlDoc = New Xml.XmlDocument
' // get the form as an XML string
' sXmlString = Form.GetAsXML
' // load the form's XML string to the XML document object
' oXmlDoc.LoadXml(sXmlString)
' Dim sPath As String
' sPath = IO.Directory.GetParent(Application.StartupPath).ToString
' // save the XML Document
' oXmlDoc.Save((sPath & "\PayPeriodMaster.xml"))
'End Sub
End Class -
Create "Object" Type based on columns of a table
Hi Experts
is it possible to create an Object Type based on columns of a table?
for example the syntax for creation of type is
CREATE OR REPLACE TYPE temp_t
AS OBJECT (ID number, code number)
can we create a type that is based on columns of an existing table? so that we donot have to write down all the column names in each type as i have to create types based on 100 and above tables :-s
Please help me out here!
Best RegardsYou cannot do that Zia, check below code:
SQL> create or replace type temp_t as object(object_name all_objects.object_name%TYPE);
2 /
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE TEMP_T:
LINE/COL ERROR
0/0 PL/SQL: Compilation unit analysis terminated
1/35 PLS-00201: identifier 'ALL_OBJECTS.OBJECT_NAME' must be declared -
Can't create object types in forms 10
Hello,
I am trying to use object types in forms 10.
I have already created successfully two object types and also corresponding object views.
With one object type A everything works fine in form. But with the other object type B it doesn't.
I am calling the constructor of object B and after the constructor finshed, forms says that there is a numeric or value error.
Well, by nbow I have reduced attributes from object B so that they are identical to object A (which works). But still get the same error or if I use a different constructor I get NULL as a return value. I tested the constructors with test script in the database directly and viola - the constructor are working fine.
Only if I use the constructors in forms environment they fail.
Any ideas why this might happen?
Thank you
Matthias
Well, I fear to use the object types in my next project cause if I run into trouble if the object types are so easy with less code, what else might happen if they are filled up with much more code?Hello again,
I have tried again and still get the exception.
Now I provide the code. Perhaps someone can see, why this exceptioon occurs.
In the database I coded the following:
create or replace type GenericObject as object
-- Attributes
iVersion VARCHAR2(8),
-- Member functions and procedures
MEMBER FUNCTION toString(SELF IN OUT NOCOPY GenericObject) RETURN VARCHAR2,
FINAL MEMBER FUNCTION toString001(SELF IN OUT NOCOPY GenericObject) RETURN VARCHAR2,
NOT INSTANTIABLE MEMBER PROCEDURE log(pLogger IN OUT MyLogger)
) NOT INSTANTIABLE NOT FINAL
create or replace type body GenericObject is
-- Member procedures and functions
MEMBER FUNCTION toString(SELF IN OUT NOCOPY GenericObject) RETURN VARCHAR2 IS
BEGIN
RETURN SELF.toString001();
END;
FINAL MEMBER FUNCTION toString001(SELF IN OUT NOCOPY GenericObject) RETURN VARCHAR2 IS
BEGIN
RETURN 'GenericObject(' || SELF.iVersion || ')';
END;
end;
create or replace type MyTestA UNDER GenericObject
-- Attributes
iPk VARCHAR2(16),
iName VARCHAR2(100),
iDCN NUMBER,
-- constructor
CONSTRUCTOR FUNCTION MyTestA(pName VARCHAR2, pDummy INTEGER) RETURN SELF AS RESULT,
CONSTRUCTOR FUNCTION MyTestA(pPk VARCHAR2) RETURN SELF AS RESULT,
STATIC FUNCTION mycreate(pName VARCHAR2) RETURN MyTestA,
-- Member functions and procedures
OVERRIDING MEMBER FUNCTION toString(SELF IN OUT NOCOPY MyTestA) RETURN VARCHAR2,
FINAL MEMBER FUNCTION toString002(SELF IN OUT NOCOPY MyTestA) RETURN VARCHAR2,
OVERRIDING MEMBER PROCEDURE log(SELF IN OUT NOCOPY MyTestA, pLogger IN OUT MyLogger)
) NOT FINAL
create or replace type body MyTestA is
-- constructors
CONSTRUCTOR FUNCTION MyTestA(pName VARCHAR2, pDummy INTEGER) RETURN SELF AS RESULT IS
BEGIN
SELF.iVersion := '1.1';
SELF.iPk := 1;
SELF.iName := pName;
SELF.iDCN := 1;
RETURN;
END;
CONSTRUCTOR FUNCTION MyTestA(pPk VARCHAR2) RETURN SELF AS RESULT IS
BEGIN
SELECT VALUE(o) INTO SELF FROM v_testa o WHERE o.ipk = pPk;
RETURN;
END;
STATIC FUNCTION mycreate(pName VARCHAR2) RETURN MyTestA IS
BEGIN
RETURN MyTestA(pName, 1);
END;
-- Member procedures and functions
OVERRIDING MEMBER FUNCTION toString(SELF IN OUT NOCOPY MyTestA) RETURN VARCHAR2 IS
BEGIN
RETURN toString002();
END;
FINAL MEMBER FUNCTION toString002(SELF IN OUT NOCOPY MyTestA) RETURN VARCHAR2 IS
lvText VARCHAR2(1000);
BEGIN
lvText := SELF.toString001();
RETURN 'MyTestA(' || iPk || ', ' || iName || ', ' || 'lvHersteller.toString()' || ', ' || lvText || ')';
END;
OVERRIDING MEMBER PROCEDURE log(SELF IN OUT NOCOPY MyTestA, pLogger IN OUT MyLogger) IS
BEGIN
pLogger.log(toString());
END;
end;
CREATE OR REPLACE VIEW v_testa OF MyTesta
WITH OBJECT IDENTIFIER (iPk) AS
SELECT
'1.0' iVersion
,g.pk iPk, g.NAME iName, g.ora_rowscn iDCN FROM o_geraete g
DROP TABLE o_geraete;
CREATE TABLE
o_geraete
pk VARCHAR2(16)
, name VARCHAR2(100)
, hersteller_FK VARCHAR2(16)
, zaehlernummer VARCHAR2(20)
, dummy VARCHAR2(10)
INSERT INTO o_geraete
VALUES(
'100', 'Stromzähler', '1', 'AB-56', 'dumb'
INSERT INTO o_geraete
VALUES(
'200', 'Wasserzähler', '2', 'WS-09', 'dumb'
In forms I created a form from the view and coded into the on-insert-trigger:
declare
lvtest mytesta;
begin
message('1');
lvtest := new mytesta(:blk_testa.iname, 1);
message('2');
message('3' || lvtest.tostring());
exception
when others then
message('Exception: ' || sqlerrm);
end;
And in that forms block I got the exception.
Perhaps someone has ANY idea...
Thanx a lot
Matthias
Message was edited by:
user522343
Message was edited by:
user522343 -
Hi.
I am Creating Task i found options ... Object Type and method .. i think we can use user define/Created .. my question is what T Code is to create New Object type and method ... and further help or suggestion about its development
Regards
AmamdHi,
You should try to use Standard BO. Go to tcode SWO1 and you can do a search related to your requirements. If it exists a BO but it doesn't fullfill your requirements you can create a subtype of this BO by menu Settings > Delegate. In this way, you can inherit all of the BO and create your owns.
Regards, -
Use TYPE RECORD or Create Object TYPE to build Collection?
Hi All,
I need to pull in data from our ERP system via a DB Link to keep some of our Web Data up to date. I wasn't sure if I should pull the data into my collection by creating a TYPE RECORD or Creating an Object Type and fillng it that way. Is there a preferrable method?
Record:
TYPE ItemInventory IS RECORD (
ProductID Products.ProductID%TYPE,
Qty Products.QTY%TYPE);
Object:
Create Type ProdObj as Object(
ProductID Products.ProductID%TYPE,
QTY Products.QTY%TYPE);
Maybe both are suitable....wasn't sure.
Any suggestions/info is greatly apprecaited.
S
Edited by: ScarpacciOne on Feb 21, 2010 7:54 PMScarpacciOne wrote:
We have a complex view we use from our ERP system that allows us to pull all of our available inventory and update our website with that information. What I was thinking I would do is refactor the current procedures that are in place to update this information and pull that views information into a collection so that I could speed up the update process.The basic difference between the two is that one is a dumb record structure (similar to a C struct), whereas the other is an intelligent class (similar to a class definition in Java/C++). It can have methods and constructors.
The next major difference is that one can only be use in the PL language and not in SQL. The record struct is a PL data type definition. PL cannot provide SQL engine support for it.
On the other hand, the SQL type definition is supported by both the PL and SQL languages. This allows the type to be transparently used in both languages.
I usually prefer the SQL type definition approach in general, as it allows for more flexibility.
However, for pure collection processing in PL/SQL, there's very little to choose between the two approaches as they serve the exact same purpose - increasing performance by decreasing context switching between the PL and SQL engines.
So you need to look beyond mere bulk collection and bulk processing to decide on which approach to use. For example, a SQL type definition allows for a standard SQL projection from cursors, enabling PL/SQL code to be cursor agnostic (as each cursor, irrespective of the table(s) queried, returns the same object type). However, if the aim is simply to bulk collect from that specific cursor, then it is a lot simpler to use a PL record struct. -
Creating object type conflict dump
Hi All,
I have an interface zintf_1. I getting the list of classes that implemented the zintf_1.
There are some cases where the class wont have implemented the interface.
ZDEMO_AA class has not implemented the interface zintf_1.
data: lr_intf_1 type ref to zintf_1,
lv_clsname type SEOCLSNAME.
lv_clsname = 'ZDEMO_AAA'.
try.
create object lr_intf_1 type (lv_clsname).
catch cx_sy_create_object_error.
endtry.
In that case i m getting the dump "Type conflict with allocation of References".
Please help me to resolve the issue.
thanks
VimalrajI'm assuming that you're trying to trap the case the class lv_clsname doesn't actually implement the interface.
Well, the interface not being there is NOT a catchable error. So you have to find out whether the interface is implemented first.
DATA: lr_intf_1 TYPE REF TO zintf_1,
lv_clsname TYPE seoclsname,
lr_object TYPE REF TO cl_oo_class,
lt_intf TYPE seo_relkeys.
lv_clsname = 'ZDEMO_AAA'.
lr_object ?= cl_oo_object=>get_instance( lv_clsname ).
lt_intf = lr_object->get_implemented_interfaces( ).
READ TABLE lt_intf TRANSPORTING NO FIELDS WITH KEY refclsname = 'ZINTF_1'.
IF sy-subrc IS INITIAL.
CREATE OBJECT lr_intf_1
TYPE
(lv_clsname).
WRITE: 'it worked'.
ELSE.
WRITE / 'it failed'.
ENDIF.
matt -
Is there a switch for 'FORCE' when creating object type?
Where is the property to indicate whether or not to include the keyword FORCE when creating an object type?
Thanks, the support that SDDM provides for Object Types is much better than Oracle Designer. I am looking forward to the release where we can flag a method's parameter as 'DEFAULT NULL' and especially the ability to include an inherited or included attribute as part of the primary key or the primary key. With the last release where the method body is stubbed out with 'BEGIN NULL; END;' really provided the basic ability for rapid prototyping. Once the key 'FORCE' is in place, the ability to rapid prototype will become even more functional.
-
Create object type from multiple tables for select statement
Hi there,
I have 3 tables as given below and I wish to create an object type to group selected columns as 'attribute' from multiple tables.
I need to create 2 input parameters to pass in - 'attribute' and 'attribute value' in PL/SQL and these 2 parameters will be
passing in with 'column name' and 'column value'. e.g. 'configuration' - the column name, 'eval' - the column value.
Then, the PL/SQL will execute the select statement with the column and column value provided to output the record.
Pls advise and thank you.
table ccitemnumber
name null type
ccitemnumber not null varchar2(20)
configuration varchar2(20)
item_type varchar2(30)
table productmodel
productmodelnumber not null varchar2(6)
description varchar2(60)
accesstimems number
numberofheads varchar2(2)
generation varchar2(10)
numberofdiscs varchar2(2)
factoryapplication varchar2(150)
table topmodel
stmodelnumber not null varchar2(30)
productfamily varchar2(60
formfactor varchar2(10)
modelheight varchar2(10)
formattedcapacity number
formattedcapacity_uom varchar2(20)
object type in database
configuration varchar2(20)
item_type varchar2(30)
numberofheads varchar2(2)
generation varchar2(10)
numberofdiscs varchar2(2)
factoryapplication varchar2(150)
modelheight varchar2(10)
formattedcapacity number
formattedcapacuser12043838 wrote:
Reason to do this as these fields are required to be grouped together as they are created in different tables. They are treated as 'attribute' (consists of many columns) of the part number. So, the PL/SQL is requested to design in a way able for user to pass in the column name and column value or part number, then the select statement should be able to query for the records. Another reason is a new column can be added easily without keep modifying those effected programs. Reuseable too.This basically equates to ... hard to code, hard to maintain, and poor performance.
Are you really sure you want to do this? This isn't going to be easy-street as you seem to think it is, but it's a one way street to a poorly performing system with security vulnerabilities (google SQL Injection).
I would highly recommend you reconsider your design decision here. -
Creating object type no attributes... how???
Hi I need to creating any object type has no attribute, its possibily?
I need that only send to java class.
example:
create type t1 as object();
Oracle exception!!!! please help me, thanksNo attributes and no methods? You're talking about "incomplete types" in that case (at least in 10g).
A quote:
"An incomplete type is a type created by a forward type definition. It is called "incomplete" because it has a name but no attributes or methods. It can be referenced by other types, and so can be used to define types that refer to each other. However, you must fully specify the type before you can use it to create a table or an object column or a column of a nested table type."
If it fits your requirement, look here:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8001.htm#SQLRF01506
Boa sorte.
PS: It talks there about "SQLJ object type" but I never used them so I cannot comment. Check that out too. -
Can we create an associative array of Object type Column
Hi All,
I have a scenario where there are many PLSQL Types passed as IN and OUT params in a procedure. Since the Java cannnot access these types, we've plannned to create Object types.
However the can we create one Object type as below:
create or replace type T_EMP_REC as object
emp_id number(8),
dept_id number(8),
emp_name varchar2(50),
Then now I want to create an array of T_EMP_REC.emp_id and others respectively. Is this possible.
The reason for doing this is, that we may get many emp_id, dept_id and emp_name for a condition and hence pass on the same to Java application.
Please share your thoughts to achieve for such scenario. Any pseudo or code logic is much helpful.
Regards,Hi,
Sorry, this is forum is intended only for SQL Developer tool questions.
If you wish to pursue your question, mark this thread as answered and repost in the SQL and PL/SQL forum:
PL/SQL
Thanks,
Gary -
Urgent--==creation of object type in MASSOBJ transaction
hi all:
Could any one urgently tell me how to create object type in Massobj transaction.(this is done to delete purchase requisition in bulk in transaction 'Mass' (AND not in 'MASSOBJ').)
i have created in Massobj transaction by pressing 'new enteries' button, but several elements are missing.
so it give short dump after running transaction Mass.
Object type is created in Massobj transaction and executed in Mass transaction.
could anyone find solution for this urgetly.
thanx in advance
regards
rajHi,
There is an standard object BUS2105 to for the mass maintanance purpose.
You can directly go to MASS transaction and give the object type BUS2105 at the intial selection screen and don't mention any variant name.Execute it and displays the next screeen whereas you have the option to select the field you want and execute it again.Go to the next screen and specify the PR number range and specify the new value for the mass maintanace.After that you got to select the push button 'Carry out a mass change'.
I hope this would help you.
Thank you.
Regards,
karun.M -
XML attributes and object types
I want to create an XML Document of the following form
<family>
<parent attr1="val1">
<child attr2="val2" attr3="val3"/>
</parent>
</family>
Using object table and object type (for the child element), I am able to produce the following XML Document (with a "select * from family" query)
<family> <!-- rowset -->
<parent> <!-- row -->
<attr1>val1</attr1>
<child>
<attr2>val2</attr2>
<attr3>val3</attr3>
</child>
</parent>
</family>
The question is: how am I going to query these data so that the "attr" elements are mapped to attributes (using XSU only, without XSLT)?
I have already tried the following:
1. Using
SELECT attr1 as "@attr1",
f.child.attr2 "@attr2",
f.child.attr3 "@attr3"
FROM family f
all the attributes are obviously appended to the "parent" element.
2. Using nested table for "child" and the following query
SELECT attr1 as "@attr1",
CURSOR (
SELECT n.child.attr2 as "@attr2", n.child.attr3 as "@attr3"
FROM TABLE(f.child n)
) AS "child"
FROM family f
I am getting the following document
<family>
<parent attr1="val1">
<child>
<child_ROW attr2="val2" attr3="val3"/>
</child>
</parent>
</family>
Is there a smart SQL query to produce the desired document? What data types
is it recommended to use to define my db schema (object types, nested tables...)?
Thank you in advance
nullFinally, I got the desired XML format output from relational tablse using schema based XMLType views.
Wherein I created Object Types from relational table, generated the schema for the Object type, registered the schema and finally created XMLType Views for populating the XML data from Relational Tables.
I guess, you all might aware of my problem, where I got struck. Instead of printing the data in XML format I am successful in generating the XML format data Using the Query Select from BLABLA_Type_view* . I am able to print the number of rows, that I require which is in the fallowing format.
Column Name
1. SYS.XMLTYPE ----- As a row
The view I am querying for is printing the data in a string format, where in I got to do the fallowing query
SELECT SYS.XMLTYPE.getStringVal(OBJECT_VALUE) FROM BLABLA_Type_view. Which ultimately gave me the required data in XML format with tags.
Thanks for every one who tried to give a try to solve, especially "mdrake" -
How to call a Oracle Proc,which contains Object Type as in Param, from java
Hi
Would like to know how to call a Oracle Procedure which contains the Object Type Parameter from java.
Here is my code will look like...
1. CREATE OR REPLACE TYPE emp AS OBJECT
Empno NUMBER,
Ename VARCHAR2(50)
[COLOR=royalblue]In step1 I have created object type.[COLOR]
2.CREATE OR REPLACE PACKAGE ref_pkg IS
TYPE tab_emp IS TABLE OF emp;
END ref_pkg;
[COLOR=royalblue]In step2,I have created a table type which is of type emp;[COLOR]
3. CREATE OR REPLACE PROCEDURE p_emp(p_emptab IN ref_pkg.tab_emp) as
BEGIN
FOR I IN 1..p_emptab.COUNT
LOOP
Some code written here
END LOOP;
END;
[COLOR=royalblue]In step3 I have passed tabletype which is of type emp as argument.[COLOR]
Now I need to invoke this procedure from JAVA.
Calling a procedure doesn�t matter.
But how I can map objecttype ? how will java recognize oracle object ?
How can I implement this ?
Any Help/Clues is Appreciated.
Thanks
KrishnaHi Bob
You can call a stored proc from a database control with the jc:sql annotation itself.
Assume a stored proc taking one In parameter
* @jc:sql statement="call sp_updateData({id})"
void call_sp_updateCust(int id);
You can even call stored proc with OUT parameters using
* @jc:sql statement="{call sp_MyProc(?, ?)}"
void call_sp_MyProc(SQLParameter[] params)
You can also call stored functions via db control.
More info and diff ways to call at
http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
Thanks
Vimala
Maybe you are looking for
-
Return delivery without refrence to a PO
Dears I create a notification and move the material to block stock and create a return delivery by using action box with out refrence to any PO or any material documnet number Now in MD04 i can see this qty as return What is the next transaction step
-
<Lightroom novice> Can I import a tif image with a alpha channel in it? It seems as though LR will accept the image and allow development but when I export it as tif or psd it goes out as RGB only - the alpha channel is gone. I don't really "need" to
-
W8.1 User Device Enrollment - Setup.exe
Behavior: On W8.1 Enterprise upon logging into 'portal.manage.microsoft' for the first time then proceeding to device enrollment a download link is present for the full Intune client agent (as expected). If the user closes the browser without enrolli
-
How to fine-tune KM Navgation iView
Hi Experts, We have 6-7 KM navigation iviews on the homepage, all rendering xml news from different folders of KM. Now we have discovered that the maximum time of page loading is occupied by these navigation iviews(If we make these navigation iviews
-
Small windows appear and disappear quickly
Hello, Too often when I'm using my MBP, small windows (dialog boxes) appear and disappear very quickly. I don't know what application generated them, and they usually disappear before I get a chance to read them. Is there a way for me to see what pro