Problem calling an Oracle function with a return value

Hi,

Vitals....
Win2000
PB6.5
Oracle 8.05


I am attepting to fire off an oracle function, via PB, that will do an
insert (among other things) and then return the primary key of the
transaction it just inserted.  I have attempted (unsuccessfully!) to code it
using the Dynamic SQL Format #3 (code below).  I keep receiving "Procedure
has not been executed or has no results".

Code:

DECLARE mo_load DYNAMIC CURSOR FOR SQLSA;

ls_sql = "imf_create_im_master_order(" + string(idb_location_id) + ", " + &
    string(ldb_order_frequency_pk) + ", " + &
    "'" + ls_invoice_order_number + "', " + &
    string(adb_market_pk) + ", " + &
    string(adb_profile_pk) + ", " + &
    string(istr_vendor_order.num_days) + ")"

PREPARE SQLSA FROM :ls_sql USING sqlca;

OPEN DYNAMIC mo_load;
FETCH mo_load INTO :ldb_hdr_pk;
CLOSE mo_load;




Any info is welcome!

Thanks in advance.

Andy



0
Andrew
12/19/2001 8:13:29 PM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

2 Replies
1127 Views

Similar Articles

[PageSpeed] 33

Try declaring the function in a user transaction object using RPCFUNC.

Andrew Joos wrote in message ...
>Hi,
>
>Vitals....
>Win2000
>PB6.5
>Oracle 8.05
>
>
>I am attepting to fire off an oracle function, via PB, that will do an
>insert (among other things) and then return the primary key of the
>transaction it just inserted.  I have attempted (unsuccessfully!) to code
it
>using the Dynamic SQL Format #3 (code below).  I keep receiving "Procedure
>has not been executed or has no results".
>
>Code:
>
>DECLARE mo_load DYNAMIC CURSOR FOR SQLSA;
>
>ls_sql = "imf_create_im_master_order(" + string(idb_location_id) + ", " + &
>    string(ldb_order_frequency_pk) + ", " + &
>    "'" + ls_invoice_order_number + "', " + &
>    string(adb_market_pk) + ", " + &
>    string(adb_profile_pk) + ", " + &
>    string(istr_vendor_order.num_days) + ")"
>
>PREPARE SQLSA FROM :ls_sql USING sqlca;
>
>OPEN DYNAMIC mo_load;
>FETCH mo_load INTO :ldb_hdr_pk;
>CLOSE mo_load;
>
>
>
>
>Any info is welcome!
>
>Thanks in advance.
>
>Andy
>
>
>


0
Jerry
12/19/2001 9:36:56 PM
Worked great!!!  :)

Thanks Jerry

"Jerry Siegel" <jerrys@data-sci.com.NOSPAM> wrote in message
news:Ss6NjaNiBHA.234@forums.sybase.com...
> Try declaring the function in a user transaction object using RPCFUNC.
>
> Andrew Joos wrote in message ...
> >Hi,
> >
> >Vitals....
> >Win2000
> >PB6.5
> >Oracle 8.05
> >
> >
> >I am attepting to fire off an oracle function, via PB, that will do an
> >insert (among other things) and then return the primary key of the
> >transaction it just inserted.  I have attempted (unsuccessfully!) to code
> it
> >using the Dynamic SQL Format #3 (code below).  I keep receiving
"Procedure
> >has not been executed or has no results".
> >
> >Code:
> >
> >DECLARE mo_load DYNAMIC CURSOR FOR SQLSA;
> >
> >ls_sql = "imf_create_im_master_order(" + string(idb_location_id) + ", " +
&
> >    string(ldb_order_frequency_pk) + ", " + &
> >    "'" + ls_invoice_order_number + "', " + &
> >    string(adb_market_pk) + ", " + &
> >    string(adb_profile_pk) + ", " + &
> >    string(istr_vendor_order.num_days) + ")"
> >
> >PREPARE SQLSA FROM :ls_sql USING sqlca;
> >
> >OPEN DYNAMIC mo_load;
> >FETCH mo_load INTO :ldb_hdr_pk;
> >CLOSE mo_load;
> >
> >
> >
> >
> >Any info is welcome!
> >
> >Thanks in advance.
> >
> >Andy
> >
> >
> >
>
>


