Does SAP offer an equivalent of the PREPARE  command in ORACLE

Hi Experts,
Does anyone knows the equivalent of PREPARE statement in SAP. I'm currently coding using Native SQL & the DB is ORACLE. Here is the code:
SQLSTMT = 'SELECT PARTNER FROM BUT000'.
EXEC SQL.
   PREPARE STATEMENT_NAME FROM :SQLSTMT
   DECLARE C1 SCROLL CURSOR FOR STATEMENT_NAME
   OPEN C1
   FETCH NEXT C1 INTO :GPARTNER
ENDEXEC.
How do I make this work in SAP?

But once I had the problem to be "quite dynamic" in ABAP
well it may be it's not that general: I want to select on a table.
The tricky part was to what to fetch into ? At least I was dealing with one
table so I could get the structure into a work area using dereferencing it.
ABAP:
data :
dref type ref to data.
FIELD-SYMBOLS: <wa> type any.
don't know the table structure so I do it dynamically:
CREATE DATA dref TYPE (TABLENAME).
ASSIGN dref->* to <wa>.
OPEN CURSOR curs FOR
          SELECT     (PART_COLUMNS)
            FROM     (TABLENAME)
            WHERE    (l_where)
            GROUP BY (PART_COLUMNS).
  DO.
          FETCH NEXT CURSOR curs into CORRESPONDING FIELDS OF <wa>.
do whatever you need to do with <wa>
ENDDO.

