How to Update the DataSet populating from Stored Procedure with SYS_REFCURS

I created a dataset with the wizard of VS2010 and link each DataTableAdapter stored procedures to insert, update, delete and select (which returns a SYS_REFCURSOR). When you run the program recovery and visualize data in a form, but if I want to update data, there is no change. Use the following code to update, insert and delete:
BindinSourceEmployee.EndEdit ()
EmployeeTableAdapter.Update (DataSetHR.Employees)
Roberto

What is the problem you are trying to solve?
Presumably, when you're creating a stored procedure, you know what schema owns it. So it's pretty trivial to simply create a local variable L_OWNER in your procedure, assign it the value of the schema owner, and then use that owner. Most people don't really need to figure out at runtime what they already knew at compile time.
Barring that, you could inspect the data dictionary as user130038 suggested. That requires that you know the name of the procedure (which would likely also have to be a local variable that is initialized to a hard-coded value. And if there are multiple users that own procedures with the same name, it may not be reliable.
Inspecting the call stack is the most reliable and dynamic approach. But it is also the most costly in terms or runtime performance and in terms of code complexity.
Justin

Similar Messages

  • How to update the Dataset of a report running with universe?

    I am facing some issue in cross-tab.
    My requirement is , on click of any cell in cross-tab i want to convert  it into editable cell.
    Converting into editable cell is something which I achieved using below code:
    function onCellClick(e) {
      var text=this.innerHTML;
      var text = $.trim(this.innerHTML);
             $('<input />').attr({ type: 'text', name: 'text' }).appendTo($(this)).val(text).select().blur(
            function () {
                var newText = $(this).val();
                $(this).parent().text(newText).find('input').remove();
                var rIndex=$(this).closest('tr').index();
                data.data[rIndex]=newText;
                that.firePropertiesChanged(["data"]);
                //that.firePropertiesChanged(["visSelection"]);
        that.fireEvent("onSelect");
    I just modified the sample code.
    My report is  running with universe.
    Now I want to update the Dataset with this updated value.
    Can anyone provide any help on the same?
    Thanks

    Hi Michael,
    You got it right.
    Let me tell you the whole story:
    I have a weird requirement of creating editable grid. And the values which I edit into grid get saved into database.
    By using javascript I am able to edit grid cell item into HTML.
    Now after this I have two hitches:
    1. I am not able to get the updated cell values in Design Studio. I think this issues goes to SDK side. I try to create a external script variable and use this into Design Studio.But somehow it always throw blank.
    2.  I am not able to update dataset. I know updating the dataset permanently is not possible as its getting created from universe. But I just want to update the dataset so that any change in measure values also update total of that column.
    I start this thing this week only. So might be I am asking few stupid question. Please bear with me.
    Thanks
    Amit

  • How to execute Operating System commands from Stored procedure.

    Any help on how to execute Operating System commands from stored procedures will be appreciated.
    Nanditha.

    Search the forums for 'External Procedure' and you will find example code that has been posted before.

  • How to get the SSO user from PL/SQL with Windows native authen

    I connect to a 10g daabase using SSO through Windows Native Authentication wher the OID user mapps to a single Database user.
    I need to get the SSO user from pl/sql
    My fornt end is Portal & Forms

    Hmm, I see.
    Well your problem boils down to being in the database and needing to have access to web environment variables. The SSO sets specific variables in the environment but your stored procedure is not privy to them.
    Now having said that, note that the mod_plsql Web Toolkit has a utility for accessing cgi variables. For instance,
    owa_util.get_cgi_env('Osso-User-Dn')
    If your web application cannot capture the SSO info and pass it to the stored proc in a parameter, OWA may be the only way.
    Check out the Single Sign-On Developers Guide, specifically the part about developing statically protected PLSQL applications.
    Hope this helps.
    regards,
    tt

  • How to determine the schema name from stored function or procedure

    Hi all
    I need to find the way to determine the name of shema in which the given stored procedure residing. This SP is created with AUTHID CURRENT_USER what means that expression like SYS_CONTEXT('USERENV','CURRENT_USER') or SYS_CONTEXT('USERENV','CURRENT_SCHEMA') will be return the name of user or schema of user which calls given SP.
    can somebody help me?

    What is the problem you are trying to solve?
    Presumably, when you're creating a stored procedure, you know what schema owns it. So it's pretty trivial to simply create a local variable L_OWNER in your procedure, assign it the value of the schema owner, and then use that owner. Most people don't really need to figure out at runtime what they already knew at compile time.
    Barring that, you could inspect the data dictionary as user130038 suggested. That requires that you know the name of the procedure (which would likely also have to be a local variable that is initialized to a hard-coded value. And if there are multiple users that own procedures with the same name, it may not be reliable.
    Inspecting the call stack is the most reliable and dynamic approach. But it is also the most costly in terms or runtime performance and in terms of code complexity.
    Justin

  • How to pass the parameter of a stored procedure to iReport

    Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
    In the Report Query, i tried
    1. sp_storedprocedure ' value'
    2. sp_storedprocedure +''''+$P{parameter}+''''+
    3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank you

    For M$ SQL server I find that it only works when U use the fully qualified name...
    e.g. catalod.dbo.my_procedure_name 'variable'
    My full query in the Report Query window is something like this:
    EXEC arc.dbo.jasper_Invoice 1000
    Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
    To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
    CREATE PROC jasper_MyProc (@my_rec_id integer) AS
    SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
    ...to wrap your SELECT statement, then call the PROC
    Edited by: Sylinsr on Apr 22, 2008 4:23 PM

  • How to find the list of unused stored procedures in SQL Server 2005?

    Hi,
    I need to find out the list of stored procedures which are not in use.
    I found there is something called "sys.dm_exec_procedure_stats " for SQL server 2008.
    Can you please suggest your ides here to do the same job for SQL server 2005.
    Many Thanks.

    In SQL 2005 there is, sort of. This is query lists the last execution
    time for all SQL modules in a database:
       SELECT object_name(m.object_id), MAX(qs.last_execution_time)
       FROM   sys.sql_modules m
       LEFT   JOIN (sys.dm_exec_query_stats qs
                    CROSS APPLY sys.dm_exec_sql_text (qs.sql_handle) st) 
              ON m.object_id = st.objectid
             AND st.dbid = db_id()
       GROUP  BY object_name(m.object_id)
    But there are tons of caveats. The starting point of this query is
    the dynamic management view dm_exec_query_stats, and the contents is
    per *query plan*. If a stored procedure contains several queries, 
    there are more than one entry for the procedure in dm_exec_query_stats.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to get the file name from downloads folder with the applescript??

    Hi All..
    I am downloading an application to downloads folder, I need to install the same application after downloading programatically.
    So how do I get the filename in runtime while downloading or after downloading from downloads folder with Applescript or Java?
    Also my download URL link doesnot contain full name of the download file.
    Pls suggest.

    Hi,
    The best method is to use curl.
    Other methods are not reliable, but can work, it depends on several factors (what the script does, what the user does).
    Here is an example with the curl command:
    set tUrl to "http://sourceforge.net/projects/vlc/files/2.0.4/macosx/vlc-2.0.4.dmg/download?ac cel_key=60%3A1350656196%3Ahttp%253A//www.videolan.org/vlc/download-macosx.html%3 A7233e4e9%245818d66f39b0576e1e9c4a0f3b46b1991180bfdd&click_id=976a88ee-19f7-11e2 -9a21-0200ac1d1d8e&source=accel"
    set dFolder to path to downloads folder
    tell application "Finder" to set newFolder to (make new folder at dFolder) as string
    set f to quoted form of POSIX path of newFolder
    do shell script "cd " & f & " && curl -L " & tUrl & " -o 'vlc.dmg'" -- download  to file "vlc.dmg"
    set downloadedFile to newFolder & "vlc.dmg" --<-- HFS path
    --do something with the downloadedFile

  • How to extract the red layer from BayerRG8 file with VBAI?

    Dear readers,
    We're currentely trying to build a inspection program using a CVS and two cameras.
    A first question to help us: How can we extract the red layer from a Bayer RG8 image?
    To illustrate a lit bit more: lets take a picture of chilis and tomatoes plants. We would like to extract the red color of the picture to know where the vegetable are and if they are eatable.
    So, in a first time, we just want to see the red layer of the picture.
    On a second step, we would like to extract the poistion of the red areas and rank them according to intensities and store all the relevant data in a .txt file.
    Thank in advance for the time you will spend on that topic.
    Regards

    Maybe including a picture with the info you want would help. It sounds like you could use a detect object step (which works with color images), and you could get the position of all red objects. I would also recommend using the Hue plane instead of the Red plane to look for color since this is more robust to lighting changes. Once you have the bounding box for each red object, you can create a programmatic ROI around it and use the Measure Color step to get detailed color information about your reb objects. Here's a sample inspection that uses colored candy to give you an example of what I'm suggesting. Let us know if more specifically what you are looking for if this doesn't help. The example is in VBAI 2012. Let us know what version of VBAI you are using because this may affect what functionality you can use.
    Thanks,
    Brad
    Attachments:
    Color Example.zip ‏358 KB

  • How to select the max rowid from a subquery with group by

    Hi Gurus,
    Kindly help how to fix the following query because I'm getting Oracle error:ORA-01446.
    select * from edy_raw_data a
    where rowid in ( select max(rowid) from(
    select email,max(date_updated) from edy_raw_data b
    where b.email=a.email
    group by email ))
    The query select the max rowid from a sub query with group by.
    Thanks in Advance.
    Benjie

    Why do you need to compare with rowid?
    Wouldn't this suffice?
    select * from edy_raw_data a
    where (email,date_updated) = (select email, max(date_updated) from edy_raw_data b
                        where b.email=a.email
                        group by b.email ))* Note: untested

  • Launch the SQL*Loader From Stored Procedure???

    Is it possible to aaunch the SQL*Loader from a stored procedure? Please help!

    Try the documentation on external procedures

  • How to encrypt the source code of stored procedures ?

    Is it possible to encrypt the source code of the stored procedures so no one can read the content. I want to deliver a compiled code not the source
    Database 8i and later
    thanks in advance

    Wrap Utility<br>
    <br>
    Nicolas.

  • Shell script execution from stored procedure

    I am working on a project thallt requires a shell script be executed upon the execution of a stored procedure with Oracle 10g. I have researched the matter, but there does not seem to be much out there on how to execute lines of UNIX commands by use of a stored procedure. If anybody has ever gotten this to work, any information would be appreciated. If the task is impossible, let me know, I just could not confirm that it was not something that could be done.

    A combination of things can help you out here - none of which are easy or particularily secure.
    1) From plain PL/SQL, you can call 'external procedures'. That is basically a DLL or .so that the listener can load on demand, and that external procedure (EXTPROC) can run whatever you need from the C program. C can, in turn, call a shell.
    This is fairly well documented, but be aware that 1/2 of the info is in the PL/SQL docco and the other half in the Networking docco.
    A fair bit of info is available in metalink as well - if you have access, simply search on extproc.
    2) You can call a Java stored procedure which in turn has hooks to the outside world. That will probably require a PL/SQL to Java wrapper to make it available in your environment. Oracle has been using this one successfully for a while.
    3) Write the script using UTL_FILE and have a daemon look for, and execute, the script.
    4) Since you are using 10g, use the new job scheduler. It has excellent capability to interact with the OS, and it is available as a PL/SQL package (DBMS_SCHEDULER). I find the interface a bit heavy, but that could be wrapped by a library tailored to your specific needs.
    Let us know what you decide to do in the end (and why) - it is an interesting topic.

  • How to find out names of all stored procedures?

    Hi All,
    I need to find out the names of all stored procedures with parameters and return types. I can use DBA_SOURCE, but in this case I must parse TEXT to find out what I need. Is there any dictionary where the names, parameters and return types of stored procedures saved separately?
    Thanks,
    Andrej.

    Not much fair to bring this old post up, sorry!
    I am still looking for an answer to my post
    where are stored functions like ORA_HASH or GROUPING_ID

  • How to update the datasource 0CRM_LEAD_H using the BWA1 t-code from CRM

    Hi all,
    I would like to know how I can update the extractor 0CRM_LEAD_H from BWA1 t-code in CRM.
    If I see the datasource thru RSA5 the extract structure doesn't have the STATUS_LEAD field. but thru BWA1 I see the field in the extract structure, and the field has an "A" in the Selection column and I can't change it, the values could be:
    Field Attribute     Short Description
    A          Field in OLTP and BW Hidden by SAP
    M          Selection Required, Visible
              No Selection Possible, Visibility Set
    P          Selection Adjustable, Visibility Set
    X          Selection Adjustable, Visibility Set
    1          Pure Selection Field, Selection Set
    2          Pure Selection Field, Selection Set
    3          Selection Adjustable, Visibility Adjustable
    4          No Selection Possible, Visibility Adjustable
    The field is not In the Mapping tab.
    Do you know how I can include the field in the extraction?
    Regards, Federico

    In CRM badis are only used to do enhancement either for EEWB or enhancements (with filter or non filter).
    Still the standard exits (EXIT_SAPLRSAP_001,..004) can be used for populate the appened extract structure.
    How ever you can apply some tricks to make a dynamic call to function module.. or class methods (as the subroutine call are not advisable in OOPs concept)..
    Thanks,
    -J

Maybe you are looking for