Bash: "expr index string1 string2" gives "syntax error"

In a bash script, I was trying to use the command
expr index string1 string2
to find the position of string2 in string1, but this does not work on OS X while it works ok on several Linux machines. Reading the man page, I realized expr does something quite different on OS X than on Linux.
Can anybody suggest which command I should use to get the same functionality of the above on OS X?
Thanks
Andreas

Hi Ken,
   Wow! That's something you don't see every day; I'm really impressed. I had had a tough day too. Later I thought of a funny answer in which I blamed everything on the crazy shell I use. The difference between the two answers is just the flow of karma but stopping the flow of negative by saying something is a real and difficult choice and yours shows character. I'm sorry for going on too much but such things matter more than machines.
   On the other hand, you're a royal pain in the ... just kidding. You're a strict task master but right; I read in the man page about it returning zero and forgot. However, mathematically it isn't too difficult; you just have to use modular arithmetic. In zsh, (I can learn) it would look like:
test=aabbcc
echo $(( ( ${#test%%[bc]*} + 1 )%( ${#test} + 1 ) ))
In bash, it would look like:
test=aabbcc
testtmp=${test%%[bc]*}
echo $(( ( ${#testtmp} + 1 )%( ${#test} + 1 ) ))
Gary
~~~~
   In science it often happens that scientists say, 'You know that's a really good argument; my position is mistaken,' and then they actually change their minds and you never hear that old view from them again. They really do it. It doesn't happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.
         -- Carl Sagan, 1987 CSICOP keynote address

Similar Messages

  • Merged dimension gives #syntax error

    Hi everybody,
    i have a simple report that contains 2 query.
    i merged two dimensions and everything looks like fine.
    but when i just refresh the query it gives me syntax error;
    bo system : 4.1 sp3 and both of queries are bex queries.any suggestion please.

    Hi Veer,
    1) same behaviour with Applet as well as web mode
    2) No
    3) I created a webi report, added two bex queries, Country Code is the common dimension which I'm trying to merge. Once both BEx queries are freshed and the objects from both queries are available in in the report to choose from, I try to merge them Country Code, however the merge option isn't even available (i.e. it does not allow merging by selecting objects or choosing the merge from the menu). As a work around I pull the Country code in the report pane from each query as a seprarate objects, ( i notice Country code object from Query one has the values while the Country Code from the second query has the #TOREFRESH, although both query were refreshed at start).
    Since both Country Code objects are on the report cavas, I refresh both queries again. Now I see the values in both objects. Now if I select the Country code from the left hand panel it allows merging. After merging, I drag the new merage counry code on the report Cavas i see the combined values (so far so good). Next I refresh the report again and magically the merged objects is disappeared from the report canvas and the #SYNTAX erro is it remains there.
    As I said, I am using 4.1 with Sup Pak 3, build 1257.
    Any help would be appreciated.
    Regards
    WAK

  • N1SM 1.3.3 OS Load gives syntax error and drops into interactive install

    Hi
    I am trying to load Solaris 10 u4 onto a T1000 and a X4100.
    This is my first installation of N1SM.
    When I give the load command the T1000 will boot off the network, but after a while I very
    briefly see a syntax error and a line about using US Keyboards, then the installation goes
    into interactive mode rather than unattended.
    This is very frustrating.
    Does anyone have any ideas as to what could be going wrong?
    I have installed N1SM on Solaris 10 U4 x86 and have the recommended patch bundle installed.
    Thanks

    No ... it will stay as IDR (Interim Diagnostic Relief - http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=IDR+site%3Asun.com ) afaik
    If you want it, ask Sun for it ... official patch will not be released for it yet ... and I wouldn't count on official patch so soon ...
    If you have a support for N1SM ... ask for the IDR , it's no. is IDR137229-01 (x86) & IDR137228-01 (sparc) , not sure about the linux one ...
    hth
    L

  • Trying to execute a stored procedure gives: Syntax error or access violatio

    Hi,
    I have a stored procedure that runs fine in sqplus:
    EXEC load_image('distribuido.JPG', '1');
    When i try to execute it in PHP it gives me this error:
    [Oracle][ODBC]Syntax error or access violation.
    In php i'm using ODBC functions, with the same user configured in dsn. The sql i run in php is 100% equal...
    What's the problem and how should i run this procedure in php (or maybe grant more privileges to this user??)
    The procedure is:
    CREATE OR REPLACE PROCEDURE load_image( filename VARCHAR2, vid_membro INTEGER )
    AS
    file_lob BFILE;
    binary_lob BLOB;
    mime_type fotografia.foto_tipo%type;
    extension_pos NUMBER;
    BEGIN
    extension_pos := INSTR( filename, '.' );
    mime_type := 'image/' || SUBSTR( filename,
    extension_pos + 1,
    LENGTH( filename ) );
    INSERT INTO fotografia (id_foto, id_cat, id_membro, nota_media, num_votos, foto_tipo, fotografia)
    VALUES (fotografias_id.nextval, 1, vid_membro, 0, 0, mime_type, empty_blob())
    RETURNING fotografia INTO binary_lob;
    file_lob := BFILENAME( 'IMAGES', filename );
    dbms_lob.fileOpen ( file_lob, dbms_lob.file_readOnly );
    dbms_lob.loadFromFile( binary_lob,
    file_lob,
    dbms_lob.getLength( file_lob ) );
    dbms_lob.fileClose ( file_lob );
    END;
    /

    'exec' is an sqlplus directive. If you run this query in PHP, try:
    $query = "BEGIN
    load_image('distribuido.JPG', '1');
    END;";
    (you may have to remove the ; after 'END')

  • 4.0 EA2 plsql editor gives syntax error on $$plsql_unit variable

    Hello,
    A plsql procedure contains the following statement in the declare section:
    cl_module      constant varchar2(20) := $$plsql_unit;
    In the plsql editor the part $$ is indicated as having syntax errors, by hovering on it a popup window displays :
    Syntax error, expected: name_wo_function_call, name, expr.
    The procedure compiles without any problem. Please adapt the plsql parser to support $$variables.
    Joop

    Hello Jeff,
    is this issue on the 4.0 EA3 list?
    Joop

  • Syntax error while running the Adobe Form

    Hi to all,
    I have created an interface for adobe from
    Example:  F4_HELP type ZST
    Where ZST  is structure type.
    ZST structure has following field.
    1)     MATERIAL type MATNR
    2)     BASE_QTY type BASMN (BASMN of type QUAN, length 13 with ref table RC29K, and ref field BMEIN)
    Interface and form successful activated.
    But when I run adobe from it give syntax error for ref table RC29K, and ref field BMEIN
    Field u201CRC29K- BMEIN u201Cis unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
    Please can anyone tell me the solution for that?
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Thanks For reply
    I have already maintained the ref table and field for field BASE_QTY type BASMN
    Ref table RC29K, and ref field BMEIN.
    But still error is coming.
    please can any one tell me the solution for that.
    i shall be thankful to you for this.
    Regards
    Pavneet Rana

  • What is this syntax error?

    The standard SAP program SAPDBZDF giving error in ECC6.0 version in line 211:Field "%_GET" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . .
    The line declared is 
    IF B0SG-XASGL <> 'X' AND %_GET+10(1) <> ' '.
    What is the %_GET? how to eliminate the error?
    This code doesn't give syntax error in 4.0B version.
    If it is standard SAP report, please help me.

    Hi,
    this rather looks like some kind of inactive query, infostructure or other generated stuff.
    As already mentioned: Our system knows
    SAPDBDDF                                   Logical Database SAPDBDDF
    SAPDBIDF                                   Real Estate Logical Database
    SAPDBKDF                                   Logical Database SAPDBKDF
    SAPDBMDF                                   FM Master Data Mass Selection
    SAPDBSDF                                   SAPDBSDF Logical Database
    SAPDBVDF
    If you copied one of the standard logical databases to customer name space SAPDBZDF: I did this and I found OSS notes guiding through additional necessary process.
    Regards,
    Clemens

  • Forms 10g compile : syntax error near unexpected token `in

    Hi,
    I am writing a code to compile FORMS 10g(10.1.2.0.2) in HP_UX one by one.
    this is the code---frm10g.sh
    *#!/bin/ksh*
    *# . ~oracle/forms/server/default.env*
    *# . sid icache*
    TERM=vt220
    *if [ $# != 2 ]*
    then
    echo Usage : $0 module_name module_type
    exit 1
    fi
    case $2 in
    FORM|form|F|f) ext1='fmb' ;ext='fmx' ; modtyp='FORM' ;;
    PLL|pll|p|lib|LIB) ext1='pll' ;ext='plx' ; modtyp='LIBRARY' ;;
    MENU|menu|M|m) ext1='mmb' ;ext='mmx' ; modtyp='MENU' ;;
    **) echo invalid parameter ; exit 1 ;*
    esac
    echo Generating $1.$ext
    frmcmp module=$1.$ext1 userid=abc/abc@abc output_file=../$1.$ext module_type=$modtyp batch=NO compile_all=special > ./log/$1.log
    when I try to excute above file frm10g.sh in command line i get following error. Please let me know how to fix it.
    [abc]u01/app/oracle/product/10.1.2/forms/forms/Forms10g:. frm10g.sh INV FORM
    : command not found
    : command not found
    'bash: ./frm10g.sh: line 13: syntax error near unexpected token `in
    'bash: ./frm10g.sh: line 13: `case $2 in
    I really aapreciate your help.
    Thanks
    Sandy

    Sandy,
    I must apologize. The Compile.sh does not come with the Oracle Dev Suite installation. However, the following is the contents of the compile.sh script we use. This script compiles a single form.
    #!/usr/bin/ksh
    ORACLE_HOME=/d01/oracle/ias1012;export ORACLE_HOME
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/ctx/lib:/usr/java1.2/jre/lib/sparc:$ORACLE_HOME/jdk/jre/lib/sparc:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ucblib:usr/ccs/lib; export LD_LIBRARY_PATH
    MODULE_NAME=`echo $1|cut -d. -f1`
    MODULE_SUFFIX=`echo $1|cut -d. -f2`
    MODULE_MESG=${2:-"Compiling $1"}
    OK_MESG=${3:-"  Compiled sucessfully"}
    . .setpass_cir
    APP_PW='cir/'`eimauth -g cir`'@database'
    echo "************************************************************************* "
    echo ${MODULE_MESG}
    frmcmp.sh module=/d01/oracle/forms/${MODULE_NAME}.fmb userid=${APP_PW} compile_all=yes batch=yes
    RC=$?
    case "$RC" in
      0)
        echo ${OK_MESG}
        echo "Compile errors, return code: $RC "
        cat ${MODULE_NAME}.err
        echo "Compile errors in $1, press [enter] to continue.\c"
        read x
    esac
    eval exit $RCYou should be able to modify this to suit your needs.
    Craig...

  • Syntax error in programme

    Please check this programme this gives syntax error...
    *& Report  YTEST12                                                     *
    REPORT  YTEST12                                 .
    tables:mara.
    data: begin of itab occurs 10,
          matnr like mara-matnr,
          mbrsh like mara-mbrsh,
          mtart like mara-mtart,
          meins like mara-meins,
          end of itab.
    DATA: ITAB1 like itab occurs 10 with header line.
    DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
    data: ok-code like sy-ucomm.
    DATA gs_layout TYPE lvc_s_layo.
    DATA: go_grid             TYPE REF TO cl_gui_alv_grid,
         go_custom_container TYPE REF TO cl_gui_custom_container.
    start-of-selection.
    CALL screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CREATE OBJECT go_custom_container
             EXPORTING container_name = 'ALV_CONTAINER'.
           CREATE OBJECT go_grid
             EXPORTING
               i_parent = go_custom_container.
    PERFORM prepare_field_catalog CHANGING gt_fieldcat[].
    PERFORM LAYOUT.
    perform load_data.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Form  load_data
          text
    -->  p1        text
    <--  p2        text
    FORM load_data .
    select matnr mbrsh mtart meins from mara into table itab1.
    CALL METHOD go_grid->set_table_for_first_display
    IMPORTING
    *container_name = 'ALV_CONTAINER'.
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout.
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    *it_toolbar_excluding = pt_exclude "excluding toolbar functions
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = itab1[]
    it_fieldcatalog = gt_fieldcat[]
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM.                    " load_data
    *&      Form  prepare_field_catalog
          text
         <--P_GT_FIELDCAT[]  text
    FORM prepare_field_catalog CHANGING gt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-fieldname = 'MATNR'.
    ls_fieldcat-scrtext_m = 'MATERIAL'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 2.
    ls_fieldcat-fieldname = 'MBRSH'.
    ls_fieldcat-scrtext_m = 'INDUSTRY'.
    ls_fieldcat-emphasize = 'C900'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 3.
    ls_fieldcat-fieldname = 'MTART'.
    ls_fieldcat-scrtext_m = 'TYPE'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 4.
    ls_fieldcat-fieldname = 'MEINS'.
    ls_fieldcat-scrtext_m = 'UNIT'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ENDFORM.                    " prepare_field_catalog
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE sy-ucomm.
           WHEN 'EXIT'.
             LEAVE TO SCREEN 0.
         ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
    gs_layout-stylefname = 'FIELD_STYLE'.
    gs_layout-zebra = 'X'.
    gs_layout-grid_title = 'MATERIAL'.
    gs_layout-sel_mode = 'A'.
    gs_layout-ctab_fname = 'COLORS'.
    ENDFORM.                    " LAYOUT

    recode like this..Reward if useful..please find the code i have changed(in bold)
    REPORT YTEST12 .
    tables:mara.
    data: begin of itab occurs 10,
    matnr like mara-matnr,
    mbrsh like mara-mbrsh,
    mtart like mara-mtart,
    meins like mara-meins,
    end of itab.
    DATA: ITAB1 like itab occurs 10 with header line.
    DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
    data: ok-code like sy-ucomm.
    DATA gs_layout TYPE lvc_s_layo.
    DATA: go_grid TYPE REF TO cl_gui_alv_grid,
    go_custom_container TYPE REF TO cl_gui_custom_container.
    start-of-selection.
    CALL screen 100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CREATE OBJECT go_custom_container
    EXPORTING container_name = 'ALV_CONTAINER'.
    CREATE OBJECT go_grid
    EXPORTING
    i_parent = go_custom_container.
    PERFORM prepare_field_catalog CHANGING gt_fieldcat[].
    PERFORM LAYOUT.
    perform load_data.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form load_data
    text
    --> p1 text
    <-- p2 text
    FORM load_data .
    select matnr mbrsh mtart meins from mara into table itab1.
    <b>
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING
    *container_name = 'ALV_CONTAINER'.
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    *it_toolbar_excluding = pt_exclude "excluding toolbar functions
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = itab1[]
    it_fieldcatalog = gt_fieldcat[]
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    </b>IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " load_data
    *& Form prepare_field_catalog
    text
    <--P_GT_FIELDCAT[] text
    FORM prepare_field_catalog CHANGING gt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-fieldname = 'MATNR'.
    ls_fieldcat-scrtext_m = 'MATERIAL'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 2.
    ls_fieldcat-fieldname = 'MBRSH'.
    ls_fieldcat-scrtext_m = 'INDUSTRY'.
    ls_fieldcat-emphasize = 'C900'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 3.
    ls_fieldcat-fieldname = 'MTART'.
    ls_fieldcat-scrtext_m = 'TYPE'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ls_fieldcat-tabname = 'ITAB1'.
    ls_fieldcat-col_pos = 4.
    ls_fieldcat-fieldname = 'MEINS'.
    ls_fieldcat-scrtext_m = 'UNIT'.
    APPEND ls_fieldcat TO gt_fieldcat.
    ENDFORM. " prepare_field_catalog
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form LAYOUT
    text
    --> p1 text
    <-- p2 text
    FORM LAYOUT .
    gs_layout-stylefname = 'FIELD_STYLE'.
    gs_layout-zebra = 'X'.
    gs_layout-grid_title = 'MATERIAL'.
    gs_layout-sel_mode = 'A'.
    gs_layout-ctab_fname = 'COLORS'.
    ENDFORM. " LAYOUT
    Message was edited by:
            Arjun Puthuruthy
    Message was edited by:
            Arjun Puthuruthy

  • Forte syntax error...

    Hi,
    I got a syntax error from Forte (3.0.M.2) for the next assignments
    however they are working if the declaration and assignment is
    written separately.
    locTD : TaskDesc = start task self.Run() where completion = event;
    gives "syntax error (Last symbol: start)" but
    locTD : TaskDesc;
    locTD = start task self.Run() where completion = event;
    works fine
    The same is true for eventhandler registration:
    locER : EventRegistration = register self.TestEH();
    results in "syntax error (Last symbol: register)" while
    locER : EventRegistration;
    locER = register self.TestEH();
    is OK
    Any idea for the reason behind???
    Thanks
    Attila
    Attila Racz FORTECH IT Ltd.
    http://www.fortech.hu
    E-mail: [email protected] .-``'.
    [email protected] .` .'
    Tel.: +36/1-471-9150 _.-' '._ Hermina ut 17.
    Fax : +36/1-471-9163 H-1146 Budapest, Hungary
    --------------------------------------------------------------------------

    Hello Forte-Users,
    i got only one reply on my problem, so i will explain the problem more
    clearly.
    in the include File: FORTE_ROOT/install/os/os.h
    is a definition: '#define qqOS_HUGE'
    The compiler fails in File: FORTE_ROOT/install/cmn/osmm.h line 4
    in the Class Definition: 'class qqOS_HUGE qqsh_Task;'
    with the following error:
    FORTE_ROOT/install/inc/cmn/osmm.h", line 4.1: 1506-166 (S) Definition of
    function class requires parentheses.
    Does anyone know which option or failure in the environment of the
    C-Compiler occures this error?
    Works someone on a RS6000 with an AIX C-Compiler on AIX 4.2?
    So please look at your configuration settings and help me.
    I know that a function needs parentheses, but this code (everybody have the
    same Header-Files on his/her machine) wants to define a class and no
    parentheses are needed for class definition.
    Joseph Mirwald
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • (NOLOCK) is giving syntax error

    Hi,
    I have query which runs properly in 1 server and in the other server it gives syntax error because of (NOLOCK).
    When i remove (NOLOCK) its working fine.
    my query is a big one...
    But it is something like
    INSERT INTO @abc
    SELECT a.id,SUM(b.count) FROM
    (SELECT DISTINCT id FROM table1 (NOLOCK)) AS a
    INNER JOIN Table2 (NOLOCK) AS b
    GROUP BY a.id
    It is giving syntax error at only one (NOLOCK) that is near Table2 in one server and in other server it works fine...
    Both the server versions are exactly same...
    What is the reason?

    First, it is generally a bad idea to post a follow-up "me, too" response to an old and answered question.  Fewer people will look at an answered question generally. 
    Next, the reason this thread provides no information about the original problem and the solution is because the complete problem was not posted.  If your query generates an error message, it is important to see the complete and actual error message.
    Given the conversation, it is likely that there was a syntax error in the various statements that OP tried and it was a happy accident that the removal of the hint caused the error to go away. 
    Lastly one should refrain from using hints generally.  For some unfathomable reason there is a myth that it is a good practice to use the nolock hint. 

  • Stored Procedure syntax error

    I'm trying to create a stored procedure that does not have any IN or OUT parameters. It gives syntax errors:
    create or replace
    procedure GEN_NEW_DATA
    as
    cursor for_msgid is select PARENTID from WORKITEM;
    msgid_rec for_msgid%rowtype;
    begin
    for msgid_rec in for_msgid loop
    update FIELDTYPE set FIELDVALUE= (select ACCOUNTID from ACCOUNT where ACCOUNTNAME= (select FIELdVALUE from FIELDTYPE where FIELDNAME= msgid_rec.PARENTID || 'xAgency' ) ) where FIELDNAME= msgid_rec.PARENTID || 'xAgency';
    commit;
    end loop;
    dbms_output.put_line('Done');
    end;
    Can someone help me with the syntax here.

    msgid_rec for_msgid%rowtype;I think this is not allowed..
    ----Try this
    create or replace
    procedure GEN_NEW_DATA
    as
    cursor for_msgid is select PARENTID from WORKITEM;
    --msgid_rec for_msgid%rowtype;
    begin
    for msgid_rec in for_msgid loop
    update FIELDTYPE set FIELDVALUE= (select ACCOUNTID from ACCOUNT where ACCOUNTNAME= (select FIELdVALUE from FIELDTYPE where FIELDNAME= msgid_rec.PARENTID || 'xAgency' ) ) where FIELDNAME= msgid_rec.PARENTID || 'xAgency';
    commit;
    end loop;
    dbms_output.put_line('Done');
    end;
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Solaris: Syntax errors on all db2 commands run in terminal

    DB2 Express 9.5 x86 installed on Solaris 10 x86.
    Just about every DB2 command I run gets some type of syntax error.
    There has to be some additional configuration required after installing DB2.
    When I run these without the sh in front, I get a "command not found" message.
    Here are edited examples.
    I had to remove some of the disallowed content from the examples and replace with xxxx's.
    Examples:
    bash-3.00# sh db2level
    db2level: xxxxxxxx: not found
    db2level: syntax error at line 19: `(' unexpected
    bash-3.00# sh db2
    db2: syntax error at line 3:
    bash-3.00# sh db2fs
    Usage: dirname path
    db2fs: test: argument expected
    bash-3.00# sh db2admin
    db2admin: syntax error at line 2:
    `"#' unexpected
    bash-3.00# sh db2daslevel
    db2daslevel: syntax error at line 1: `(' unexpected
    bash-3.00# sh db2fmd
    db2fmd: syntax error at line 20: `(' unexpected
    bash-3.00# sh db2diag
    db2diag: syntax error at line 8: `(' unexpected

    Definitely the wrong forum for those questions.

  • Adobe Reader v7.09 doesn't work and gives me "expr: syntax error".

    Hello!
    $ /home/Programs/AdobeReader709/bin/acroread
    expr: syntax error
    expr: syntax error
    ... (never ends and I have to kill the process).
    I ran a strace for a couple seconds and ctrl-c'ed to stop/kill it. I posted the log: http://pastebin.ca/674360 ...
    I see errors so I searched for those files:
    $ locate ld.so.
    /etc/ld.so.cache
    /etc/ld.so.conf
    /etc/ld.so.conf.d
    /etc/ld.so.conf.d/i486-linux-gnu.conf
    /etc/ld.so.conf.d/libc.conf
    /usr/share/man/man8/ld.so.8.gz
    Any ideas what's going on? It used to work. I even reinstalled it. I am using Debian (Etch) with Kernel 2.6.22-K7.
    Thank you in advance. :)

    Nevermind. I found the answer in http://www.adobeforums.com/cgi-bin/webx/.3bc4b92f ... :)

  • /usr/bin/bash[34]: syntax error at line 40 : `set' unexpected

    Hi All
    I would like to install Oracle Database 11gR1 On Solaris 10
    When I run root.sh command, I confused to input path
    *# cd /home/oracle11/app/oracle11/product/11.1.0/db_1*
    *# ./root.sh*
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= oracle11
    ORACLE_HOME=  /usr2/home/oracle11/app/oracle11/product/11.1.0/db_1
    *Enter the full pathname of the local bin directory: [usr/local/bin]:/usr/bin/bash*
    I have inputed "/usr/bin/bash"
    Now I can not run bash on Solaris 10.
    *# bash*
    bash[34]: syntax error at line 40 : `set' unexpected
    Please help me!
    Thankyou and best regards,
    thiensu2810

    Hi
    Output of "$ find /usr -name bash 2>/dev/null" is
    *# find /usr -name bash 2>/dev/null*
    */usr/bin/bash*
    *# less /usr/bin/bash*
    +###################################+
    +#+
    +# $Header: coraenv.sh 17-may-2007.08:31:33 jboyce Exp $ coraenv+
    +#+
    +# Copyright (c) 1987, 2007, Oracle. All rights reserved.+
    +#+
    +# This routine is used to condition a C shell user's environment+
    +# for access to an ORACLE database. It should be installed in+
    +# the system local bin directory.+
    +#+
    +# The user will be prompted for the database SID, unless the variable+
    +# ORAENV_ASK is set to NO, in which case the current value of ORACLE_SID+
    +# is used.+
    +# An asterisk '*' can be used to refer to the NULL SID.+
    +#+
    +# 'dbhome' is called to locate ORACLE_HOME for the SID. If+
    +# ORACLE_HOME cannot be located, the user will be prompted for it also.+
    +# The following environment variables are set:+
    +#+
    +# ORACLE_SID Oracle system identifier+
    +# ORACLE_HOME Top level directory of the Oracle system hierarchy+
    +# PATH Old ORACLE_HOME/bin removed, new one added+
    +# ORACLE_BASE Top level directory for storing data files and+
    +..................................+
    +.................................+
    else
    if (-e $ORABASE_EXEC) then
    if (-x $ORABASE_EXEC) then
    set BASEVAL=`$ORABASE_EXEC`
    setenv ORACLE_BASE $BASEVAL
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    else
    echo "The $ORACLE_HOME/bin/orabase binary does not have execute privile
    ge"
    echo "for the current user, $USER.  Rerun the script after changing"
    echo "the permission of the mentioned executable."
    endif
    else
    setenv ORACLE_BASE $ORACLE_HOME
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    endif
    endif
    +#+
    +# Install local modifications here+
    +#+
    thank,
    thiensu2810

Maybe you are looking for

  • Windows 7 Pro SP1 x64 wont install Internet Explorer 10

    Hey all, Having an issue on my clients machine and I have yet to figure it out. The machine is a Dell Latitude E6330 running a 64-bit Windows 7 Professional SP1 install. Currently the machine has Internet Explorer 9 on it which is unacceptable due to

  • Macbook Pro only get IIS7 start page not start page on Sharepoint

    Hello fellow SharePointers We have a SharePoint 2010 environment in our house. Mostly used for Intranet. We allso have all on Windows 7 and other Microsoft products. J But we have 2 macs, and they cannot connect to the intranett. I have edit the host

  • DateNavigator in Safari Brower shows junk character

    Dear All, In Safari browers (all versions), DateNavigator UI element is shows junk character.  To reproduce this error, please follow the below steps. 1.      Click on the date picker. 2.      Try to change the month from u201CJuly to Augustu201D or

  • ADSSO Service Not Working on Secondary CAS when done Failover

    We are running NAC OS 4.9.2 in OOB L2 Virtual Gateway... We have CAS Cluster Primary CAS -- 10.245.220.5  & Secondary CAS -- 10.245.220.6 and Service-IP 10.245.220.4 When in HA Cluster Primary is Active and Secondary is Standby Ok , ADSSO is Working

  • Error WWC-41439 on server with ip static

    on portl30 when i try to connect to modplsql i recive this error WWC-41439 !! i have the server on the net with a static ip adress 194.100.xxx.xxx and i jave not a domain name for the server. it is possible to obtain a solution? il vampiro