Similar Messages

  • Equivalent to the Pivot command on Oracle 10g

    Hi,
    I have a requirement where i want change the below statement so it pivots on the day of the week
    select periodid, entrydate, duration
    from period
    where period_id = xxxx
    The above statement will return 7 records for each of the days of the week.
    I want these 7 days to become columns.
    Is there a way I can change this so is it
    select period_id_monday, monday_duration, period_id_tuesday, tuesday_duration,
    period_id_wednesday, wednesday_duration, period_id_thursdayday, thursday_duration,
    period_id_friday, friday_duration
    without having 7 separate sub queries.
    Pivot command in SQL server is only for group functions from what I remember
    Regards
    Stephen

    You could have googled or searched the forums! The method is
    select max(decode(to_char(entrydate, 'fmDAY', 'nls_date_language=english'), 'MONDAY', periodid)) monday_perodid,
           max(decode(to_char(entrydate, 'fmDAY', 'nls_date_language=english'), 'MONDAY', duration)) monday_duration,
    from   perod
    where  period_id = xxxxleaving you to fill in the blanks...
    Edited by: Boneist on 01-Jul-2009 12:01

  • Does apple offer a mount for the apple tv to the television

    does apple offer a mount for the apple tv to the television

    Velcro or duct tape would be the simplest and least expensive option. 

  • Does SAP have  function to allow the prices for the activities type to copy

    Hi Expert,
    Would like to seek for your help refer to above subject.
    Does SAP have  function to allow the prices for the activities type to copy from previuos fiscal year to current fiscal year so that we do not need to manually set up the acitvities types prices via KP26.
    What are the T-code and what are the configuration need to be set in order to use the function.
    Please help.
    Regards,
    KH

    Hi,
    Thank you for the prompt reply.
    However, would like to seek for your advise does SAP provide standard report to view the cost of activities incur?What are the T-code?
    Thank you.
    Regards,
    Karen

  • How to filter the "delete" command in oracle streams ?

    How to filter the "delete" command in oracle streams ? (oracle 9i R2 )
    Message was edited by:
    user507013

    Hello
    write a procedure doing "nothing" for delete transcation :
    connect adminstrm/..
    CREATE OR REPACE PROCEDURE write_delete_lcr (
    message IN SYS.ANYDATA,
    error_stack_depth IN NUMBER,
    error_numbers IN DBMS_UTILITY.NUMBER_ARRAY,
    error_messages IN EMSG_ARRAY )
    AS
    s_id sys.anydata ;
    ad SYS.ANYDATA;
    lcr SYS.LCR$_ROW_RECORD;
    ret PLS_INTEGER;
    vc VARCHAR2(30);
    apply_name VARCHAR2(30) ;
    errlog_rec log_errors%ROWTYPE ;
    ov2 SYS.LCR$_ROW_LIST;
    BEGIN
    return;
    End;
    for your apply do :
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => TABLE_NAME,
    object_type => 'TABLE',
    operation_name => 'DELETE',
    error_handler => true,
    user_procedure => 'write_delete_lcr',
    apply_database_link => NULL);
    END;
    Hafedh KADDACHI
    Oracle DBA

  • Does JDBC have an equivalent to the ADO GetRows method?

    In ADO you can retreive multiple rows at a time use the GetRows method. Is there any way with JDBC to retrieve multiple rows at a time?

    Well, the exact specifics of how the driver works are a little beyond my vision, but here's how I understand it. A stream is like a pipeline. When you make the query the databases begins pushing rows onto the pipeline at a predetermined rate (ie. n at a time).
    As long as you keep reading them with next(), the database keeps pushing more on until there are none left, or until you stop reading them. I think this is the premise behind the traditional database cursor as well. You didn't get the million, you got the first few of the million.
    The efficiency comes because if you get what you need after say twelve rows, you stop calling next. Without calling next, the database stops pushing more "reads" into the pipeline (or stream). This is why its nice to close the result set if you are done with it... it tells the database to stop sitting there waiting to push more rows along the stream.
    ADO does force the database to read all million. JDBC starts reading the million, and if you're done after twelve then the database only read twelve ...plus a few extra left on the stream ... but certainly nowhere near the whole million. Make sense? This is why Oracle, for instance, cannot tell you how many rows are held in a table unless you force it using the count aggregate. Oracle says "if you wanna know ...count em yourself!"
    I hope I have the concepts right here... anyone else is welcome to add their input.
    GumB.

  • Terminal does something strange when I use the 'say' command

    Hello,
    I use terminal frequently and have just nocticed something odd. When ever I use the 'say' command it said this:
               -                 -iMac:~                  $ say hello
    objc[1281]: Object 0x7ffcc2b1ee60 of class NSRunningApplication autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
    It doesn't really bother me, but I just want to make sure it is nothing serious
    - Thanks

    Could you describe this in more detail: did Firefox prevoiusly split the image over two pages and now it no longer does that?
    Or is the problem that there are two images, and if they do not both fit on the first page, Firefox is not printing the second page?
    Some page layouts may not print well when split across pages; there are some longstanding Firefox bugs. If this just started recently, those might not be relevant...
    Could you give an example URL of a page that has this problem, and indicate where the cutover is between scale percentages that work and those that no longer work?

  • Why Apple does not offer software to copy the content of my iPod Touch to my new computer?

    Hi, I got a new laptop. And I want the content of my iPod to copy to iTune on my new laptop. Is there Apple software to perform this function? I do find many third party software to do this function, but I have to pay that software. Can you help?

    You don't need to purchase additional software. This link may help you: http://support.apple.com/kb/HT4527

  • What effect does a transform function have on the _parent command

    Hi
    I am trying to load an image onto a symbol in a symbol, that
    is spinning via timeline>transform and forms a symbol called
    spinner1, spinner2. etc. I want every holder to be a different
    image and one use suggested using the _parent function with a
    substring function. Will the transform mess this up?
    I was suggested to try:
    holder.loadMovie("image"+this._parent._name.substring(7)+x);
    Which as I understand it tells any instance of the symbol
    "holder" to load an image called "image(the seventh letter of the
    parent symbol)x" So for any instance of holder in spinner1 it will
    load image1x.
    My images are assigned using the following:
    var image10:String = "logo/jamon.gif"; etc.
    "holder" is in "spinner_components"
    The symbol "spinner" contains "spinner_components" spinning
    using the transform function.
    Therefore I also tried the code as:
    holder.loadMovie("image"+this._parent._parent._parent_name.substring(7)+x);
    and also
    holder.loadMovie("image"+this._parent.._parent_name.substring(7)+x);
    Neither worked.
    Is it the transform function that is messing it all up? or
    some syntax?
    Thanks

    x is a varibale that increase each time it loops and changes
    the image displayed.
    x is 0, then 1 then 2
    spinner is spinner 0, spinner1, spinner2 etc.
    thus images should load image00, image01, image02 etc. should
    load in spinner0's holder
    and images 10,11, 12 etc. in spinner1's holder.
    where should this code go - at holder or spinner_components
    or spinner.
    You can see the final effect (I got arround this problem by
    making 8 almost identical spinners)
    at
    http://danielfield.freewebpage.org.
    only my images don't load, like they did in the flash editor.
    (I've posted on this separately).
    thanks.

  • Why does 10.7 not come with the unix command make? this is absurb.

    i need to install some perl modules that require make...the system doesn't have make on it...
    pretty annoyed.

    Install XCode 4.1 from the App Store (free)

  • Voice Control - does it learn and what's the "Wrong" command for?

    1) Like others, I find Voice Control laughably inaccurate sometimes when trying to get it to play an artist. I'm wondering if it "learns" and gets better the more you use it?
    2) In the manual, there's a command you can called "wrong" or "nope". In what situation would I use it? Whenever I've tried so far, by the time I get to say it, the original (incorrect) command has already executed!

    "Wrong" or "No" is for stopping a command and returning voice control to the listening phase. "Cancel" takes you out of voice control. If the command is to play or call a specific name, you can cancel it, but if it's a simple command like "play", "shuffle", "genius", or "what's playing" there is no cancel.
    VC for iPod control seems to have a serious bug. It's not inaccurate, it's just not working.
    There seems to be a condition where it will only recognize the first few artists in your library, and often not at all. I have restored my phone several times, rebuilt my iTunes library on the PC, and have yet to get it working properly.
    I have experienced, variously, after each restore and reload of the phone:
    - Voice control will not start, or never gets to where it is listening (with the waveform). This can usually be fixed by a hard reset.
    - Only artists from the first part of the alphabet are recognized. Only albums by these artists are recognized, regardless of letter. If I say anything else, it will pick the artist/album from these artists that sounds the most like what I say. One time it was artists A-F, the other time it was just the first 4 "A" artists. Contacts and playlists are recognized OK.
    - Even worse: No artists, albums, or playlists are recognized. Simple commands and contacts still work. This is where I'm at now, after a clean load of iTunes, a newly built iTunes library, a complete restore of the iPhone software, and set up as a NEW phone (no backup restored). That's as clean as you can get.
    I've been to the Genius Bar, and I've called support. Both times they have escalated my case to an an engineer. Apple is willing to replace my phone in-store tomorrow, but I don't think it is a hardware problem: The mic works, the headset mic works, and other VC features work.
    The only thing I can think of at this point is there is some artist/album name in my library that is causing it to fail?

  • Why does firefox sync not give me the firefox I had before i reloaded my operating system?

    I set up a firefox sync account and reloaded my operating system on my laptop. I reinstalled firefox and synced my laptop. I have all my bookmarks back. but none of my add-ons, plug-ins and shortcuts. I am left with a "virgin" firefox. Help. I want my old firefox back

    Firefox Sync doesn't sync add-ons or plugins. Mozilla does intend offering that feature in the future. What do you mean by "shortcuts'?
    https://support.mozilla.com/en-US/kb/what-firefox-sync <br />
    ''' Firefox Sync is a service that lets you synchronize your bookmarks, history, passwords and open tabs with another copy of Firefox – like one on another computer or on a mobile phone.'''

  • LabView equivalent to running batch files using the "shell" command (VisualBasic)

    I'm converting a VisualBasic app to LabView and am having trouble figuring out how to run a batch file with LabView.
    The VB code that I'm trying to replicate is:
    'UNLOAD RTX DRIVERS
    Dim ProcessId As Long
    ProcessId = Shell(App.Path + "\UnloadReloadRTX.bat", vbNormalFocus)
    Wait 400
    I haven't found a LabView equivalent to the Shell command. Any suggestions will be appreciated.
    thanks,
    Todd

    It seems as if this question pops up every week. Use the System Exec.vi found under Funtions - Communications palette. It is the equivalent of Shell.
    - tbob
    Inventor of the WORM Global

  • How to rename the column name in oracle 8i?

    hi,
    Does anyone know how to rename the column name in oracle 8i?My method was drop the relationship key first then delete the old column,finally add the new column.
    Thanks for your replay.
    jing

    There is no facilty to rename a column name in Oracle 8i. This is possible from Oracle 9.2 version onwards.
    For you task one example given below.
    Example:-
    Already existed table is ITEMS
    columns in ITEMS are ITID, ITEMNAME.
    But instead of ITID I want ITEMID.
    Solution:-
    step 1 :- create table items_dup
    as select itid itemid, itemname from items;
    step 2 :- drop table items;
    step 3 :- rename items_dup to items;
    Result:-
    ITEMS table contains columns ITEMID, ITEMNAME

  • When trying to update apps i keep getting billing method incorrect(this is on iphone 4s) i hsve tried this store,apple id,view id,payment info but does not offer me the none option,i can npt update my phone any ideas anybody please?

    when trying to update apps i keep getting billing method incorrect(this is on iphone 4s) i hsve tried this store,apple id,view id,payment info but does not offer me the none option,i can npt update my phone any ideas anybody please?

    If you dont have none option then you must own itunes some money. So you have to enter the payment like a itunes giftcard. you can contact itunes by email by going to expresslane.apple.com

