How to get BOOLEAN from STORED FUNCTION
We are calling legacy PLSQL stored procedures and functions via named queries. This has worked fine so far, but there are some functions which return the type 'BOOLEAN'. e.g.
FUNCTION some_function( some_argument IN NUMBER) RETURN BOOLEAN;
Where the return type is BOOLEAN calling the named query fails with
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
A couple of threads have hinted that what we are trying to do is not possible:
How to get BOOLEAN from STORED PROCEDURES
Re: Creating Named Query: from OracleCallableStatement
This would possibly be due to 'restriction in the OCI layer'. Can anyone help? Is there really now way to call a valid PLSQL stored function via a named query when the return type is BOOLEAN?
thanks
I can't comment on possible issues you might have with the driver, but if it can be done in JDBC, it should be possible in TopLink.
TopLink has the StoredFunctionCall which extends the StoredProcedureCall but adds an unnamed ouput parameter in the first spot of its parameter list. You will need to get the databasefield and set its type to BOOLEAN ie:
DatabaseField returnField = (DatabaseField)yourStoredFunctionCall.getParameters().firstElement();
returnField.setName(name);
returnField.setSqlType(Type.BOOLEAN);Be sure not to use the setType() method, as I believe TopLink will try to use the Type.BIT when a boolean class is used as the classtype.
Best Regards,
Chris
Similar Messages
-
How to get CLOB from stored procedure via StoredProcedureCall
hi all
I got "sp" on server : procedure get_text(p_in in varchar2, o_list out clob);
in code:
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("get_text");
call.addNamedArgumentValue("p_in", new String("MyList"));
call.addNamedOutputArgument("o_list"); // <- out CLOB
Vector v = (Vector)this.m_UnitOfWorkt.executeSelectingCall( call ); // <- here I got error
but if o_list is varchar is all ok
so how to get data from clob?
Please help
Regards
KrzysztofPost Author: achaithanya
CA Forum: Data Connectivity and SQL
I'm connecting to database through stored procedure only.We have sybase installed on our local system so that we are given permissions only to access the stored procedures.When u see the fields in CR XI i.e Field explorer you are able to see only 1st result fileds.I connected to sybase and there i'm able to see the output of 1st & 2nd Result set.
Regards,
Chaithanya. -
How to get info from calling Function Module without passing it.
Hi,
I am facing a problem like from calling function module i want values of some variables and i dont want to change the import and export parameters, is there any way to get it done...
Thanks in advance...Hi,
It is possible only if you can find the memory id of the varibale.
You can find out it by debugging
<removed by moderator>
Edited by: Mike Pokraka on Aug 4, 2008 9:37 AM -
JDBC - How to Get Data from Stored Procedure?
Gurus,
I am using Oracle Thin JDBC driver. A stored procedure has an IN parameter and an OUT parameter. The type of OUT parameter is TABLE of RECORD which is defined in the PL/SQL package in which the stored procedure is included. My question is if there is any way to call this stored procedure and process the data returned by the OUT parameter in my Java code.
Thanks.
Larrydefine in the pl/sql block as a cursor
register the out parameter as an oracle.cursor
on the java program get an object (from the statement), casting it to an resultset and then you can work on it -
How to get response from such a function
How to get response from such a function (in MODULE USER_COMMAND_0010 INPUT I get "ODGOVOR" 'X'
FUNCTION Z_SEENKRAT.
""Local Interface:
*" EXPORTING
*" REFERENCE(ODGOVOR) TYPE MSEG-KZEAR
DATA ok_code LIKE sy-ucomm.
DATA: test like mseg-kzear.
BREAK-POINT.
call screen 10.
test = ODGOVOR.
ENDFUNCTION.
*& Module CLEAR_OK_CODE OUTPUT
text
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE. " CLEAR_OK_CODE OUTPUT
*& Module USER_COMMAND_0010 INPUT
text
MODULE USER_COMMAND_0010 INPUT.
DATA odgovor LIKE mseg-KZEAR.
CASE ok_code.
WHEN 'DA'.
ODGOVOR = 'X'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0010 INPUTHi,
You need to declare the ODGOVOR variable in the TOP include, then you will get the value
Regards
Sudheer -
Return type Boolean From Oracle Function
1. How do I get a return type of Boolean from Oracle function in Java?
2. I have a function fx overloaded in Oracle (8 variances) and I have trouble getting the right one in Java. Is 8 too high a figure or Java does not support calling overloaded functions or what?
Thanks for any help.I am facing a similar situation, where I have defined an overloaded function in one package (2 variants) which both return a type BOOLAN value.
I am having trouble to setting up an CallableStatemnt to call one of this functions from Java. Whenever I set the parameter with a BIT or NUMBER data type, I get an exception with java.lang.boolean during my
callablestatement.setobject( indez, parameter, OracleTypes.BIT );
or
callablestatement.setobject( indez, parameter, OracleTypes.NUMBER );
I have no problem calling the function from SQLPlus, but doing so from Java raises the exception. I have found no exact match in OracleTypes or java.sql.Types for a BOOLEAN data type.
In your response do you mean to modify the Function to return a NUMBER instead of a BOOLEAN, or do you mean to set the parameter as Types.NUMBER in the calling java code?
Thanks,
Fedro -
How to get value from list item
Hi all,
How to get value from list item?
I have a problem with the List Item object
in the Oracle forms.
How can I retrieve the selected item from
a list ?
I didn't find any function like 'list.GET_
SELECTED_ITEM()'...
thanks
BalaHello,
You get the value as for any other Forms item:
:value := :block.list_tem ;Francois -
How to get values/data stored in the database into a list-item.
how to get values/data stored in the database into a list-item.
i tried to make a list item without any values assigned to it...but i got the below error.
FRM-30191: No list items defined for required poplist.
or
FRM-32082: Invalid value for given item type.
List EMPNO
Item: EMPNO
Block: EMP
Form: MODULE5
FRM-30085: Unable to adjust form for output.
then according to some docs, i tried the the following for the trigger
when-new-form-instance
declare
rg_name varchar2(40) := 'emp_rec';
status number;
groupid recordgroup;
it_id item;
begin
it_id := Find_Item('empno');
groupid := create_group_from_query(rg_name, 'select empno from emp');
status := populate_group(groupid);
populate_list(it_id, groupid);
end;
but yet didnt work... :(
so how the heck do i get values fetched from the database table into the list item?for list items you need to values in the record group, one is the shown value and one is the returned value.
Check out the online help for the populate_list built-in.
You'll need something like select ename,ename from emp as the record group query. -
How to get the image stored in archieve link as an attachment in work item.
Hi All,
through transaction OAWD we are storing scanned images.
Once this transaction is executed a workitem appears in the inbox of the initiator with the scanned invoice as attachment.
When the user executes the work item FV60 screen is displayed where the user enters the data based on the scanned invoice attachment.
After the user Parks the document the custom workflow triggers and a workitem appears in the inbox of an approver.
Our requirement is that the scanned image should also appear as the attachment.
Can you please suggest how to get the image stored in archieve link as an attachment in work item.
Regards
ShraddhaHi Martin,
with every parked document a scanned image is linked.
I need to create a link under objects and attachments in the work item, such that when the user clicks that link the image is displayed.
At present the following functionality is available.
The BO used is FIPP
Objects and attachments:
parkeddocument:AK0108500001252008.(via FIPP binding with WIOBJECT_ID)
On clicking the link below objects and attachments: the parked document AK0108500001252008 opens in display mode.
Now we want to have 2 links:
parkeddocument:AK0108500001252008.
image.
When we click on the link image then the scanned invoice linked to the document should get opened.
I am able to get the image id of the the image through SAP_WAPI_GET__OBJECTS,
export parameter leading_object provides the detail.
But I am not able to figure out how to use it in my workflow to display it as an attachment.
Hope this will give a better understanding of my question.
can you please suggest as to how I should proceed with it. -
How to Get Millisec from Sysdate
Hello all
How to get millisec from sysdate.
Pls let me know da query ..You can't get milliseconds from SYSDATE. In 9i and upwards you can get them from a timestamp, whether it be from the built-in functions SYSTIMESTAMP and LOCALTIMESTAMP or a timestamp column/variable of your own.
Unfortunately, Oracle only supplies the means to extract seconds, but fortunately, this includes the millilseconds, which are easy enough to get to as the following demonstrates:-
SQL> select extract(second from localtimestamp) from dual;
EXTRACT(SECONDFROMLOCALTIMESTAMP)
42.765535
SQL> select mod(extract(second from systimestamp),1) from dual;
MOD(EXTRACT(SECONDFROMSYSTIMESTAMP),1)
.181223Regards
Adrian -
How to get string from jtextpane along with its attributes
sir,
How to get string from jtextpane along with its attributes
i,e font,size,style,color etc.
please help me out.
my mail id is [email protected]JTextPane extends JTextComponent
JTextComponent.getDocument()
a Document is a set of Element, see Document.getRootElements(). Each Element has attributes, stored within an AttributSet object see Element.getAttributes()
a Document can also be rendered as a String, see Document.getText( offest, length ), use it with 0 and Document.getLength() as parameters. -
How to get info from a layer which is applied with styles ?
How to get info from a layer ? such as ( apply style or not , which effect have applied on it etc..)
I really can't solve it , Who can hlep me.. By the way , I 'am using CS version.xtools/xlib/Styles.js has a set of functions for working with layer styles. I do not know if it works with CS. I wrote it several years ago for either CS or CS2. If this doesn't work, then nothing will. The script retrieves a layer's style by saving it to disk then parsing the file for the desired ActionDescriptor.
There is a function at the bottom of the file that tests the Styles.js API.
Styles.test = function() { var doc = app.activeDocument;
var layer0 = doc.artLayers[0];
var gdesc = Styles.getLayerStyleDescriptor(doc, layer0);
if (!gdesc) {
alert("There is no layer style associated with the layer");
return;
// this will set the layer style to another layer.
// var layer1 = doc.artLayers[1];
// Styles.setLayerStyleDescriptor(doc, layer1, gdesc);
if (!gdesc.hasKey(cTID('FrFX'))) { // look for a stroke effect
return;
var frfx = gdesc.getObjectValue(cTID('FrFX'));
if (!frfx.hasKey(cTID('Clr '))) { // look for the color
return;
var clr = frfx.getObjectValue(cTID('Clr '));
// we should really check that the objectType is RGBC
var r = clr.getDouble(cTID('Rd '));
var g = clr.getDouble(cTID('Grn '));
var b = clr.getDouble(cTID('Bl '));
if (r == 0 && g == 0xFF && b == 0xFF) {
return;
clr.putDouble(cTID('Rd '), 0);
clr.putDouble(cTID('Grn '), 0xFF);
clr.putDouble(cTID('Bl '), 0xFF);
frfx.putObject(cTID('Clr '), cTID('RGBC'), clr);
gdesc.putObject(cTID('FrFX'), cTID('FrFX'), frfx);
Styles.setLayerStyleDescriptor(doc, layer0, gdesc); -
How to get video from archived DVD projects (.dvdproj)
how to get video from archived DVD projects (.dvdproj)
Command (right) - click on the archived project file to open the package with the Finder. Go to the Contents/Resources/Assets/AV folder where the media files are stored.
OT -
How to get coordinates from Google Map
I wonder how to get coordinates from Google Map to JavaFX application when click has occured. Here is an example of code:
public class JavaFXApplication extends Application {
public void showCoordinates(String coords)
System.out.println("Coordinates: " + coords);
@Override public void start(Stage stage)
final WebView webView = new WebView();
final WebEngine webEngine = webView.getEngine();
webEngine.load(getClass().getResource("googlemap.html").toString());
webEngine.getLoadWorker().stateProperty().addListener(
new ChangeListener<State>() {
@Override
public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
if (newState == State.SUCCEEDED) {
JSObject window = (JSObject) webEngine.executeScript("window");
window.setMember("java", new JavaFXApplication());
BorderPane root = new BorderPane();
root.setCenter(webView);
stage.setTitle("Google maps");
Scene scene = new Scene(root,1000,700, Color.web("#666970"));
stage.setScene(scene);
stage.show();
public static void main(String[] args){
Application.launch(args);
// googlemap.html file
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100%; background-color: #666970; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(40.75089, -73.93804);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
panControl: true,
navigationControl: true,
streetViewControl: false,
backgroundColor: "#666970"
var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
document.map = map;
google.maps.event.addListener(map, 'click', function(event) {
//java.showCoordinates(event.latLng); ???
map.setCenter(location);
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>Edited by: krbltik on 03.10.2012 22:59Hi, welcome!
You may also have a look at GPS Info Qt, available for free at Ovi Store: http://store.ovi.com/content/165671
GPS Info Qt is a nice Qt app. I have it on my C6-01 and I like it.
Regards. -
How to get hostname from targetlist in custom deployment procedure?
When I make a simple procedure with a phase that will loop through a procedure hostname list
and a hostcmd or directive inside that will use the hostname ex change a configuration file. How to get hostname from the hostname targetlist?
I would rather not use $(hostname) or similar function if I can get the hostname from the target list.
Edited by: user476601 on 2012-09-06 05:59I have tried that and cannot get it to work.
I have tried to make a procedure with:
parameter
- parallel fase
- step directive with hostname parm based on simple sh script (echo $hostname)
- map hostname setvalue %TargetName%
In a hostcmd step you cannot access %TargetName% directly
it doesn't work. Please come with an example if you have tried it.
/René
Maybe you are looking for
-
I can make a mov OK but got wrong framerate for avi
Hi, I modified the jpegtoMovie.java to generate a avi file. I set up a int[] buffer to store the rgb values and stream it out to a file. When the format is QuickTime, everything is fine, however when I changed to AVI format, the windows media player
-
I have tried to install icloud 4.0 for windows and again is does not allow syncing with outlook 2013 calendar and contact, using windows 8.1 and IOS 8.02 (get - unexpected error)?
-
How do I know it is fully charged?
It's charging but how do I know when it is fully charged? Not a quick charge, but a full charge.
-
Material Leger - Materail to Material transfer situation
Hi All, We are in ECC 600 using ML-Actual Costing. In our process, we do a mat to mat transfer for FG A (Produced via production order) to FG B. Both FG A & FG B are at STD and with ML indicator 3. When we do month end closing, the variance for FG a
-
Hi I have try the "Downloading Documents from the Custom Table" from the guide: http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469.pdf I have made the Procedure and it works fine. I have now tryed to put the Procedure in a package,