Invalid length parameter passed to the LEFT or SUBSTRING function.

 Below code is returning me invalid length (or) parameter.
Msg 537, Level 16, State 2, Line 2
Invalid length parameter passed to the LEFT or SUBSTRING function.
, ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))as Person_ID
,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
+ ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
from address where address_type= 'P' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))
)as Person_Postal_Address
,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
+ ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
from address where address_type= 'H' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))
)as Person_Home_Address
,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'H' AND contact.person_id = d.person_id AND
contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'H'
and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ) ) )
) as Person_Home
,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'W' AND contact.person_id = d.person_id AND
contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'W'
and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
and membership_id = a.membership_id and person_id in (select person_id from person
where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)))))
) as Person_Work_Phone
-kccrga http://dbatrend.blogspot.com.au/

I have fixed the query by applying the below solution
, ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person
where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, CHARINDEX(' ', a.firstname) + 1)
and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))as Person_ID
,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
+ ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
from address where address_type= 'P' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id
and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1,LEN(a.firstname)- CHARINDEX(' ', a.firstname) + 1)
and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))
)as Person_Postal_Address
,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
+ ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
from address where address_type= 'H' and person_id = ( select Top 1 person_id from person_membership where status_flag='A'
and membership_id = a.membership_id and person_id in (select person_id from person
where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))
)as Person_Home_Address
,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'H' AND contact.person_id = d.person_id AND
contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'H'
and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id
and person_id in (select person_id from person where first_name
=SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ) ) )
) as Person_Home_Phone
,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'W' AND contact.person_id = d.person_id AND
contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'W' and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
and membership_id = a.membership_id and person_id in (select person_id from person where first_name
=SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ) ) )
) as Person_Work_Phone
-kccrga http://dbatrend.blogspot.com.au/