Maybe you are looking for

  • My i phone 4 has terrible reception how do i fix this??

    My i phone 4 has terrible reception and cant get wireless connection down stairs when my i pod 4 does i have restarted my phone and i cant update with 7.03 because of some reason?? PLEASE HELP!! Its annoying when i ft down stairs

  • ES Rights Management login

    After successful installation ES Preview Release(without PDF Generator), and assigning all the roles to the user kvarsen (including LiveCycle Rights Management End User) I still cannot login to the Rights Management... any ideas?

  • Address in smartform

    Hi Friends, I have the following code in SAPScript but I need to change it to SmartForms. Can anybody tell me how to handle? /:   ADDRESS PARAGRAPH AS /:        TITLE             &SERVICE_ADDRESS-ANRED& /:        NAME            &SERVICE_ADDRESS-NAME

  • Posting to an existing page

    Guys, Not sure if this is the right place to ask. Was not sure. Please excuse if in error. There is this particular webpage that displays a form with a text field and a submit button. I am trying to write a java program that will try to fill the file

  • [Solved] Uvesafb & Nvidia framebuffer problems after June 2012 update.

    The subject pretty much says it all, I'm really not sure what in the world happened.  It worked GREAT since I installed it, but after I updated the system a few days ago, my monitor shows it being out of an acceptable resolution range. It's strange,