0
Andrew
12/19/2001 11:13:20 PM
Reply:

Similar Artilces:

Problem in getting Oracle function return value using ODP.net
 Dear AllI fall a problem by getting value from oracle function in asp.net. the code is as follows...the oracle function is ...start... create or replace function ultimus.FXN_GET_TRAN_DATE(pBRANCH_ID IN VARCHAR2) return date is-- ********************************************************************************-- Description: Get Branch Working Date-- ================================================================================  Result DATE;begin     Select  DECODE(a.day_status_id, 2, a.TRAN_DT, NULL) AS TRAN_DT      Into Resu...

How can i call a Oracle Function which return value is user defined record? SOS !!!!!
Package and Function: SPEC CREATE OR REPLACE PACKAGE PACKAGE_SUHUATEST AStype resp is record (resp_key varchar(30), app_name varchar2(15)); type resp_tab is table of resp INDEX BY BINARY_INTEGER; FUNCTION MyFunction(invar in varchar) return resp_tab ;  END PACKAGE_SUHUATEST;/   BODY CREATE OR REPLACE PACKAGE BODY MVL_SOX.PACKAGE_SUHUATEST AS   FUNCTION MyFunction(invar in varchar) return resp_tab  IS  record1 resp;  record2  resp;  allresult resp_tab;  BEGIN    record1.resp_key :='key1';    record1...

Calling MSSql User Defined Functions from Powerbuilder not returning proper decimal value.
Help Sqlserver 2005, Powerbuilder 9.0.2 and connected via the older MSS DB driver I have a Sqlserver user defined scalar function , dbo.fc_bto_agreement_calculated_amt(), that you pass in an ID and returns a MONEY datatype. and for a given agreement id of say 100, I except a value of 123.50 when I define a remote upc for the function in powerbuilder for SQLCA as this Function LONG FC_bto_agreement_calculated_amt(long claimagreement_id) RPCFUNC ALIAS FOR "dbo.fc_bto_agreement_calculated_amt" and test it, I get as expected, just the values to the left of t...