Similar Messages

  • Invalid length parameter passed to the LEFT or SUBSTRING function, error on INSERT

    I have a stored procedure that does a BULK INSERT of a csv file into myCSVTable then INSERTs records from
    myCSVTable into myTable. The INSERT statement is giving me this error: 
    Invalid length parameter passed to the LEFT or SUBSTRING function.
    CSV File: 
    3,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
    Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017  js: 372651          epi: 1,Jane Doe
    4,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
    Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017  id: 020000007       epi: 1,Jane Doe
    There is no LEFT or SUBSTRING function used in the procedure and there are no triggers on either table. 
    The procedure had been working fine until today, when I altered one of the CSV fields. The code which triggers the error is this:
    INSERT [myTable]
    SELECT * FROM [myCSVTable]
    The weird thing is, the 1st record containing the changed field (mstr: 1000000000000000017  js: 372651          epi: 1) triggers the error, but the 2nd record containing
    the old field value (mstr: 1000000000000000017  id: 020000007       epi: 1), does not. 
    There are only blank spaces in the 2 strings, no non-printable characters or anything like that. I'm confused.

    A View of myTable was causing the problem.
    Hi LoriCazares,
    Do you mean that you have solved this issue? If so, please close this thread.
    Regards,
    Elvis Long
    TechNet Community Support

  • Adding a CM: Invalid length parameter passed to the RIGHT function. (CINF)

    We started seeing this error message a week ago when attempting to add a Credit Memo.  We only see this error message when entering Credit Memos and not any other finacial documents.  I've done some preliminary research and haven't really come up with anything to point to the issue.  Prior to reporting this to my support partner, I wanted to see if anybody here has seen this before or give me some ideas to look into the source of the issue.
    Full error message: Microsoft SQL Native Client SQL Server Invalid length parameter passed to the RIGHT function. (CINF)

    Checking the list of form ID's at [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/892] shows the A/R Credit Memo as 179 and the A/P Credit Memo as 181.  This also corresponds with what I see when viewing the system information on the form.

  • Getting error Invalid length parameter passed

    Hi,
    I'm getting an error running my query. It say "Invalid length parameter passed to the LEFT or SUBSTRING  function. I will be getting the string in between of hyphen using the code below. May i ask your assistance or idea on how to fix this issue.
    thank you.
     Substring(ins.itemid,11,CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL
    Msg 537, Level 16,
    State 3, Line 1
    Invalid length parameter passed to the LEFT or SUBSTRING
    function.
    Sample data of Itemid.
    B300-4410-ONEMAX-U
    B300-1725-XWHT-U
    B300-3110-VT981-U
    B300-1720-DRZRKCROBLK-U
    B300-1720-DRDTHN32BLK-U

    That'll cause empty strings to show up into you're result set but shouldn't cause the the SUBSTRING function to fail. 
    The error is the result of the SUBSTRING function trying to bring back a negative number of characters.
    Try running the following and see what comes back...
    SELECT ins.itemid
    FROM dbo.TableName ins
    WHERE LEN(ins.itemid) < 11
    If you don't find any itemids what are less than 11 characters (I'm 99% sure you will), try using a little test script like the following to test suspect values...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL
    DROP TABLE #temp
    GO
    CREATE TABLE #temp (
    itemid VARCHAR(30)
    INSERT #temp (itemid) VALUES
    ('B300-4410-ONEMAX-U'),
    ('B300-1725- '),
    ('B300- 3110-VT981-U'),
    ('B300-1720-DRZRKCROBLK-U'),
    ('B300- 1720-DRDTHN32BLK-U')
    SELECT ins.itemid
    FROM #temp ins
    WHERE LEN(ins.itemid) < 11
    SELECT
    SUBSTRING(
    ins.itemid, 11, CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL FROM #temp ins
    HTH,
    Jason
    Jason Long

  • How to get each value from a parameter passed like this '(25,23,35,1)'

    Hi
    One of the parameter passed to the function is
    FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
    pi_flag_codes will be passed a value in this way '(25,23,35,1)'
    How to get each value from the string
    like 25 first time
    23 second time
    35 third time
    1 fourth time
    I need to build a select query with each value as shown below:-
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 25 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 23 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
    (SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
    ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 35 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
    group by t2.org_id) q3,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 1 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
    Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.

    chris227 wrote:
    I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
    select
    regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
    from dual 
    S1     S2     S3     S4
    "25"     "23"     "35"     "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
    If t2.att_type is type of number you will do:
    t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
    I am using oracle 10g.
    In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
    say 25 is at 1 position.
    23 is at 2
    35 is at 3
    1 is at 4.
    the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
    Please see the code I wrote for it, But the select query is having error:-
    BEGIN
    IF(pi_flag_codes IS NOT NULL) THEN
    SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
    *(SELECT '(25,23,35,1)' V_CNT  FROM dual);*
    DBMS_OUTPUT.PUT_LINE(V_CNT);
    -- V_CNT := 3;
    FOR L_CNT IN 0..V_CNT LOOP
    if L_CNT=0 then
    V_S_POS:=1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
    else
    V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
    end if;
    if L_CNT=V_CNT then
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
    else
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
    end if;
    VN_ATYPE := ' t2.att_type = ' || V_ID;
    rec_count := rec_count +1;
    query_no := 'Q' || rec_count;
    Pls help me with fetching each value to build the where cond of the select query along with the query number.
    Thank You.

  • Parameter passing problem to standard JSP iView

    Hi,
    I'm trying to launch a standard iView with some a parameter directly from the browser by calling the url http://<server>/<iview>?<param>=<value>
    The iView ID is com.sap.pct.hcm.ecmmain.approval and by looking at its details from the content catalog I saw there was a property called CREVI. I would like to fill this in but the iview doesn't respond to the URL params at all. Setting them staticly by editing the iView works perfect.
    I have also checked that the "Parameters to pass from Page Request" property includes * and excludes some other properties than the one I'm testing.
    I thought this was going to be simple but can't just make it work..I guess I'm missing something basic or the property can't be used? Any ideas?
    Thanks,
    Mikko

    Hi Mikko,
    We have found inconsistencies with regards to parameter passing in the URL, sometimes they are read and sometimes not.  I suggest that you try to change the order of the parameters as this can affect if its read.  I also believe other parameters can interfere whether or not it is read so try various scenarios.
    Cheers,
    John

  • Parameter Passing from UWL to WebDynpro Component

    Hi Everyone,
    I m having a small problem in parameter passing from the UWL to the Webdynpro component(EP6 SP16).
    The UWL shows a list of shopping carts and I ve configured it such that the Shopping carts open in the webdynpro application. Now the requirement is that I want to pass the shopping cart number from the workitem container and retrieve it in the webdynpro component.
    The only thing that i m able to retrieve is the work-item ID. I ve followed the documentation on help.sap.com but I m not able to figure out how to move ahead with this.The code which i m using to retrive the dynamic parameter is
    String text = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("DynamicParameter");
    Can somebody please help me with this..
    Regards,
    Prathamesh

    Have you looked at this weblog by Ginger Gatling?
    Create new UI's for existing workflow tasks with ABAP Web Dynpro and Universal Worklist!
    Hope this helps.
    Sudha

  • Parameter passing from master to subreport

    Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?
    Thanks for any help.
    Wayne E. Pfeffer

    Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.
    Scenario 1 (multi value parameter pass through):
    The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
    The subreport RDL element would look like this:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value</Value>
                  </Parameter>
                </Parameters>
              </Subreport>  
    Scenario 2:
    The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Split("A,B,C", ",")</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    Scenario 3:
    The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value(0)</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    -- Robert

  • Left outer join functions like simple join

    I created two views SCO_REQGROSSLINES_V & SCO_REQLINESCOMPLETE on Oracle requisitions base tables. Our business rules enforce the following identity: the number of gross requisition lines will always be greater than or equal to the number of requisition lines complete. (By complete I mean delivered.)
    Each view has a key named DATESUBINV_KEY constructed of a transaction date and the subinventory code using this logic:
    , TO_CHAR(TRUNC(transaction_date),'YYYYMMDD') || subinventory_code
    On 03-SEP-2010 a user created a requisition with one line item for material from the HEAT subinventory which was not delivered. This row is retuned in the result set when I query on SCO_REQGROSSLINES_V but is NOT returned when I query on SCO_REQLINESCOMPLETE. So far so good.
    When I issue either of the the following left outer joins I do not get the row for the row for the HEAT subinventory on 03-SEP-2010:
    select rgl.trxn_date
    , rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl left outer join sco_reqlinescomplete_v rlc
    ON rgl.datesubinv_key = rlc.datesubinv_key
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    order by rgl.trxn_date, rgl.subinventory
    select rgl.trxn_date, rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl
    , sco_reqlinescomplete_v rlc
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    AND rgl.datesubinv_key = rlc.datesubinv_key(+)
    order by rgl.trxn_date, rgl.subinventory
    Question: Why would the left outer joins function as a simple join on DATESUBINV_KEY? Do keys on views function differently than keys defined in the data dictionary? If they do how can I make these keys to function like data dictionary keys?

    Hi,
    The WHERE clause is applied after the outer join is completed. In your example, rows from rgl will be in the result set even if they have no match in rlc. In those cases, all the columns from rlc will be NULL.
    Okay, so you have these rows that contain data from rgl but NULLs where the data from rlc was supposed to go. Now it's time to start the WHERE clause. You then apply conditions like this in the WHERE clause:
    AND     rlc.trxn_date BETWEEN ...NULL is between anything, so the row that the outer join prodeuced is rejected.
    All conditions involivn columns from rlc probably need to be part of the join condition, not the WHERE clause.
    For example, in you first query the FROM and WHERE clauses might be:
    FROM          sco_reqgrosslines_v      rgl
    LEFT OUTER JOIN  sco_reqlinescomplete_v  rlc  ON    rgl.datesubinv_key   = rlc.datesubinv_key
                                            AND   rlc.trxn_date       BETWEEN TO_DATE ( '29-AUG-2010'
                                                                        , 'DD-MON-YYYY'
                                                  AND       TO_DATE ( '04-SEP-2010'
                                                              , 'DD-MON-YYYY'
    WHERE   rgl.trxn_date     BETWEEN TO_DATE ( '29-AUG-2010'
                             , 'DD-MON-YYYY'
                   AND     TO_DATE ( '04-SEP-2010'
                             , 'DD-MON-YYYY'
                             )Always use (at least) two arguments when calling TO_DATE.
    Conditions that only involve rgl can be in the WHERE clause, but if any conditions from rlc are in the WHERE clause, then the effect will be the same as an inner join.
    There no difference between tables and views (or sub-queries) in this regard: the same thing would happen regardless of whether rgl and rlc were really tables or not.

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Problems with Flexible Parameter Passing - Can anyone help with the answer

    Hi,
    having gone to the trouble of creating a generic form handler which utlises the ability of the PL/SQL Gateway to handle flexible parameters, we've come across an almighty problem.
    Whilst the gateway will create two arrays of parameter names and values, it doesn' t seem to handle arrays of values. So, although some of our forms have multi select list form elements, these seem to be incompatible with the Flexible parameter method, as only the first value is returned.
    Does anyone know of a solution to this?
    I really hope so, otherwise the whole methodology is a waste of effort, and I can't imagine why Oracle bothered to include it!
    Here's hoping.
    Thanks
    Dan

    Not sure what flexible parameters are but in the past I've worked on a form that had to pass multiple values (from a multi-select list item) to a report via a single parameter. We did this by creating a pipe delimited ("|") string of all the selected values. Leading and trailing pipes were also added to the concatenated string.
    This was exploded into individual rows by using the statement below:
    WITH t AS (SELECT '|1|2|3|4|' str FROM dual)
    SELECT str, level
    , SUBSTR(str, INSTR(str, '|', 1, level) +1, INSTR(str, '|', 1, level+1)-INSTR(str, '|', 1, level)-1) str2
    FROM t
    CONNECT BY INSTR(str, '|', 2, level) <> 0;
    '|1|2|3|4|' is the value of the passed in parameter.
    So the report query could look something like
    WITH t AS (SELECT SUBSTR(:p_str, INSTR(:p_str, '|', 1, level) +1, INSTR(:p_str, '|', 1, level+1)-INSTR(:p_str, '|', 1, level)-1) itemid
    FROM dual
    CONNECT BY INSTR(:p_str, '|', 2, level) <> 0)
    SELECT a.*
    FROM items a, t
    WHERE a.itemid = TO_NUMBER(t.itemid);
    Hope this helps.

  • Parameter value for the Compensation Review CREVI is invalid

    Dear Friends in a trying to access the Compensation Review application in MSS when i preview it applications shows the list of the employees. when i try to view the details of the comp review i am getting the error
    "Parameter value for the Compensation Review CREVI is invalid"
    What is this CREVI parameter? How do i get rid of this issue?

    Activated the HCM_ECM_CI_1 Business Function

  • Invalid table name when pass in the table name as variable in dynamic sql

    Hi,
    I need to create a stored procedure which will return a list of data to my java application like the following.
    first, select the table name from the first table.
    For example : SELECT T_NAME FROM MDR_SMSTABLES
    second, select the data from the table which returned by first select statement
    For example : SELECT * FROM T_NAME.
    I use dynamic sql with cursor to select the data. But it returns "java.sql.SQLException: ORA-00903: invalid table name"
    I fetch the table name to varchar2. I think this might the cause it returns me the this error. But i don't know what type should i put for the table name other then varchar2.
    val2 VARCHAR2(200);
    OPEN cv FOR
    SELECT T_NAME FROM MDR_SMSTABLES WHERE T_DATE=d_dt_sent;
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR
    'SELECT * FROM :t WHERE MID = :m' USING val2, msg_id;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    As my stored procedure is quite long, so i just paste some of the code here. Hope the information is enough. Can anyone please help?
    Thanks

    DECLARE
    val2 VARCHAR2 (200);
    cv sys_refcursor;
    refcur sys_refcursor;
    BEGIN
    OPEN cv FOR
    SELECT table_name
    FROM user_tables
    WHERE table_name IN ('EMP', 'DEPT');
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR 'SELECT * FROM '||val2;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    END;

  • How to put the left to right scroll bar

    Hi iam new comer to sap, So pls help me. I want to display more than 17 fields from 6 different tables. At the time of display i want to put left to right scroll bar in my report screen. Because in my report screen the records are displayed with merged. So please give your valuable ideas.
    Thanks in advance
    regards,
    Kesav.

    Hi
    in classical report or intercative report it won't be possible
    do in ALV report that can be possible
    you can define any number of fieldcatalogs  means any number of fields in the output
    use in this way
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = gt_page
    i_logo = 'ENJOYSAP_LOGO'.
    ENDFORM. "top_of_page
    i wil send u my program by seaing that you can find it
    *& Report ZTEST_ALV_LOGO
    REPORT ztest_alv_logo.
    TYPE-POOLS : slis.
    *ALV Formatting tables /structures
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: gt_events TYPE slis_t_event.
    DATA: gs_layout TYPE slis_layout_alv.
    DATA: gt_page TYPE slis_t_listheader.
    DATA: gs_page TYPE slis_listheader.
    DATA: v_repid LIKE sy-repid.
    *ALV Formatting work area
    DATA: w_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_events TYPE slis_alv_event.
    DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
    INITIALIZATION.
    PERFORM build_events.
    PERFORM build_page_header.
    START-OF-SELECTION.
    *perform build_comment. "top_of_page - in initialization at present
    SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
    *USING = Row, Column, Field name, display length, table name, heading
    *OR
    PERFORM build_fieldcat.
    gs_layout-zebra = 'X'.
    *top of page event does not work without I_callback_program
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    i_structure_name = 'BSID'
    i_background_id = 'ALV_BACKGROUND'
    i_grid_title = 'This is the grid title'
    I_GRID_SETTINGS =
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat[]
    it_events = gt_events[]
    TABLES
    t_outtab = gt_bsid.
    Form..............: populate_for_fm
    Description.......: Populates fields for function module used in ALV
    FORM populate_for_fm USING p_row
    p_col
    p_fieldname
    p_len
    p_table
    p_desc.
    w_fieldcat-row_pos = p_row. "Row Position
    w_fieldcat-col_pos = p_col. "Column Position
    w_fieldcat-fieldname = p_fieldname. "Field name
    w_fieldcat-outputlen = p_len. "Column Lenth
    w_fieldcat-tabname = p_table. "Table name
    w_fieldcat-reptext_ddic = p_desc. "Field Description
    w_fieldcat-input = '1'.
    APPEND w_fieldcat TO gt_fieldcat.
    CLEAR w_fieldcat.
    ENDFORM. " populate_for_fm
    *& Form build_events
    FORM build_events.
    DATA: ls_event TYPE slis_alv_event.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = gt_events.
    READ TABLE gt_events
    WITH KEY name = slis_ev_user_command
    INTO ls_event.
    IF sy-subrc = 0.
    MOVE slis_ev_user_command TO ls_event-form.
    APPEND ls_event TO gt_events.
    ENDIF.
    READ TABLE gt_events
    WITH KEY name = slis_ev_top_of_page
    INTO ls_event.
    IF sy-subrc = 0.
    MOVE slis_ev_top_of_page TO ls_event-form.
    APPEND ls_event TO gt_events.
    ENDIF.
    ENDFORM. " build_events
    *& Form USER_COMMAND
    When user command is called it uses 2 parameters. The itab
    passed to the ALV is in whatever order it currently is on screen.
    Therefore, you can read table itab index rs_selfield-tabindex to get
    all data from the table. You can also check r_ucomm and code
    accordingly.
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    READ TABLE gt_bsid INDEX rs_selfield-tabindex.
    error checking etc.
    SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
    CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
    ENDFORM. "user_command
    *& Form top_of_page
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = gt_page
    i_logo = 'ENJOYSAP_LOGO'.
    ENDFORM. "top_of_page
    *& Form build_fieldcat
    *Many and varied fields are available here. Have a look at documentation
    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
    FORM build_fieldcat.
    w_fieldcat-fieldname = 'BUDAT'.
    w_fieldcat-seltext_m = 'Dte pst'.
    w_fieldcat-ddictxt(1) = 'M'.
    Can change the position of fields if you do not want them in order
    of the DDIC or itab
    w_fieldcat-row_pos = '1'.
    w_fieldcat-col_pos = '10'.
    APPEND w_fieldcat TO gt_fieldcat.
    CLEAR w_fieldcat.
    ENDFORM. " build_fieldcat
    *& Form build_page_header
    gt_page is used in top of page (ALV subroutine - NOT event)
    *H = Header, S = Selection, A = Action
    FORM build_page_header.
    For Headers, Key is not printed and is irrelevant. Will not cause
    a syntax error, but is not used.
    gs_page-typ = 'H'.
    gs_page-info = 'Header 1'.
    APPEND gs_page TO gt_page.
    gs_page-typ = 'H'.
    gs_page-info = 'Header 2'.
    APPEND gs_page TO gt_page.
    For Selections, the Key is printed (bold). It can be anything up to 20
    bytes. It gets printed in order of code here, not by key value.
    gs_page-typ = 'S'.
    gs_page-key = 'And the winner is:'.
    gs_page-info = 'Selection 1'.
    APPEND gs_page TO gt_page.
    gs_page-typ = 'S'.
    gs_page-key = 'Runner up:'.
    gs_page-info = 'Selection 2'.
    APPEND gs_page TO gt_page.
    For Action, Key is also irrelevant.
    gs_page-typ = 'A'.
    gs_page-info = 'Action goes here'.
    APPEND gs_page TO gt_page.
    ENDFORM. " build_page_header
    REWARD IF USEFULL

Maybe you are looking for

  • Which video card to use?

    I have a 24" external monitor attached to my MBP. Should I be using the better graphics card (9600M GT, or the normal 9600M)? Currently I am using the 9600M and things seem ok. I'm just wondering what advantages would come from using the better one?

  • My airport express needs to be rebooted every day, what's wrong?

    Does the fact that I have a router and the airport express cause some redundancy?

  • Disk does not show in /dev/dsk or /dev/rdsk

    Is there some command I need to execute to get my disks to show up? It is a virtual disk created in a logical domain. This is the guest server and at the ok prompt a devalias shows the disk. It also shows up in : ../../devices/virtual-devices@100/cha

  • SSD in old MacBook Pro (MacBookPro5,3) - worry about NVIDIA controller issue?

    Hi! I have the old MacbookPro5,3 - (Core2Duo 2,66 GHz with 8GB RAM), so a SSD would really make it go for another year og two. I do realize that I will not benefit of the full speed of the SSD because the machines max speed is SATA2/3GB/s: That's no

  • Re: After installing W7, have no more sound

    Hello, After a clean install of windows xp, i had no more sound, so i thought perhaps with installing W7 it will work better, but no sound... I tried already lots of things as i found on different forums but without solving the problem... The FN + ES