Create script (Procedure?) to help build query in app?

Hi,
Working with SQL 2012 Express and C# WinForms.
Sorry, not experience with Procedures/Functions stored within DB.
Wondering if it's possible to create a script (Function or Procedure?) to build only "part" of a sql query and then use the output (returned string) in my C# query to complete it.
Thanks,
Ron

can you elaborate? what part  comes from C#?
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • Help Building my first app for iphone??

    Hi
    I have started building an app for iphone using Adobe Flash CS5.
    Please help me answer to my stupid( ) questions.
    1) Everytime I try exporting an ipa, even a blank file with just a static text field result in a 3mb ipa. Is it normal or can we optimize it further for iphone.
    2) Any good tester/website/programs to test your ipa in different versions of iphone(3g,3gs, ipod 2g,ipad)etc.
    3) My app is made on 1 frame and all the code is written inside the same fla (no separate as file). I hope that doesn't effect app performance or selection criteria?
    4) few points on do's/don't when submitting apps to appStore for apps build in flash. Or any idea of any flash apps dissapproved because of any certain reasons.
    That will be all, will really help understand iphone development better.,
    Thanks

    Hi,
    To answer your question:
    1. it's normal.
    2. I didn't understand what are you trying to ask here.
    3. Using OOP is always better but coding in the .fla first frame should be fine.
    4. before you start building your app make sure to read apple's review guidlines and you should be fine - http://stadium.weblogsinc.com/engadget/files/app-store-guidelines.pdf
    Oz.

  • Help needed to create a Procedure

    Can anyone help me with a small procedure I have to write?
    Requirement to create Stored Procedure :
    1.  Create tables
         A1
         A2
         B1
         B2
    ----------- this is done------
    Fill the data in those tables
    ------------this is also done----
    Create "Source_table.tx"t file with table names and place them in any location.
    ------------this is also done----
    write a procedure to read the above file "Source_table.txt"  and it should read the tables name 1 by 1 which performs a simple operation inside SP -->  
    Select * from @Table_Name
    Also, it should check if the .txt file is exisiting or not.
    If exists then Read the file and execute the SP.
          SP does this :
             Select * from A1
             Select * from A2
             Select * from B1
             Select * from B2
    After that, write an output file with the counts of records to the same location  where our Source_table.txt exists .
    If doesnt exist then write to a .txt file that "File name and Location doesnt exist"

    What format is the data inside your .txt file?
    If it's just some lines containing the names of the tables then you may as well just use the UTL_FILE package to:
    a) check the existence of the file using the UTL_FILE.FGETATTR procedure
    b) open and read the contents of the file using the UTL_FILE.FOPEN, UTL_FILE.GET_LINE and UTL_FILE.FCLOSE functions/procedures.
    UTL_FILE
    Alternatively you could set up an external table to read the .txt file as though it's a table.
    Managing External Tables
    Once you extract the table names from the .txt file, you'll then have to construct dynamic SQL queries to query the data from them.  Are all of the tables of the same structure or do they change?  If they change you'll have to use the DBMS_SQL package.  If they don't you could do it more statically in PL/SQL code (at least in terms of the structures you're reading the data into), but you may still be better using DBMS_SQL for it.  It depends what you're trying to do exactly and why these table names are being exported to a file and need to be read dynamically in this way.  Often Dynamic coding indicates poor design, but without knowing exactly what you're doing, it's hard to tell if it's really necessary or not.

  • How to create several procedures from several script files?

    Hello,
    I have several procedures for SAP HANA. Every procedure is stored in a script file. I can only use SAP HANA Studio.  How can I easily  run all script files to create all procedures on a schema? Can somebody help me?
    Best regards,
    Y.Hu

    Hi Fernando,
    Thank you very much for you explanation.
    My scripts contain native sql statements for creation stored procedures “CREATE PROCEDURE … AS BEGIN … END”. They are not objects for or from Content/package. The procedures should be created direct in a project schema.
    The option with hdbsql command line is not possible because I may not use hdbsql (unfortunately not allowed for me).
    The option all scripts into a big file is a possible option for me. The big file has only 1600 lines. But there is a  strange problem with the text “FOR” in script (please see the thread http://scn.sap.com/thread/3728741 ). Unfortunately SAP HANA Studio cannot run my big script. 
    I hope there is a solution or workaround for this problem.
    Best regards,
    Y.Hu

  • Help me creating a procedure

    In this practice, create a procedure to monitor whether employees have exceeded their average salary limits.
    a.     Add a column to the EMPLOYEES table by executing the following command:      
         ALTER TABLE employees
         ADD (sal_limit_indicate VARCHAR2(3) DEFAULT 'NO'
         CONSTRAINT emp_sallimit_ck CHECK (sal_limit_indicate IN ('YES', 'NO')));
    a.     Write a stored procedure called CHECK_AVG_SAL. This checks each employee's average salary limit from the JOBS table against the salary that this employee has in the EMPLOYEES table and updates the SAL_LIMIT_INDICATE column in the EMPLOYEES table when this employee has exceeded his or her average salary limit.
    Create a cursor to hold employee IDs, salaries, and their average salary limit – lock the rows with the FOR UPDATE NOWAIT clause in your cursor definition.
    Find the average salary limit possible for an employee's job from the JOBS table. The average salary limit is defined as (max salary + min salary)/2 . Compare the average salary limit possible for each employee to exact salaries and if the salary is more than the average salary limit, set the employee’s SAL_LIMIT_INDICATE column to YES; otherwise, set it to NO.
    Add exception handling to account for a record being locked. This is the only exception you will need to check. This exception is Oracle non-predefined -0054. So you will need to associate it using the PRAGMA EXCEPTION_INIT. Then you can handle it with a standard WHEN clause in the EXCEPTION area of your program.
    It might look like this in your declaration area:
    e_resource_busy EXCEPTION;
    PRAGMA EXCEPTION_INIT(e_resource_busy, -54);
    c.     Execute the procedure, and then test the results.
    EXECUTE check_avg_sal
    Now test the rows lock exception by starting another session executing the procedure again. Remember to SET SERVEROUTPUT ON. In this example I used the RAISE_APPLICATION_ERROR procedure in my exception section– this is what the output will look like. But you could also have printed a nice message using DBMS_OUTPUT.PUT_LINE. Your choice.
    EXECUTE check_avg_sal
         BEGIN check_avg_sal; END;
    ERROR at line 1:
    ORA-20001: Record is busy, try later.
    ORA-06512: at "TEACH.CHECK_AVG_SAL", line 29
    ORA-06512: at line 1
    Query the EMPLOYEES table to view your modifications, and then commit the changes.
    select e.employee_id, e.job_id, j.min_salary, e.salary, j.max_salary, e.sal_limit_indicate
    from employees e , jobs j
    WHERE e.job_id = j.job_id
    EMPLOYEE_ID      JOB_ID      MIN_SALARY      SALARY      MAX_SALARY      SAL
    100      AD_PRES      20000      24000      40000      NO
    101      AD_VP      15000      17000      30000      NO
    102      AD_VP      15000      17000      30000      NO
    200      AD_ASST      3000      4400      6000      NO
    108      FI_MGR      8200      12000      16000      NO
    109      FI_ACCOUNT      4200      9000      9000      YES
    110      FI_ACCOUNT      4200      8200      9000      YES
    111      FI_ACCOUNT      4200      7700      9000      YES
    112      FI_ACCOUNT      4200      7800      9000      YES
    113      FI_ACCOUNT      4200      6900      9000      YES
    205      AC_MGR      8200      12000      16000      NO
    206      AC_ACCOUNT      4200      8300      9000      YES
    145      SA_MAN      10000      14000      20000      NO
    146      SA_MAN      10000      13500      20000      NO
    Commit
              Commit complete.

    The below is what I have.. it is not working.. I am not sure what is wrong.
    set server output on
    ---to add sal_limit_indicate column to employees table
    ALTER TABLE employees
    ADD (sal_limit_indicate VARCHAR2(3) DEFAULT 'NO'
    CONSTRAINT emp_sallimit_ck CHECK (sal_limit_indicate IN ('YES', 'NO')));
    --query employees table to make sure the column is added
    select * from employees
    ----query to check average salary
    select e.JOB_ID, e.SALARY,e.sal_limit_indicate,((min_salary+max_salary)/2) as avg_sal
    from employees e, jobs
    where e.job_id = jobs.job_id
    ---procedure to use in main procedure
    create or replace procedure update_indicator
    (emp_id employees.employee_id% type,
    emp_sallimit employee.sal_limit_indicate% type)
    is
    begin
    update employees
    set sal_limit_indicate ='yes'
    end update_indicator;
    ---procedure to update sal-limit_indicate to yes if salary is greater than average salary
    create or replace procedure CHECK_AVG_SAL is
    cursor sal_cursor is
    select e.employee_id, e.SALARY ,e.sal_limit_indicate,j.avg_sal
    from employees e, (select ((min_salary+max_salary)/2) as avg_sal, job_id from jobs)j
    where e.job_id = j.job_id
    and salary >avg_sal;
    begin
    for sal_rec in sal_cursor
    loop
    update_indicator(sal_rec.employee_id,sal_limit_indicate);
    end loop;
    end;
    end CHECK_AVG_SAL;

  • A little help for creating a procedure

    Hi,
    I'm new to oracle so i would really appreciate your help. Here is the scenario: i have several table in a database, in one table, let's call it table_a i have some values like: assignment, employee_id, account and so on. In another table, table_b i also have some data the is found in table_a like: employee_id, assignmnet, employee_name... and so on. I must create a procedure to check in table_a by value assignment(pk) and find what assignments are not in table_b and then insert these values in table_b, table_c.... . How do i create the comparison part?

    Hi,
    If It would have to insert only in table_b, then you can go for MERGE, that will be fine instead of procedure.
    Other options would be
    INSERT ALL
    INTO table_b VALUES (<required columns>)
    INTO table_c VALUES (<required columns>)
    SELECT <the columns>
    FROM table_a
    where assignmnet_id not in (select assignmnet From table_b);
    - Pavan Kumar N

  • Please Help: create a procedure that needs a sys view

    Hi gurus,
    I am trying to create a stored procedure that opens a cursor for a select on a view owned by sys, but the errors says table or view does not exist. I can select * from the view (sys.mgw_gateway) from SQL*Plus or any other tool. Anyone have an idea why I get the ORA-00942: table or view does not exist error when I try to create a procedure? Here is the simple SQL statement for the procedure (I just want the users to see if the messaging gateway is running) and that's all in it.
    open p_MGWStatus for
         select AGENT_STATUS, AGENT_PING, to_char(LAST_ERROR_DATE, 'mm/dd/yyyy hh24:mi') as LastErrorDate,
         LAST_ERROR_MSG
         from sys.mgw_gateway;
    Thanks a lot.
    Ben

    Hi
    To allow the view owned by sys in a procedure, you have to grant select on that particular view to the owner of that procedure.
    Suggestion: may or may not be acceptable: create your own view in system schema (if it has the privilege to select that view else in sys schema) with the required column of the sys view and grant this newly created view to the owner of the procedure.
    Regards
    Opps! Very late reply
    Message was edited by:
    Anurag Tibrewal

  • Need a procedure to make minus query as output for 2 tables

    Can anybody help me to create a procedure so that I could get minus query of 2 table as a result.
    Requirement:
    I have two table 1- src_table_list ,2- tgt_table_list both tables have 2 columns : serial_no,table_name and 100 records each. and details mentioned in column "table_name" are actually tables name which present in my testing database.
    so I need one procedure which will pick one table_name from src_table_list and one table_name from tgt_table_name each time recursively and provide minus query as a result. as below.
    select c1,c2,c3,c4 from table1 --(fetched from src_table_list)
    minus
    select b1,b2,b3,b4 from table2 --(fetched from tgt_table_list)
    Can any body give or help me to create the procedure..as I have to prepare minus query for more than 200 tables and then I need to test them for integration testing..
    Edited by: 974253 on Nov 30, 2012 5:39 AM

    select 'select '||chr(39)||src_table_list.tblname||chr(39)||','||chr(39)||trg_table_list.tblname||chr(39)||',count(*) from '||' ( select * from '||src_table_list.tblname||'minus select * from '||trg_table_list.tblname||');'
    from src_table_list, trg_table_list
    WHERE src_table_list.serial_no = tgt_table_list.serial_no
    The above statement should give output similar to below code and will list down all the table names in the 2 tables(i.e. above src and trg) -
    select 'src_table_list.tbl1','trg_table_list.tbl1',count(*) from
    (select col1, col2 from src_table_list.tbl1 minus select col1, col2 from trg_table_list.tbl1 );
    select 'src_table_list.tbl2','trg_table_list.tbl2',count(*) from
    (select col1, col2 from src_table_list.tbl2 minus select col1, col2 from trg_table_list.tbl2 );
    Now atleast you can run these statements as script and get to know what all tables are having count differences.
    I might have missed out on some syntax part in above code but hope to have helped you in some way as you will be specific with number of tables to check for differences.

  • How to run a unix script from oracle warehouse Builder

    Hi,
    can any one share the information about, running the unix script or scripts using oracle warehouse builder.
    Regards,
    Ak

    One way is define a workflow. Inside the workflow you put
    1)an external process that "points to" the shell script and then
    2)put the mapping
    The external process must have the "COMMAND" parameter set to the name of the shell script. If the script has parameters you must put them in the "PARAMETERS LIST" separated by "?" (for example, ?par1?par2).
    The path where OWB executes the external process I think is the ORACLE_HOME of the OWB.
    f you don't use workflow, you can try with this more complex solution. I tried with 9i and OWB 9.2 and it's working well.
    You create an autonomous procedure (within a package or not) :
    CREATE PROCEDURE Extract_Email_List
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    And use the sys.shell script that you need your dba/unix admin to install first of all, with a call like that.
    sys.shell('sh ' || txt_dir_name || '/send_email_marketing.sh ' || txt_dir_name || ' ' || email_addr );
    Then you import your procedure into OWB and use it in your mapping with the "pre-mapping" icon (you can set parameters for your proc with constants if you want).
    To implement sys.shell, go to metalink and find "Note:168065.1" - "How to call a UNIX shell script from PL/SQL".
    Once it's done once, it's not so bad. But I would still recommend the workflow approach also..
    I hope this helps.

  • How to create stored procedures automatically when creating new company

    I need to create a method in our add-on Business One application that will create stored procedures at the time we install the add-on (when the new company is created).  Where would I store the SQL scripts, and what SAP Business One commands do I need to use to build the stored procedures into the new company database? Can someone give me an example of how to do this?  We are coding in C#, but an example in visual basic would also be helpful if no one out there in forum land uses C#   
    Thanks,
    Nancy Walk
    [email protected]

    Hi Nancy!
    Of course are there people here that use C#
    To solve your problem, create a routine in your add-on that checks at startup if the stored procedures are present. If they are not, create them. You can use the DI-API, or just add them directly to your database.
    <i>Note: SAP does not like it when you play around directly in the SAP databases, and does not supply support for databases that are changed manually. You'd better use the DI-API...</i>
    Hope it helps...
    Grtz, Rowdy

  • To build query related to SNP: Planned Order

    Hi,
    System: SCM 5.0
    Scenario: SO received at plant and planning creates PR against SO at plant and accordingly SNP:Planned Order at Vendor location. If SO is cancelled/deleted (manually), sometime only the PR gets cancelled/deleted (automatically during planning run) but corresponding SNP:Planned Orders still remains at vendor location and so the dependent requirements. PR and Planned Orders are pegged to SO so one-to-one relation is maintained.
    I could not find any reason why system is not deleting Planned Order at vendor location despite SO and PR is deleted at plant location. So I am planning to build query where SNP:Planned Orders are not pegged to any PR or SO.
    Can anyone help with list of SNP:Planned Order tables so that I can build query around it to identify ghost Planned Orders.
    Hope I was clear with my query but let me know if any further information is require.
    Thanks and regards,
    Devang

    HI Marius,
    Sorry for delay reply.
    I was working on on some other more critical issues to business.
    Finally we decided to built report to identify obsolete Planned Orders for which PR is not available in ordering plant. I have listed below logic for that report:
    Get Location ID from table /SAPAPO/LOC based on Location entered in selection screen
    Get PEGIDs from FM /SAPAPO/DM_MATLOC_GET_PEGIDS based on IV_SIMID as 000 and location id from step 1
    In FM /SAPAPO/OM_PEG_CAT_GET_ORDERS, use SIMVERSION as 000 and in Import Para IS_GEN_PARAMS insert all PEGIDs from step 2.
    From Export Para ET_PEG_INPNODE take From_OrderID and store in internal table.
    Execute T.Code /SAPAPO/RRP4 with following selection (Use Selection Variant: OBSOLETE PR and add Location as entered in Selection Screen)
    Planning Version: 000
    From: Current date – 60 days
    To: Current date +180 days
    Location: 0000201328
    Product: *
    Order Type: 1F
        6. Compare output of step 4 and step 5 and display result.
    From FM /SAPAPO/DM_MATLOC_GET_PEGIDS the output (step 4) will be Order ID (22 characters) while step 5 (T.Code /SAPAPO/RRP4) will give Planned Order number (8 character). I am not sure how to compare Internal Order ID (22 characters) for corresponding Planned Order Nos. (8 characters).
    I have not marked your post as correct answer as still need to find answer of above query.
    Thank you in advance for your guidance.
    Regards,
    Devang Shah

  • Create a Procedural ALV Report with editable fields and save the changes

    Hi,
    I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDIT_02
    BCALV_TEST_GRID_EDIT_04_FORMS
    BCALV_TEST_GRID_EDITABLE
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    BCALV_FULLSCREEN_GRID_EDIT
    But all these are using OO Concepts.
    Please help.
    Regards,
    Smruthi

    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      line_color(4) TYPE c,     "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
    fieldcatalog-edit             = 'X'
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_pf_status_set = 'STATUS'
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           TABLES
                t_outtab                = it_ekko
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      DATA: ld_color(1) TYPE c.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      LOOP AT it_ekko INTO wa_ekko.
        ld_color = ld_color + 1.
        IF ld_color = 8.
          ld_color = 1.
        ENDIF.
        CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
        MODIFY it_ekko FROM wa_ekko.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM top-of-page                                              *
    FORM top-of-page.
      WRITE:/ 'This is First Line of the Page'.
    ENDFORM.
          FORM status                                                   *
    FORM status USING rt_extab TYPE slis_t_extab.  .
      SET PF-STATUS 'ALV'.
    ENDFORM.
          FORM USER_COMMAND                                          *
    -->  RF_UCOMM                                                      *
    -->  RS                                                            *
    FORM user_command USING rf_ucomm LIKE sy-ucomm
                             rs TYPE slis_selfield.            
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      CASE rf_ucomm.
    when 'SAVE'.
    get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
    endcase.
    endform.
    ENDFORM.
    here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
    create a custom PF status and create push buttons and assign your ok codes in your PF status.
    if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
    Hope this will help you.
    Regards,
    phani.

  • How to create a DB Adapter with select query having inner query

    Hi All,
    I am trying to create a DB Adapter with select query. The query has some inner queries in it. It is just like this select a, b, c, (select d from e) d, (select e from e) e from tablename.
    The problem here is with the xsd generated for this query. Xsd is not getting generated properly for all the fields it is just getting generated till c element and when it encounters
    the inner query it is stopping the generation of xsd. So for the above query the xsd is something similar to the below
    <xs:complexType name="rewOutput">
    <xs:sequence>
    <xs:element name="a" type="xs:string" nillable="true"/>
    <xs:element name="b" type="xs:string" nillable="true"/>
    <xs:element name="c" type="xs:string" nillable="true"/>
    <xs:element name="select_d" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    as shown above the xsd is just getting generated till the first inner query. What should be done to get the full fledged xsd. Should it be manually built ?? Please help me on this.
    Thanks In Advance.
    Edited by: 959766 on Nov 30, 2012 1:20 AM

    Hi,
    I don't think the parser will be able to understand your query properly... I would try building the xsd manually...
    Cheers,
    Vlad

  • How to Use the Procedures in a Sql Query

    Hi Friends,
    Can anyone help me out whether can we use the procedure in the sql query..
    if yes help me out with an example
    my requirement is
    i have one sql query .. in which i need to use the procedure which returns multiple values... how can i overcome it,can anyone help me out for this..
    for your reference i am pasting the sql query
    SELECT paf.person_id
    FROM per_all_assignments_f paf START WITH paf.person_id = p_person_id
    AND paf.primary_flag = 'Y'
    AND paf.assignment_type IN('E', 'C')
    AND l_effective_date BETWEEN paf.effective_start_date
    AND paf.effective_end_date
    CONNECT BY PRIOR paf.supervisor_id = paf.person_id
    AND paf.primary_flag = 'Y'
    AND paf.assignment_type IN('E', 'C')
    AND l_effective_date BETWEEN paf.effective_start_date
    AND paf.effective_end_date
    and paf.person_id not in (>>>I HAVE TO USE THE PROCEDURE HERE<<<<);
    Thanks in advance

    We never saw your procedure, but maybe you could wrap it in a function
    SQL> create or replace procedure get_members(in_something IN number, out_members OUT sys_refcursor)
    is
    begin
      open out_members for
        'select level member_id from dual connect by level <= :num' using in_something;
    end get_members;
    Procedure created.
    SQL> create or replace type numbers as table of number;
    Type created.
    SQL> create or replace function members(in_something IN number)
    return numbers
    as
      member_cur sys_refcursor;
      members numbers;
    begin
      get_members(in_something, member_cur);
      fetch member_cur bulk collect into members;
      close member_cur;
      return members;
    end;
    Function created.
    SQL> select * from  table(members(4));
    COLUMN_VALUE
               1
               2
               3
               4
    4 rows selected.Variant on same using piplined function
    SQL> create or replace function members_piped(in_something IN number)
    return numbers pipelined
    as
      member_cur sys_refcursor;
      rec number;
    begin
      get_members(in_something, member_cur);
      loop
         fetch member_cur into rec;
         exit when member_cur%notfound;
         pipe row(rec);
      end loop;
      close member_cur;
      return;
    end;
    Function created.
    SQL> select * from  table(members_piped(4));
    COLUMN_VALUE
               1
               2
               3
               4
    4 rows selected.
    SQL> drop function members_piped;
    Function dropped.
    SQL> drop function members;
    Function dropped.
    SQL> drop type numbers;
    Type dropped.
    SQL> drop procedure get_members;
    Procedure droppedEdit:
    Sorry Blu, had not seen you already posted similar thing
    Edited by: Peter on Jan 27, 2011 5:38 AM

  • Help building an executable that uses a factory pattern

    Hello,
    I'm trying to build an .exe from a VI that uses the factory pattern. The VI gives me the error that it can't find the classes to load and is looking outside the .exe file to find them. The specific error is:
    "Get LV Class Default Value.vi<APPEND>
    <b>Complete call chain:</b>
         Get LV Class Default Value.vi
         Main.vi
    <b>LabVIEW attempted to load the class at this path:</b>
    C:\ATE\Experiments\Build Testing\Builds\Virtual Classes\High Class\High Class.lvclass"
    I thought those classes were bundled into the .exe when it was built? I have included the class folders in the "Always Included" window of the build script.
    Any help would be appreciated. I'm fairly new to classes and I haven't built an .exe with an app using the factory pattern.
    Thanks,
    Simon
    Attachments:
    Build Testing.zip ‏491 KB

    This might be the answer.  I found the following checklist on Building Executables.  It really is referencing things other than Objects, but maybe Object folders also need to be properly located ...
    Bob Schor  [the stuff I found is below this line ...]
    Ensure paths generate correctly.
    Details
    If a VI loads other VIs dynamically using VI Server or calls a dynamically loaded VI through a Call By Reference node, make sure the application or source distribution creates the paths for the VIs correctly. To ensure paths generate correctly, use relative paths to load the VIs. The following table depicts the relative paths for a top-level VI, foo.vi, which calls a.vi and b.vi. C:\..\Application.exe represents the path to the application.
    Path to source files
    Path to files in application
    C:\Source\foo.vi
    C:\..\Application.exe\foo.vi
    C:\Source\xxx\a.vi
    C:\..\Application.exe\xxx\a.vi
    C:\Source\yyy\b.vi
    C:\..\Application.exe\yyy\b.vi
    If you use the LabVIEW 8.x file layout and you include dynamically loaded VIs in the application, the paths to the VIs change. For example, if you build b.vi into an application, its path is C:\..\Application.exe\b.vi whereC:\..\Application.exe represents the path to the application and its filename.

Maybe you are looking for