[SOLVED][BASH] Using a string to pass multiple arguments.

I'm scratching my brain on this little project my friend roped me into.
I have a function which generates a list of VM's and their states and stores it as a variable. this list is to be presented to the user using the libgui.sh 'ask_option' function. The problem is that the ask_option function does not interpret it correctly. And by saying ask_option isn't doing it right I mean I am expecting a certain behavior, and that expectation is flawed.
Here are the two parts in question
#assume VMLIST has a value identical to this assignment after my function call:
#I have confirmed that this is the exact value
VMLIST="\"Arch Linux Live\" \"running\" \"Windows XP\" \"power off\""
ask_option 0 "VMs Present" '' optional "0" "Return to the Main Menu" $VMLIST
What I actually get shows that ask_option is interpreting each discreet word as an argument. whereas I want the argument to be the text between each quote
0 Return to Main Menu
"Arch Linux
Live" "running"
"Windows XP"
"power off"
Obviously what I want is a two column output in the dialog that resembles
0 Return to Main Menu
Arch Linux Live running
Windows XP power off
What should our approach be to rectify this? How can I use the variable to suppply discreet arguments to another function? or rather how can I have the value of the variable interpreted literally on the function call line?
Last edited by OrionFyre (2011-04-05 19:04:49)

ARRAYS! I knew that
Thanks scary face kitteh!
I should have remembered arrays. alas. that's what happens when you don't use it for a while.