Anyone have PB9 called Oracle SP that calls c that returns values successfully?
Asking this for a coworker who's going crazy trying to figure out the problem He has PB9 calling Oracle SP that's calling a c function that was compiled using Oracle Pro C/C++ Precompiler. He's wanting the out variables returning data but they don't. I'm not really familiar with the Oracle parameter types so I'm not sure what the problem is: -- the sp as defined in our oracle 9i db CREATE OR REPLACE function job_description(is_spw varchar2, is_suserid varchar2, li_study_seq binary_integer, ls_survey_type varchar2, ls_item varchar2, ls_case_grp varchar2,...

Calls to Function not returning any values.
Hello and Help: I have a table lookup function that is called 3 times by a procedure, and only the last call results in a return of a value. I have tried everything I could think of to remedy the error, but I believe that I have made a basic coding error that I do not recognize and I cannot figure it out. The function is declared at the end of the Type area, just before the Private declaration. It is as follows: “ Function GammaLookup(GN : Double) : Double; ”. The actual function is a lengthy table, only the first and last parts are shown below: Function TFormMainFormBe...

Calls to Function not returning any values.
Hello and Help: I have a table lookup function that is called 3 times by a procedure, and only the last call results in a return of a value. I have tried everything I could think of to remedy the error, but I believe that I have made a basic coding error that I do not recognize and I cannot figure it out. The function is declared at the end of the Type area, just before the Private declaration. It is as follows: “ Function GammaLookup(GN : Double) : Double; ”. The actual function is a lengthy table, only the first and last parts are shown below: Function TFormMainFormBe...

Oracle Function with return value
Hi, I'm looking for a way to execute a oracle function, with parameters and a return value. I've tried declaring a transaction user object and also an execute from a string, but either way I couldn't figure a way to get the return value. Thanks a lot! You're on the right track. Declare the Oracle function as an external function in the transaction user object using RPCFUNC, set your application to use the user transaction object as the transaction class, then call the function: s_foo = SQLCA.fu_bar (foo, bar) and check SQLCA.SQLCode to make sure there wasn't an...

superreview granted: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" : [
David Bienvenu <bienvenu@nventure.com> has granted Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 168078: (Av2b) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=168078&action=edit ...

superreview cancelled: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" :
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has cancelled Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 166201: (Av1) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=166201&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkw...

superreview requested: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" : #2
Serge GAUTHERIE <gautheri@noos.fr> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 166201: (Av1) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=166201&action=edit ...

superreview requested: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" : #3
Serge GAUTHERIE <gautheri@noos.fr> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 168078: (Av2b) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=168078&action=edit ...

External Function Call Returning Values
How do I get the values back from an third party DLL written in C++ for Microsoft Windows OS. I have been give the Header file which defines the Function I am using. I am not receiving an error; but I do not get any values either. I have read through the PB documents on using functions from DLL but because I am not a C programmer I don't really understand. The vendor is not familiar with PB so has not been helpful. This is the only function that I have used that returns values. This is the definition of the Function from the Header file: typedef DWORD (DLLAPI *t_W...

Return values from a function that calls SetAbort()
I have a Jaguar component with a method that does database updates. If the update fails, the component calls SetAbort() and returns an errorcode. On the client the return value from the function is null and the error text which is returned as a reference parameter has no contents. This does not happen if I use SetComplete(). I think it has something to do with the error event on the connection object being triggered. I use Windows NT 4 sp3, Jaguar 3.0 and PowerBuilder 7. Code for the component: activate: GetContextService("TransactionServer",its_jag) SQLCA.DBMS = &qu...

calling a function where a database value is a parameter
HiI am trying to call my function. My function has one parameter and when I call the function I want to pass a database value as the parameter, but when I do that I get the following error: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.Here is my function:<script runat="server">Dim NewType As String = "None" Function CheckUnique(ByVal Val As String) As StringIf Val <> NewType ThenNewType = ValElseNewType = "Working?"End If Return NewTypeEnd Function </script>here is...

Web resources about - Problem calling an Oracle function with a return value - sybase.powerbuilder.database

Wave function - Wikipedia, the free encyclopedia
... (a ball attached to a spring ) in classical mechanics (A-B) and quantum mechanics (C-H). In quantum mechanics (C-H), the ball has a wave function ...

TV binging, exercise skipping linked to poor cognitive function
... their fit, less TV-addicted counterparts. In particular, couch potatoes had slightly lower brain processing speeds and worse executive function, ...

iPhone best tricks and functions - Business Insider
Your iPhone can do a lot more than you think.

Learning F# – Passing Parameters to Functions
One of the first issues I faced when learning F# was finding out how to specify multiple parameters to a function. While this might sound obvious ...

HPE Offers Catalog of Virtual Network Functions for Telcos
The vendor's OpenNFV Solution Portal gives carriers a single place to find a range of VNFs that are pre-tested to run on their networks.

7 Useful Technical SEO Functions For Your E-commerce Website
This article was co-authored by Mate Dyekiss, SEO Strategist at IMI. An e-commerce website can create all the technical SEO issues onecan imagine: ...

Using AWS Lambda functions to create print ready files
... going to tell you about our processing architecture as well as at a recent performance improvement with the integration of AWS Lambda functions. ...

Madras HC asks police to allow Tipu’s birth anniversary function
... Station on a petition filed by Ismail, General Secretary of Thamizhaga Makkal Jananayaga Katchi, seeking grant of permission to hold the function. ...

Colorado governor: This Planned Parenthood shooting may be a function of inflammatory rhetoric from bloggers ...
Via Grabien , skip to 4:45 of the clip below for the key bit. I naively thought we were (mostly) done with “climate of hate” stupidity after ...

Surprise: Binge-Watching TV May Cause a Decline in Brain Function
With the second season of Transparent only a few days away, some bad news awaits us: According to a recent study and common sense, probably, ...

Resources last updated: 12/31/2015 10:20:29 AM