SQL statement not working for an application

Hello,
Here is a sql statement which i am using to populate Department ID using another row in the table. Using these I am getting the values called department alias from different table and schema.
UPDATE tablename_4127 PT
SET "Deptid" = (select distinct(deptid) from datastore.get_department_alias
where upper(ltrim(rtrim(deptalias))) = upper(ltrim(rtrim(PT."Dept Descr")))
AND "Colid" = PT.COLID)
Please anyone help me with this.
Thank you

HBUA wrote:
Hello,
Here is a sql statement which i am using to populate Department ID using another row in the table. Using these I am getting the values called department alias from different table and schema.
UPDATE tablename_4127 PT
SET "Deptid" = (select distinct(deptid) from datastore.get_department_alias
where upper(ltrim(rtrim(deptalias))) = upper(ltrim(rtrim(PT."Dept Descr")))
AND "Colid" = PT.COLID)
Please anyone help me with this.
Thank youhelp you how, since we don't have your table, data or requirements?
How do I ask a question on the forums?
SQL and PL/SQL FAQ

Similar Messages

  • Sender JDBC adapter -- Update SQL statement NOT work for the last record

    I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter.  I've defined the communication channel for sender
    (1)  The "Query SQL statement"  = select  a_bgn_dt,  a_end_dt from  PX_PXXD WHERE NOT CU_ACTION_CD='P' 
    (2)   The "Update SQL statement"  = update PX_PXXD set CU_ACTION_CD='P'  WHERE NOT CU_ACTION_CD='P' 
    Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
    Any advise.
    Pansy

    Hi Pansy,
    You select and update query is looking like wrong
    kindly check below query,If you are using oracle
    (1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
    (2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE  CU_ACTION_CD !='P'
    Thank you
    Sateesh

  • Debugger not working for BSP application

    Hi All,
    I have 4.6C sap installation and the debugger is not working for BSP Application even when i hard code the break points.
    Can anyone help me on this issue.
    Thanks and Regards
    Shilpa

    Hi Shilpa,
    How many number of sessions are open ? If there are already six sessions open and then you try and get the debugger, it will not start, and you won't be able to catch that error also...!
    Other than that there is no possibility that the debugger doesn't start, unless ofcourse, the logic doesn't reach the debugger point....
    Hope this helps.
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • Sql statement not working with for update

    Hi, iam facing an error fetch out of sequence
    when iam trying to execute a sql statement
    Statement st=con.createStatement();
    st.executeQuery(select mycolumn from table where jobno=1 for update);
    the statement works well without " for update ".
    any solutions????

    Hi,
    The fetch out of sequence error occurs usually when you are trying to read from a cursor that has no data left(like EOF).
    After executing the sql statement move the pointer to the first row (or the beginning of the resultset)
    This is actually an oracle error bearing number :ORA:01002
    Hope this helps.
    Thanks,
    Creator Team.

  • Oracle 10g RAC SQL profiles not working for both the nodes

    We have identified a long running sql.
    Used Advisor to tune the sql
    Applied the suggested sql_profile as per the recommendation.
    when we re-run the sql from application, due to RAC setup the sql hit the other node, used the sql profile as indicated by v$sql but was long running.
    it generated a new sql_id due to which we think it was not working.
    Could you please advice how to apply sql_profile for both nodes?

    HI Arun
    Would you please post that in the GRID RAC section of this forum please ?
    Please consult the following documents to get support on your question:
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/votocr.htm#sthref211
    http://download.oracle.com/docs/cd/B19306_01/install.102/b14205/undrstnd.htm#RISOL2610
    Thanks

  • SQL Statement not works using functions or subqueries-MAXDB

    Hello All,
    I created an ABAP program to select information about country(table: T005) with the country names (Table: T005T). I tried to create a sql query with a sql subquery to select everything but for some reason that I don't know it doesn't work. Please find the query below.
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, `
               &&       `(SELECT landx `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ), `
               &&       `(SELECT natio `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ) `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Well, the query above works but the fields LANDX and NATIO are in blank in ALL THE CASES, even with information registred in table T005T.
    So, exploring the SDN forum and after read some documents regarding ADBC, I create a function to handle this sql select and get the correctly the missing informations, but, still don't work. Please find the function below:
    CREATE FUNCTION select_landx (land1 CHAR(3)) RETURNS CHAR(15)
    AS
      VAR landx CHAR(15);
      DECLARE functionresult CURSOR FOR
      SELECT spras, land1, landx
         FROM SAPNSP.t005t
         WHERE spras = 'EN'
             AND land1 = :land1;
         IF $count IS NULL THEN <- | $count is always 0, my SELECT
           BEGIN                                 it's not work but I don't know why
             CLOSE functionresult;
             RETURN NULL;
           END
         ELSE
           SET $rc = 0;
           WHILE $rc = 0 DO
           BEGIN
             FETCH functionresult INTO :landx;
           END;
         CLOSE functionresult;
         RETURN landx;
    Calling the function in a SQL statement:
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, select_landx(?) landx `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Any comments ?
    Best regards,
    Arthur Silva

    Hello,
    Thank's a lot, it works. It's funny because the given solution works using only abap codes.
    It may be happens because the abap interpretor send the sql statement to the db interface that handle the code in the another way.
    Thanks again, it was driving me crazy.
    Best regards,
    Arthur Silva

  • SELECT INTO ( variable ) STATEMENTS NOT WORKING FOR SYBASE TABLE AS VIEW

    Dear Experts,
    We have connected our 9i db with Sybase db using Hs connectivity.
    and then we have create the view in oracle db for SYBASE_TABLE as SYBASE_TABLE_VIEW.
    ALL THE INSERT, UPDATE AND DELETE COMMANDS ARE WORKING BUT THE
    select Into (variable) is not working.
    Please help to resolve the select into statment which is in BOLD in the below routine
    PLEASE NOTE! FORM WAS COMPILED SUCCESSFULLY AND FORM IS RUNNING BUT SELECT INTO COMMAND IS NOT WORKING.
    Thanks & Regards
    Eidy
    PROCEDURE SRBL_INSERT IS
    CURSOR SRBL IS
         SELECT impno,impcod,impnam
         from oracle_table1 a, oracle_table2 b
         WHERE a.impcod=b.empcod
         v_srpcod varchar2(5);
    BEGIN     
    FOR rec in SRBL loop     
         begin
    select "im_code" into v_impcod                    
         from SYBASE_TABLE_VIEW
         where "im_code"=rec.impcod;
    exception when no_data_found then
         v_srpcod:=null;
    end;
    END LOOP;
    END;
    Edited by: Eidy on Aug 16, 2010 11:28 AM

    hellow
    try this.
    select "im_code" into v_impcod
    from SYBASE_TABLE_VIEW
    where "im_code"=rec.impcod;
    v_srpcod := v_impcod ;
    ........

  • SQL Query not working for column names with spaces

    Hi People..
    We have a strange situation wherein, the column name in the database table has a space inbetween like "Constant Name". While we write a JDBC statement code with the select query we get an exception for invalid syntax. It will help us in a great way if you have anything to inform us on this..
    Thanks
    Prabz

    Using case sensitive names and names with spaces in it is not a good practice.
    However, I believe the SQL standard accounts for this with quoted identifiers. I believe the syntax is
    . select "My Field1", "My Field2"
    . from "My Table'
    Have also seen the following although it might be MS Access specific.
    . select [My Field1], [My Field2]
    . from [My Table]

  • 'Check Spelling While Typing' does not work for any applications

    Earlier I had a problem with misspelled words underlined but when I right-click it does not offer spelling suggestions.
    Now, none of my applications underline misspelled words. Even if I select the option to "Check Spelling While Typing" it does not change anything. This applies to all applications (Mail, TextEdit, EverNote, Firefox, etc).

    Update: Inexplicably the underline for misspelled words now works but now when I right-click for corrections it shows 'No Guesses Found' for any word.

  • Basic authentication not working for portal application

    HI All,
    i have a portal application where I have a servlet. i want to use basic authentication for this servlet.
    to archive this i have followed http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm
    and configured basic authentication, also add web-resource in web.xml for the url to access the servlet.
    my web.xml look like (copied is only security section from web.xml)
    <security-constraint>
        <web-resource-collection>
          <web-resource-name>adfAuthentication</web-resource-name>
          <url-pattern>/adfAuthentication</url-pattern>
        </web-resource-collection>
        <web-resource-collection>
          <web-resource-name>All</web-resource-name>
          <url-pattern>/faces/Auto-connect</url-pattern>
        </web-resource-collection>
        <auth-constraint>
          <role-name>valid-users</role-name>
        </auth-constraint>
      </security-constraint>
      <login-config>
        <auth-method>BASIC</auth-method>
      </login-config>
      <security-role>
        <role-name>valid-users</role-name>
      </security-role>
    this works when in run the application in JDeveloper i.e. when i try to access http://localhost:7101/MyApp/faces/Auto-connect it ask for basic authentication (the popup) and when i access http://localhost:7101/MyApp/ it takes me to home page for login , but doesn't work when i deploy the application in weblogic 11g.(deployment done using Enterprise Manager console (EM console) (for both URL no popup).
    i tried Google around it but didn't get any solution please provide your input and guide me.
    thanks
    -somesh

    Hi,
    Before deploying, have you changed:
    Application properties -> Deployment
    Remove the selection from "Auto Generate and Syncronize weblogic-jdc.xml ....."
    Kind Regards

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • Insert statement not work for Excel file

    Hi,
    In my JDBC application, I have a "INSERT ..." statement to add a new recode to a Excel file. When I run this application, the statement is executed successfully(no Exception), however the excel file doesnot change at all.
    I am still able to run "SELECT ..." from the excel file, I am really confused.
    Anybody could help me on this?
    Thanks.

    How do you see that the Excel file hasn't changed?
    Do a select on the new record?
    Open / Reopen with Excel?
    Look at the file size?
    What if you close your connection? Is a change apparent then?

  • Transporting to QA is not working for ESS application.

    Hi ,
    I have modified the DC ESSUSfam. and activated the code , its working fine in Dev server, But while transporting to QA , it's went successfully but changes does not effect, checked SDM and found that old ear file is still running.
    Please tell me If i direclty deploye the EAR file thru SDM, will it work.  Also tell me if there is any other solution.
    we have EP6.0 SP 21.
    Thanks & Regards
    Manoj Sahoo

    Yes, you can deploy the ear file directly using SDM in QA portal.

  • Sql Monitor is not working for forms10g

    Hi All,
    Sql Monitor is not working for forms10g.How can i solve this problems.
    Regards
    Gopinath M

    using sqlmonitor i have traced the forms 6i (.fmx),in this case toad additional
    software sql monitor is automatically added the frmbld.exe in application.
    whatever i am doing in forms runtime the sqlmonitor provide the sql query.
    for examble i am opening the lov with the help of F9.Now the sqlmonitor trace
    the sql query for that lov item.so its very helpful to see the query without
    the source(.fmb).
    Now the problem is the sqlmonitor is not added the iexplore.exe in application.
    because it added frmbld.exe only not for iexplore.exe.but the 10g forms are
    running from the explorer.is there any other forms trace method is available
    pls kindly guide to me.

  • MAM application is not working for some users

    Hi All,
    Tha MAM application is not working for some users.Different users have different workcenters other than that I dont see any other change. When I run MAM30_090_GETLIST in the backend I can see the no of customized users.But I cant see same no of users in the MEREP_207 table for the Syncbo MAM30_090 and strcture id TOP in the middleware. There is a data when I checked under worklist monitor for that user. But neither the MAM application nor MAM data is downloading to that device.
    If I use different user on the same device I can see the MAM application and MAM data.
    What could be the wrong in this case. Any help would be highly appreciated.
    Mobile Client:MI 70 SP 15 Patch 0 Build 200802280918
    Middleware:SAP NetWeaver 2004s with Patch leve 15
    Backend:SAP ECC 6.0
    Application:MAM 3.0
    Thanks and Regards,
    Ameer.

    Hi,
    from your description the source of your issue is quite obvious: some of the MAM users configured in spro are not configured properly.
    For T01 SyncBos the number of TOP records in merep_207 MUST be the same as number of headers returned by an appropriate getList FM in the backend.
    You need to solve this before you can go any further.
    Reason why a record is not recorded in MEREP_207 - getdetail failed for whatever reason. So execute MAM30_ML_getdetail for each of the users that is not replicated in the middleware and check if there are errors in RETURN table. If there is no error - one of the common reason for replication fail is when there are records in item tables that have duplicate primary keys.
    Regards,
    Larissa Limarova

Maybe you are looking for