Similar Messages

  • Using query strings to pass variables...

    I'm trying to use the query string method to pass some
    variables into a SWF, but I can't seem to get it to work. All of
    the documentation I've seen references the object/embed method for
    displaying the SWF, but I'm using Dreamweaver's
    AC_RunActiveContent.js method to display the SWF. Would this cause
    a problem for the query string?
    Here's what I'm trying in the HTML that houses it:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="../bk.css" rel="stylesheet" type="text/css"
    />
    <script src="../Scripts/AC_RunActiveContent.js"
    type="text/javascript"></script>
    </head>
    <body>
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','wid th','301','height','240','src','videoplayer','quality','high','pluginspage','http://www.ma cromedia.com/go/getflashplayer','movie','videoplayer'
    ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="301" height="240">
    <param
    name="movie" value="videoplayer.swf?vid=dbc2006" />
    <param name="quality" value="high" />
    <embed
    src="videoplayer.swf?vid=dbc2006" quality="high"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="301"
    height="240"></embed>
    </object></noscript>
    </body>
    </html>

    I've been doing a little research... not being a programmer,
    I'm a little out to lunch on this stuff. I now realize that what I
    put in the HTML page is meaningless, unless the viewer's browser
    won't use JavaScript.
    I now know that I need to define my variables in the HTML
    page, and have the .js file recongnize and use them.
    That's where my lack of knowledge really gets in the way. :)
    Does anyone have any thoughts on how to modify the .js file to put
    my "?vid=dbc2006" into the string?
    Thanks!

  • Passing multiple arguments to CFC ???

    I am passing two parameters to a CFC via WebService, as seen
    below. This works fine.
    WebService.MyCFC(argument1, argument2);
    However, I have some CFC functions that I am passing more
    than 10 arguments into. Instead of having a lengthy string of
    arguments on my above code, I would like to create an object
    (array?) that stores each argument. I did this when I was coding in
    CF7 using the ColdFusion tags that rendered Flex-like code. Below
    is the example I used:
    var editArguments:Object = {};
    editArguments.Argument1 = 'my first argument';
    editArguments.Argument2 = 'my second argument';
    WebService.MyCFC(editArguments);
    When trying this in Flex, I get the following error. I am
    unsure what I am doing wrong and I've Googled and Googled and
    cannot find my answer I am looking for. First of all, is it even
    possible to attempt what I am trying? Thanks!
    faultCode:EncodingError faultString:'Array of input arguments
    did not contain a required parameter at position 1'
    faultDetail:'null'

    any ideas?

  • Passing multiple parameters (caption and textbox) to another form failing to pick up Caption

    I have an Microsoft Access application that is more like a form than a database. Users complete the form and then submit it to us for review. There are many questions and memo fields on the different forms (sections). Some of the memo forms are small due
    to the limitation of the size of the form (22 inches) therefore there is a lot of scrolling. I want to include a button on each question so that when users click on it will display a form where I pass the label caption (question) and the answer to this form.
    Alternatively I can have a expanded form for each question but that would require over 50 forms. The Application is quite large. I wanted to have one form and just call the different questions/answers.
    The below is working for the text box (AnswerTxt). However the CaptionTxt is not holding it's value when it gets to the new form. It's only displaying the name of the variable name, CaptionTxt
    On the form where the data resides I have:
    Private Sub test_Click()
    Dim CaptionTxt As String
    Dim AnswerTxt As String
    CaptionTxt = Me.lblSect11_5.Caption
    AnswerTxt = Me.Section11_5.Value
    Debug.Print CaptionTxt
    Debug.Print AnswerTxt
    DoCmd.OpenForm "Form1", OpenArgs:="CaptionTxt|" & AnswerTxt
    End Sub
    On the new form with an expanded memo field
    Private Sub Form_Load()
    Dim intPos As Integer
    Dim strControlName As String
    Dim strValue As String
    If Len(Me.OpenArgs) > 0 Then
    ' Position of the pipe
    intPos = InStr(Me.OpenArgs, "|")
    If intPos > 0 Then
    strControlName = Left$(Me.OpenArgs, intPos - 1)
    Debug.Print strControlName
    strValue = Mid$(Me.OpenArgs, intPos + 1)
    Debug.Print strValue
    ' Retrieve Control Name from the first part of the string
    Me.lblText11.Caption = Left$(Me.OpenArgs, intPos - 1)
    ' strControlName = Left$(Me.OpenArgs, intPos - 1)
    ' Retrieve Value to Assign from the end of the string
    Me.txt_Section11.Value = Mid$(Me.OpenArgs, intPos + 1)
    ' strValue = Mid$(Me.OpenArgs, intPos + 1)
    ' Assign the value to the control
    ' Me(strControlName) = strValue
    End If
    End If
    End Sub
    jim neal

    The below is working for the text box (AnswerTxt). However the CaptionTxt is not holding it's value when it gets to the new form. It's only displaying the name of the variable name, CaptionTxt
    It will, because you are passing it as a literal string with:
        DoCmd.OpenForm "Form1", OpenArgs:="CaptionTxt|" & AnswerTxt
    In this "CaptionTxt|" is a literal string, whereas AnswerTxt references the variable.  It should be:
        DoCmd.OpenForm "Form1", OpenArgs:=CaptionTxt & "|" & AnswerTxt
    You might be interested in the file Args.zip in my public databases folder at:
    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
    This little demo file illustrates how to pass multiple arguments, using a module originally developed by Stuart McCall and later expanded by me to allow the passing of named arguments.
    Ken Sheridan, Stafford, England

  • ArrayDescriptor multiple arguments

    hi all,
    Can we able to pass multiple arguments in a single ArrayDescriptor, instead of creating multiple ArrayDescriptor obeject.
    Example
    ArrayDescriptor a_desc = ArrayDescriptor.createDescriptor("A_ARRAY", connection);
    ARRAY app_array = new ARRAY(a_desc, connection , a_id);
    ArrayDescriptor r_desc = ArrayDescriptor.createDescriptor("R_ARRAY", connection);
    ARRAY read_array = new ARRAY(r_desc, connection , r_id);
    Thanks.

    apexlearner wrote:
    Can we able to pass multiple arguments in a single ArrayDescriptor, instead of creating multiple ArrayDescriptor obeject.
    Example
    ArrayDescriptor a_desc = ArrayDescriptor.createDescriptor("A_ARRAY", connection);
    ARRAY app_array = new ARRAY(a_desc, connection , a_id);
    ArrayDescriptor r_desc = ArrayDescriptor.createDescriptor("R_ARRAY", connection);
    ARRAY read_array = new ARRAY(r_desc, connection , r_id);Does this have anything to do with APEX? Looks like Java.

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • Probs sharing a report that uses SETPARAM to pass multiple parameters

    Ok we have master DB account Disco that creates reports. I also have oracle acct Duser for the users to run the reports.
    Per Metalink Note:304192.1, we've got the setparam stuff working to pass in date parameters into our sheet. This works fine when I run the report as Disco. When I try to share the report to Duser, it still prompts for the dates, but then the report returns all 0's for the results. I have no idea why this is happening.
    Any suggestions on how to share reports with other users that pass in parameters would be much appreciated. thanks!!
    Allen

    Hi Allen,
    I would always recommend that you use sys_context to pass parameters. You can search this site for sys_context or take a look at (Re: Passing multiple parameters into Custom Folder... for more details.
    Rod West

  • Pass username and password adfs without using query string

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hello MohitJainMJ,
    You're not in the right forum. Here it's for FIM topics!
    Regards,
    Sylvain

  • Pass username and password ADFS without using query string, Please help.

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hi,
    According to your post, my understanding is that you had an issue about the ADFS.
    As this issue is related to ADFS, I recommend you post your issue to the forum for ADFS.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding and support.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • How to pass multiple records to target side using xquery

    Hi Everybody,
    I am using xquery transformation.
    Input: Source payload contains 5 variables.
    Target payload contains 5 variables.
    I have input with payload with multiple instance like:
    <Input>
    <payload1>
    <a>1<a>
    <b>2<b>
    <c>3<c>
    <d>4<d>
    <e>5<e>
    </payload1>
    <payload1>
    <a>6<a>
    <b>7<b>
    <c>8<c>
    <d>9<d>
    <e>10<e>
    </payload1>
    </Input>
    So my requirement is to pass above records into target side,
    So I am using xquery Transformation.
    I have written code as follows.
    (:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
    (:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
    declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
    declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
    declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
    declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
    declare namespace ns0 = "http://diversey.com/THRecAdv";
    declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
    declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
    as element(ns1:ShipmentReceiptEBO) {
    for $THRecAdvFields  in $tHRecAdv1/ns0:THRecAdvFields
    return
    <ns1:ShipmentReceiptEBO>
    <ns4:Identification>
    <ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
    <ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
    <ns4:ApplicationObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:Revision>
    <ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
    <ns4:InvoiceReference>
    <ns4:InvoiceIdentification>
    <ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
    </ns4:InvoiceIdentification>
    </ns4:InvoiceReference>
    <ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
    <ns4:Identification>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
    <ns4:ApplicationObjectKey>
    <ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
    schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
    </ns4:ApplicationObjectKey>
    <ns4:AlternateObjectKey>
    <ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
    <ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
    </ns4:AlternateObjectKey>
    <ns4:Revision>
    <ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
    </ns4:Revision>
    </ns4:Identification>
    <ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
    <ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
    <ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
    <ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
    <ns4:Status>
    <ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
    <ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
    </ns4:Status>
    <ns1:ShipmentReceiptTransaction>
    <ns1:ShipmentReceiptTransactionLot>
    <ns1:ShipmentReceiptItemLotReference>
    <ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
    <ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
    </ns1:ShipmentReceiptItemLotReference>
    </ns1:ShipmentReceiptTransactionLot>
    </ns1:ShipmentReceiptTransaction>
    </ns1:ShipmentReceiptLine>
    </ns1:ShipmentReceiptEBO>
    declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
    xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
    But while importing this code to OSB,and tested it ,
    With 1 payload it successfully shows the data in Target side,
    But while testing with multiple line items,i am getting an error as follows.
    *Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
    So please provide me the steps how to pass multiple records to target side using xquery.
    Regards,
    Jyoti Nayak

    Hi Jyoti Nayak,
    You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
    declare function xf:setToList($set1 as element(ns0:set))
    as element(ns0:list) {
    <ns0:list>
    for $pair in $set1/ns0:pair
    return
    <ns0:entry>
    <ns0:key>{ data($pair/ns0:key) }</ns0:key>
    <ns0:value>{ data($pair/ns0:value) }</ns0:value>
    </ns0:entry>
    </ns0:list>
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points

  • I need to pass multiple select options using submit and reutrn

    dear all,
    my requirement is i need to pass multiple values for work center like(biw01,biw02,biw03    etc) for this iam giving as biwl* and biot* for the tcode zpp_hmm ,using this i am going to get total working hours of perticular equiment.
    for this iam using submit and return query but iam unable to pass multiple work centers as input.
    my code is
    DATA : z_budat TYPE  RANGE OF budat,
           wa_budat LIKE LINE OF z_budat.
    wa_budat-low = '20111001'.
    wa_budat-sign = 'I'.
    wa_budat-option = 'BT'.
    wa_budat-high = '20111031'.
    APPEND wa_budat TO z_budat.
    CLEAR wa_budat.
    *wa_budat-High = '20111031'.
    *wa_budat-sign = 'I'.
    *wa_budat-option = 'BT'.
    *append wa_budat to z_budat.
    DATA : z_arbpl TYPE  RANGE OF arbpl,
           wa_arbpl LIKE LINE OF z_arbpl.
    wa_arbpl-low = 'BIWL*'.
    wa_arbpl-sign = 'I'.
    wa_arbpl-option = 'EQ'.
    APPEND wa_arbpl TO z_arbpl.
    CLEAR wa_arbpl.
    wa_arbpl-high = 'BIOT'.
    *wa_arbpl-sign = 'I'.
    *wa_arbpl-option = 'BT'.
    *APPEND wa_arbpl TO z_arbpl.
    SUBMIT   zpp_rep_hemm_perf WITH s_bukrs = '1004'  WITH s_budat IN z_budat WITH      s_werks = 'SMJT'
                   with   S_ARBPL IN Z_ARBPL USING SELECTION-SCREEN '1000' AND RETURN.
    but my doubt is whether it is corect or wrong what ever i am passing inputs for arbpl.
    thanks in advance.

    You can pass all parameter (rsparams-kind = 'P') and select-options (rsparams-kind = 'S') as a single internal table of type RSPARAMS. Go on appending the field names and values as rows and pass using SELECTION-TABLE parameter of SUBMIT command.
    I gave appending one set of selection values for s_budat field but you can go on appending more values for s_budat and other fields.
    DATA: lt_rsparams TYPE TABLE OF rsparams,
          ls_rsparams TYPE rsparams.
    CLEAR ls_rsparams.
    ls_rsparams-selname  = 'S_BUDAT'.
    ls_rsparams-kind = 'S'.
    ls_rsparams-sign = 'I'.
    ls_rsparams-option = 'BT'.
    ls_rsparams-low =  '20111001'.
    ls_rsparams-high = '20111031'.
    APPEND ls_rsparams TO lt_rsparams.
    SUBMIT zpp_rep_hemm_perf WITH SELECTION-TABLE lt_rsparams
                      USING SELECTION-SCREEN '1000'
                      AND RETURN.

  • [Unknowingly Solved] Bash, passing password to ssh-add

    Hey guys,
    I'm working on a script to add my ssh key to my ssh-agent using pam_exec.so. pam_exec passes the password to my script over STDIN, which is fine. But I can't for the life of me figure out how to pass the password to ssh-add.
    I've already seen this question, but would really perfer not to have to install extra/expects just for this on script.
    Any ideas?
    Last edited by EvanPurkhiser (2013-08-14 05:40:34)

    Wow.. Ok. So I feel dumb. I was way over thinking this one.
    Since pam_exec passes the password to the script over STDIN (WITH a trailing null character) I actually just have to add the ssh-add command somewhere in the script and it will read from STDIN.
    I was actually stuck on this for awhile and had already tried
    echo "myPassword" | add-pass
    which obviously didn't work. And even now, trying something like this
    printf "MyPassword\x00" | ssh-add
    still doesn't work.
    I'm actually a little perplexed as to WHY this worked.
    Here's the full script
    #!/bin/sh
    # Takes a password from STDIN, starts the ssh-agent as a systemd user service,
    # and decrypts the ssh key using the provided password, adding it to the agent.
    # Handle inital checks as root
    if [ $(id -u) = 0 ]
    then
    # Don't execute if the user-session isn't running
    systemctl -q is-active user-session@${PAM_USER} || exit 0
    # Re-execute this script as the user to add their key (while piping STDIN)
    cat | exec su ${PAM_USER} -c $(realpath ${BASH_SOURCE[0]})
    # Handle adding the key as the user
    else
    # We need to specify the XDG_RUNTIME_DIR because pam_systemd won't have run
    export XDG_RUNTIME_DIR=/run/user/$(id -u)
    # Get the SSH_AUTH_SOCK variable from the user session
    export $(systemctl --user show-environment | grep SSH_AUTH_SOCK)
    # Ensure the ssh-agent service is started
    systemctl --user start ssh-agent
    ssh-add
    fi
    ... Marking as unknowingly solved
    Last edited by EvanPurkhiser (2013-08-14 05:40:58)

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

  • Any way to pass Multiple Values for a single Label in the Parameter?

    I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
    One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter. 
    PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
    Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
    QUESTION:
    Any way to pass Multiple Values for a single Label in the Parameter?
    I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
    it correct.
    I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
    Note: We are using Report Builder 3.0

    Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
    Try creating either a function or stored procedure using the code below (compliments to
    http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string: 
    CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
    RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
    BEGIN
    DECLARE @SeparatorPosition INT
    DECLARE @ArrayValue VARCHAR(1000)
    SET @Array = @Array + @Separator
    WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
    BEGIN
    SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
    SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
    INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
    SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
    END
    RETURN
    END
    Once created you can do things like this:
    SELECT * FROM Parse('John,Bill,David,Thomas', ',')
    SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
    WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
    This is what your SQL query would probably look like:
    SELECT OperationID, OperationName FROM dbo.Operations
    WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
    You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value.

  • Passing multiple character values from parameter form to PL/SQL

    Hi,
    I am passing multiple character values from parametr form into
    the report query and a PL/SQL procedure. It works fine with the
    query, when I use &variable. But, it doesn't compile in PL/SQL,
    so I just used the :variable, but not getting any records in the
    PL/SQL procedure. Any suggestions?
    sincerely,
    gj

    gj / Fedro,
    Only using the &referecne, you can pas a string / multiple character values and this would work for query only.
    The bind parameter in PL/SQL wouls support only single value
    Thanks
    The Oracle Reports Team

Maybe you are looking for

  • Error while cancelling a migrated PO

    Hello All, We are trying to cancel a migrated PO. While cancelling, we are getting an error Document control failed due to error in [DOCMGR-CANCEL] with a return code of [OTHER]. I referred the note Master Note of Fixes for Error - Document control f

  • Serial # invalid

    I received an Adobe error message saying that I needed to uninstall then re-install my Adobe Acrobat 9 Pro.  When I went to re-install it said my serial number was invalid.  This is the same serial # I used when I bought this software initially and i

  • Bridge CS5 not recognizing xmp files created on CS6?

    An employee of mine edited several shoots, using her own computer.  She has CC and used Camera RAW.  I still use CS5 and am trying to process the files she edited (I have the RAW and the xmp files).  Typically, I process these through Bridge.  Howeve

  • I just downloaded Firefox.How do I get Firefox showing on my desktop?

    How do I make it so the Firefox program is showing on desktop? I can get to information about Firefox but how do I see the actual program?

  • Zoom, Drag and Protect Images

    I'm a total JavaFX newbie so I ask for advice on what to use. I want to publish some (could be many) large scanned documents to the web and want the following. 1. Make the images protected, i.e. hard to access other than through my JavaFX app. 2. Zoo