Stepping through a query result set, replacing one string with another.

I want to write a function that replaces the occurance of a string with another different string.  I need it to be a CF fuction that is callable from another CF function.  I want to "hand" this function an SQL statement (a string) like this:   (Please note, don't bother commenting that "there are eaiser ways to write this SQL..., I've made this simple example to get to the point where I need help.  I have to use a "sub_optimal" SQL syntax just to demonstrate the situation)
Here is the string I want to pass to the function:
SELECT
  [VERYLONGTABLENAME].FIRST_NAME,
  [VERYLONGTABLENAME].LAST_NAME,
  [VERYLONGTABLENAME].ADDRESSS
FROM
  LONGTABLENAME [VERYLONGTABLENAME]
Here is the contents of the ABRV table:
TBL_NM,  ABRV    <!--- Header row--->
VERYLONGTABLENAME, VLTN
SOMEWHATLONGTALBENAME, SLTN
MYTABLENAME, MTN
ATABLENAME, ATN
The function will return the original string, but with the abreviations in place of the long table names, example:
SELECT
  VLTN.FIRST_NAME,
  VLTN.LAST_NAME,
  VLTN.ADDRESSS
FROM
  LONGTABLENAME VLTN
Notice that only the table names surrounded by brackets and that match a value in the ABRV table have been replaced.  The LONGTABLENAME immediately following the FROM is left as is.
Now, here is my dum amatuer attempt at writing said function:  Please look at the comment lines for where I need help.
      <cffunction name="AbrvTblNms" output="false" access="remote" returntype="string" >
        <cfargument name="txt" type="string" required="true" />
        <cfset var qAbrvs="">  <!--- variable to hold the query results --->
        <cfset var output_str="#txt#">  <!--- I'm creating a local variable so I can manipulate the data handed in by the TXT parameter.  Is this necessary or can I just use the txt parameter? --->
        <cfquery name="qAbrvs" datasource="cfBAA_odbc" result="rsltAbrvs">
            SELECT TBL_NM, ABRV FROM BAA_TBL_ABRV ORDER BY 1
        </cfquery>
     <!--- I'm assuming that at this point the query has run and there are records in the result set --->
    <cfloop index="idx_str" list="#qAbrvs#">      <!--- Is this correct?  I think not. --->
    <cfset output_str = Replace(output_str, "#idx_str#", )  <!--- Is this correct?  I think not. --->
    </cfloop>               <!--- What am I looping on?  What is the index? How do I do the string replacement? --->
        <!--- The chunck below is a parital listing from my Delphi Object Pascal function that does the same thing
               I need to know how to write this part in CF9
      while not Eof do
        begin
          s := StringReplace(s, '[' +FieldByName('TBL_NM').AsString + ']', FieldByName('ABRV').AsString, [rfReplaceAll]);
          Next;
        end;
        --->
    <cfreturn output_txt>
    </cffunction>
I'm mainly struggling with syntax here.  I know what I want to happen, I know how to make it happen in another programming language, just not CF9.  Thanks for any help you can provide.

RedOctober57 wrote:...
Thanks for any help you can provide.
One:
<cfset var output_str="#txt#">  <!--- I'm creating a local
variable so I can manipulate the data handed in by the TXT parameter.
Is this necessary or can I just use the txt parameter? --->
No you do not need to create a local variable that is a copy of the arguments variable as the arguments scope is already local to the function, but you do not properly reference the arguments scope, so you leave yourself open to using a 'txt' variable in another scope.  Thus the better practice would be to reference "arguments.txt" where you need to.
Two:
I know what I want to happen, I know how to make it happen in another programming language, just not CF9.
Then a better start would be to descirbe what you want to happen and give a simple example in the other programming language.  Most of us are muti-lingual and can parse out clear and clean code in just about any syntax.
Three:
<cfloop index="idx_str" list="#qAbrvs#">      <!--- Is this correct?  I think not. --->
I think you want to be looping over your "qAbrvs" record set returned by your earlier query, maybe.
<cfloop query="qAbrvs">
Four:
<cfset output_str = Replace(output_str, "#idx_str#", )  <!--- Is this correct?  I think not. --->
Continuing on that assumption I would guess you want to replace each instance of the long string with the short string form that record set.
<cfset output_str = Replace(output_str,qAbrs.TBLNM,qAbrs.ABRV,"ALL")>
Five:
</cfloop>               <!--- What am I looping on?  What is the index? How do I do the string replacement? --->
If this is true, then you are looping over the record set of tablenames and abreviations that you want to replace in the string.

Similar Messages

  • How to replace one variable with another in large number of queries

    Hello guys!
    I have this situation: our company needs to use one variable instead of another for certain amount of queries.
    Is there some way to automatically replace one variable with another for a certain characteristic in big number of queries ( like 150 - 200 ) ? Doing this manually would take lots of time)
    Apreciate your help!

    you could try (at your own risk) the following:
    1. search the technical id (ELTUID) of your variable in table RSZELTDIR
    2. see where this variable is used in table RSZELTXREF (by filling RSZELTDIR-ELTUIID in RSZELTXREF-TELTUID)
    3. add similar entries for your new variable
    4. delete the entries for the old variable (they're part of the key, so you can't simply "change" them)

  • Replace a string with another string in a file

    I have to replace a string with another string. Say for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived path like
    "c;\\sample folder\\sample subfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the file.

    I have to replace a string with another string. Say
    for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived
    path like
    "c;\\sample folder\\samplesubfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the
    file.
    public class Buckel {
      final static String CONST = "c:\\sample folder\\samplesubfolder\\samplefile.html";
      public Buckel() {
      public static void main ( String[] argv )  throws Exception {
        int    idx = 0;
        String in  = "<a href=\"##\"></a>",   // We'll imagine this just gets here somehow. If it's on the i/p file then take the '\' out B4 and aft the '##'.
               out = "";
        idx = in.indexOf( "##" );
        if ( idx > 0 ) {
          out = in.substring( 0, idx ) + CONST + in.substring( idx+=2, in.length() );
        System.out.println( out );
    }

  • Universally replace one character with another and then change font

    Hello,
    I have a geologic map file where there are hundreds of labels like Cc, Cz, Cwu, etc... all in the Arial font. I need to change all of the capital C's with a character from the StratagemAge font. That is to say, I need to find all instances of one character in my file and then replace them with another character and then change the font of that selected character.
    I've been trying to figure out how to write an action to do this, but I was wondering if there is a way to do this easily already.
    Any suggestions?
    Jeremy

    > how do you turn off the dialog for the Find/Replace in action palette?
    At the left of each Action step is a square field. Mouse over it and the tooltip will read "Toggle Dialog On/Off".
    > I got an action that I wrote to work, but it takes a button click for each instance in my file that I want to change. Would yours have that same drawback as that?
    Yes, you would have to click each time to run the Action (or, you could assign a function key), but there would be no dialog to dismiss.
    But you can pile several iterations of the same steps in the Action; so that one execution of the Action does ten replacements with one click, for example.
    This would not be a particularly difficult thing to Javascript, but you are correct that scripting has a learning curve. This task is not something I would think often needed. Doing a few hundred replacements in a file, using an Action would not seem overly burdensome to me. But if it is a recurring need for you, it might be worth writing a script.
    JET

  • Result set of One db to another DB

    Dear All,
    Need your help.
    I am posting my sample class below
    public static java.sql.ResultSet getData(String dbConnectStr,String dbuserID,String dbpwd,String query) throws Exception
    // Obtain default connection
    // Query all columns from the EMP table
    ResultSet rset = null;
    Connection conn = null;
    try
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    conn = (OracleConnection)DriverManager.getConnection("jdbc:oracle:thin:@"+dbConnectStr,dbuserID,dbpwd);
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    stat.execute("alter session set NLS_DATE_FORMAT='DD-Mon-RRRR HH:MI:SS'");*/
    System.out.println(query);
    Statement stmt = conn.createStatement();
    rset = stmt.executeQuery(query);
    System.out.println("returning");
    catch (SQLException e)
    e.printStackTrace();
    // Return the ResultSet (as a REF CURSOR)
    return rset;
    ################################## My Function in Oracle DB
    FUNCTION DB_CALL(dbConnectStr VARCHAR2,dbuserID VARCHAR2,dbpwd VARCHAR2,query VARCHAR2) return axsbcstatement.CUR is language java name 'com.axs.logc.OracleDeployProcedure.getData(java.lang.String,java.lang.String,java.lang.String,java.lang.String) return java.sql.Resultset' ;
    ########################### My Procedure Where i am calling this function
    PROCEDURE INSERT_call (inward_dbConnectStr VARCHAR2,inward_dbuserID VARCHAR2,inward_dbpwd VARCHAR2,query VARCHAR2,updateCnt out number) as
    up_cnt number(6) :=0;
    db_cur axsbcstatement.inward_cur;
    ENTRY_NMBR_field dummy_table.Entry_Nmbr%type;
    SNDR_NAME_field dummy_table.Sndr_Name%type;
    SNDR_ADDRSS_field dummy_table.Sndr_Addrss%type;
    RCVR_NAME_field dummy_table.Rcvr_Name%type;
    REMARKS_field dummy_table.Remarks%type;
    TRAN_AMNT_field dummy_table.Tran_Amnt%type;
    TRAN_DATE_field dummy_table.Tran_Date%type;
    BATCH_TRANID_field dummy_table.Batch_Tranid%type;
    BATCH_TIME_field dummy_table.Batch_Time%type;
    BEGIN
    db_cur := INWARD_DB_CALL(inward_dbConnectStr,inward_dbuserID ,inward_dbpwd ,query);
    loop
    fetch db_cur into ENTRY_NMBR_field,TRAN_ID_field,SNDR_NAME_field,SNDR_ADDRSS_field,RCVR_NAME_field,REMARKS_field,TRAN_DATE_field,BNFCRY_field,BATCH_TRANID_field,BATCH_TIME_field;
    EXIT WHEN db_cur%NOTFOUND;
    begin
    select ENTRY_NMBR INTO ENTRY_NMBR_field from dummy_table where ENTRY_NMBR = entry_nmbr_field and TRAN_ID = TRAN_ID_field;
    if SQL%found then
    dbms_output.put_line('Data Found in table ');
    end if;
    Exception
    when no_data_found then
    insert into dummy_table values(ENTRY_NMBR_field,TRAN_ID_field,SNDR_NAME_field,SNDR_ADDRSS_field,RCVR_NAME_field,REMARKS_field,TRAN_DATE_field,BNFCRY_field,BATCH_TRANID_field,BATCH_TIME_field);
    up_cnt := up_cnt+1;
    end;
    end loop;
    close db_cur;
    updateCnt := up_cnt;
    Exception
    when others then
    dbms_output.put_line(' - ' || SQLCODE|| ' ' ||SQLERRM);
    END INSERT_call;
    I am getting "ORA-00932: inconsistent datatypes: expected a return value that is a java.sql.ResultSet got a java.sql.ResultSet that can not be used as a REF CURSOR" this error while executing the procedure...
    i have tried so many things but not able to solve this problem..
    Apart from this If someone suggest me ...........
    I am having two different database.with same table structure .
    i have to take data from db1 and insert into the db2 on incremental basis (some checks required while inserting into the db2)
    Regards .
    Salil

    Just modify your procedure like this
    CREATE OR REPLACE PROCEDURE insert_call (
       inward_dbconnectstr         VARCHAR2,
       inward_dbuserid             VARCHAR2,
       inward_dbpwd                VARCHAR2,
       QUERY                       VARCHAR2,
       updatecnt             OUT   NUMBER
    AS
       up_cnt               NUMBER (6)                      := 0;
       db_cur               axsbcstatement.inward_cur;
    --   entry_nmbr_field     dummy_table.entry_nmbr%TYPE;
    --   sndr_name_field      dummy_table.sndr_name%TYPE;
    --   sndr_addrss_field    dummy_table.sndr_addrss%TYPE;
    --   rcvr_name_field      dummy_table.rcvr_name%TYPE;
    --   remarks_field        dummy_table.remarks%TYPE;
    --   tran_amnt_field      dummy_table.tran_amnt%TYPE;
    --   tran_date_field      dummy_table.tran_date%TYPE;
    --   batch_tranid_field   dummy_table.batch_tranid%TYPE;
    --   batch_time_field     dummy_table.batch_time%TYPE;
       all_rec              dummy_table.%ROWTYPE;
    BEGIN
       db_cur := inward_db_call (inward_dbconnectstr, inward_dbuserid, inward_dbpwd, QUERY);
       LOOP
          FETCH db_cur
           INTO all_rec;
          EXIT WHEN db_cur%NOTFOUND;
          BEGIN
             SELECT entry_nmbr
               INTO entry_nmbr_field
               FROM dummy_table
              WHERE entry_nmbr = all_rec.entry_nmbr AND tran_id = all_rec.tran_id;
             IF SQL%FOUND
             THEN
                DBMS_OUTPUT.put_line ('Data Found in table ');
             END IF;
          EXCEPTION
             WHEN NO_DATA_FOUND
             THEN
                INSERT INTO dummy_table
                     VALUES (all_rec.entry_nmbr, all_rec.tran_id, all_rec.sndr_name, all_rec.sndr_addrss, all_rec.rcvr_name, all_rec.remarks, all_rec.tran_date,
                             all_rec.bnfcry, all_rec.batch_tranid, all_rec.batch_time);
                up_cnt := up_cnt + 1;
          END;
       END LOOP;
       CLOSE db_cur;
       updatecnt := up_cnt;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line (' - ' || SQLCODE || ' ' || SQLERRM);
    END insert_call;Regards,
    Mahesh Kaila

  • Simple Query Result set as a %age of another result set

    Dear All,
    Query A is returning 3 key figures only (nothing in the rows) but with a filter on Customer in the free characteristics.
    Query B is returning the same key figures still with customer in the free characteristics but without a filter.
    I need query C to put the corresponding key figures from A over B and return a percentage.
    This needs to be done in the query and cannot be done in update rules.
    Can anyone help...?
    I of course will award as many points as I can to the first solution!
    Many thanks in advance,
    Stuart Humphrey

    If I understand correctly, then a customer exit is the way to go...
    One last question and I will post points as solved.
    In the web template I can set the variables so that their population is not forced and so prevent the user from having to select anything. 
    The variable can then be populated by the customer exit but when coding the customer exit, can I reference the free characteristics in the query and the values that are restricting them?
    I could then use those same restrictions to reduce the data set before obtaining the top 20 values (and hence the required list of 20 customers).
    Many thanks again....

  • How do you replace one image with another

    I have a page that displays the results of a search for information about a club. One of the items is the club's logo. It is displayed using the following code
    <img src="<?php echo $row_clubedit['club_logo_url']; ?>" alt="The Club's Logo"  class="logo" title="The Club's Logo">
    This works fine, except when no club has been selected, in which case it shows the default question mark in a blue box.
    It would be nice if I could display the Federation Logo, to which all the clubs belong, until a club is picked.
    Is there a simple way to set a default image that would be replaced from a data set.
    $row_clubedit['club_logo_url'] holds the url to the log in the format http://www.club.org/clublogo.png
    <img src="<?php echo ( 'federation_logo_url'); ?>" alt="The Club's Logo"  class="logo" title="The Club'c Logo">
    The logic I suppose would be
    if club_logo_url does not exist,
              then print the  federation logo,
         else print the club logo.
    How do you code that in php?
    I'm only a beginner at PHP.

    <img src="<?php echo $row_clubedit['club_logo_url'] == "" ? "http://www.club.org/clublogo.png" : $row_clubedit['club_logo_url']; ?>" alt="The Club's Logo"  class="logo" title="The Club's Logo">
    should do it

  • ABAP code help to replace one field with another

    Hi All,
    I have one DSO which is holding data for fields WBS(Old) and Company Code(Old).
    and I have one table which holds the information for Ols WBS and Ols Comp Code along with their New WBS and New Comp code.
    for eg:
    In DSO :
    Old WBS , Old Comp.Code
    abc        ,  001
    xyz        , 002
    In Table:
    Old WBS , Old Comp.Code , New WBS , New Comp.Code
    abc,           001,                    ABC,            001-04
    xyz,           002,                    XYZ,            002-04
    Now my requirement is ,
    search record by record from DSO and look into the table .
    If abc record in DSO matches with abc record in table, then in DSO it should replace with new WBS and Com.Codes.
    after the code, data in DSO shuld be lik this.
    WBS , Comp.Code
    ABC ,  001-04
    XYZ,   002-04.
    Thanks in advance,
    Sai Chand.S

    Hi
    If these fields are key fields dont think its possible to overwrite. Else plz write the following Code in End Routine it will overwrite the existing values in DSO.
    Select * from DSO into it_dso_temp. "U can even select only key fields WBS and CC fields.
    If sy_subrc=0.
    Sort it_dso_temp by WBS CC.
    endif.
    Select old WBS
               old CC
               new WBS
               new CC
    from Table
    into it_table
    for all entries in it_dso_temp
    where old WBS = WBS and old CC = CC.
    if sy_subrc=0.
    sort it_table by old WBS, old CC.
    endif.
    Loop at it_dso_temp assigning result_fields.
    Read it_table into wa_table with key old WBS = fs_dso_temp-WBS
                                                               old CC = fs_dso_temp-CC Binary SEarch.
    If sy_subrc = 0.
    result_fields-WBS = wa_table-new WBS.
    result_fields-CC = wa_table-new CC.
    endif.
    Endloop.
    Refresh result_package.
    result_package[] = it_dso_temp[].
    Also if incoming data has only old values u can loop at result package instead of it_dso_temp. let me know in case of issues.
    hope this helps !
    Reg
    Aparna

  • How to replace one symbol with another?

    I have a symbol with some very basic animations. I would like to set conditions upon which one symbol is swapped out for a symbol in a library. Each symbol is the same size, but so far I can't seem to get this right. I've attempted createChildSymbol but nothing really works.  I've got it set up as:
    My Stage:
    container0container (rectangle)
    container1container (rectangle)
    container2container (rectangle)
    button1
    button2
    My library symbols:
    Symbol_1
    Symbol_2
    Symbol_3
    Symbol_4
    Symbol_5
    I want to be able to click button 1, and replace the container1>container with container1>Symbol2 and then play the animation associated with container1
    Can anyone advise me on this?

    Not sure if it is what you want but try this:
    sym.$('down_btn').click(function(){
    var firstS = sym.createChildSymbol("Symbol_1", "container1");
    sym.play('down1');
    sym.$('up_btn').click(function(){
    var firstS = sym.createChildSymbol("Symbol_2", "container1");
    sym.play('up1');

  • How do I replace one table with another

    In my swing application I go out over the network and retrieve information, and then present that info in a table. Problem is this button can be pressed more than once, so in this case the old table needs to be replaced. Looking through the API their does not seem ot be a remove to compliment add. Right now when I hit the button multiple times another table just gets added to the right of the previous table.
    So how do I get rid of the first table?
    m

    Im not that advanced yet -- although I have looked over the literature and understand what you mean. Seems to me tables are more complicated than other swing elements. In any case, the container class DOES have a remove method, which is being used succesfully. Thanx for replying.
    m

  • Replace one view with another with animation

    Hello:
    I'm clearly not following some basic principle here so I'd appreciate some guidance.
    My intentions is to create a (quiz type) app with several screens (I'm assuming each of them will be a view that I will create in the Interface builder). The goal is to let user advance from screen 1 to screen 2 then to screen 3, etc. by answering multiple choice questions (presented as buttons). So when one button is clicked the current screen would slide to the left and the next screen would slide in. This animation is very much similar to the default Navigation-type app behavior, but in my case I do not need the navigation bar on top (since user should not be able to go back). By studying the latter example, I was able to find the following code that slides view controlers one over another:
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    SecondPage *secondViewController = [[SecondPage alloc] initWithNibName:@"SecondPage" bundle:nil];
    [self.navigationController pushViewController:secondViewController animated:YES];
    [secondViewController release];
    but in my project, that doesn't seem to work, as, I'm assuming, I do not have the navigationController member.
    What am I doing wrong here?

    Hi Den -
    Den B. wrote:
    The issue I have now is how to change the initial UITableView to my own view (that I can design in the interface builder)?
    Looks like you've made a lot of progress since your original question, so I'll skip the response I might have written earlier, unless you think it would be helpful to go back there. To your current question, I guess I should first ask "What initial UITableView?". My best guess is that you've found the Navigation-based Xcode template, which includes an instance of UITableViewController as the root view controller. Based on that guess, I take it you now want to replace the table view controller with a vanilla UIViewController so the root view needn't be a table view. Are these assumptions correct?
    If so, here's how to make the replacement:
    1) In RootViewController.h, change the super class from UITableViewController to UIViewController;
    2) In RootViewController.m, remove all the lines from (and including) "#pragma mark Table view methods" upto -(void)dealloc;
    3) Open RootViewController.xib, and select Window->Document from the top menu to make sure the "RootViewController.xib" window is open. This is the window that displays icons, not the editor window which displays the view. Delete the Table View icon (select it, then Edit->Delete). Then drag a UIView object into that window from the Library, then Ctrl-drag from File's Owner to the View icon to connect the 'view' outlet of File's Owner to the View object;
    4) Double-click on the newly added View icon to open the IB editor window and populate that window with the subviews you want, returning to RootViewController.h and .m to add IBOutlet properties and IBAction methods as needed. Once RootViewController.h is saved you can make the required connections to File's Owner in IB.
    Here's an example of how to hide the nav bar and transition to the next view from an action method:
    // RootViewController.m
    #import "RootViewController.h"
    #import "SecondViewController.h"
    @implementation RootViewController
    - (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBarHidden = YES;
    - (IBAction)nextView {
    SecondViewController *vc2 = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    [self.navigationController pushViewController:vc2 animated:YES];
    [vc2 release];
    PS. It "suks" to go from being a pro on one platform to a complete noob on another
    Many of us at this forum jumped from platforms such as Windows to iOS without any prior Cocoa experience, so you're among friends who understand the transition. In my case, after the first few weeks, I never wanted to see another dev environment again. So hang in there! It will be fun soon.
    - Ray

  • Replaces all occurnces of one String with another String in a given source

    Hi all I had found that there is a lot of interest int this topic. there is a little piece of code that I wrote for myself recently, so I fgigured that it might be helpful for some...
    This method will scan through a string "source", find all of the occurances of a String "before" and replace them with the "after".
    Enjoy :-)
    public static String replace(String source, String before, String after)
    StringBuffer sb = new StringBuffer(source);
    int startpos = source.indexOf(before);
    int endpos = startpos + before.length();
    int i = startpos;
    while( i > -1 )
         if( startpos > -1 && endpos <= source.length() )
         source = sb.replace(startpos, endpos, after).toString();
         int lastReplace = source.lastIndexOf(after) + after.length();
         if(lastReplace <= source.length())
              startpos = source.substring(lastReplace, source.length() ).indexOf(before);
                   endpos = startpos + before.length();
                   i = startpos;
         else
              i = source.length();
         else
              i = -1;
    return source;
    Oh yeah if you want, you can visit my site http://www.infobrokery.com it is where this code is used to replace the text URL with html.

    Since 1.4 the String class has a replaceAll method ...

  • Replacing one namespace with another using XML Anonymizer Module

    I've following XML message
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Result xmlns:ns0="urn:source_namespace">
       <ns0:Function/>
       <ns0:r/>
    </ns0:Result>
    but I need to have a little bit different namespace (which do not exist in above message)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Result xmlns:ns0="urn:target_namespace">
       <ns0:Function/>
       <ns0:r/>
    </ns0:Result>
    Any idea how to archieve this using  XML Anonymizer Module?

    Hi,
    You don't need a UDF to do this. Follow this...
    1. Edit the Message Type Result XML Namespace as urn:target_namespace from urn:source_namespace.
    2. Save this and activate it.
    3. In the Message Mapping go to edit and reload this new Message Type, save the changes and activate it.
    This blog How to remove namespaces in Mapping - XI By Sameer Shadab shows you hove to remove the namespace in you case you use the same to change the namespace
    Thanks
    SaNv...

  • Create a CF Query Result Set in Java

    I'd like to programatically build a ColdFusion query resultset inside of a Java class and return it to the calling application.  See the Java psudocode below to see what I'm talking about:
    public class MyClass {
         public coldfusion.sql.QueryTable getQuery() {
              // Create a query table object
              QueryTable myTable = ..?
              // Loop through some set of instance data for my class
              for(int c = 0; c < this.myWigets.length; c++) {
                   int row = c+1;
                   myTable.setField(row, nameCol, this.myWigets[c].name);
                   myTable.setField(row, colorCol, this.myWigets[c].color);
              return myTable;
    I've had stuff like this partially working in the past but had issues with things like query of queries and such probably due to the hacks used to create the QueryTable object.  I'm mainly just checking in to see if there has been any progress made in this area.  To me this seems like such an obvious thing for a Java developer working within CF to want to do.  I'm surprised Adobe doesn't have an officially supported API for doing this sort of thing (or maybe I'm just too dumb to find it.)    A few other notes... I'm not using CFX, and I'm not starting with a java.sql.ResultSet otherwise I would use the QueryTable(java.sql.ResultSet) constructor.  I need to build this thing from scratch programatically.
    Thanks for your time.  I hope this question makes sense to someone out there.
    - Mike

    I appologize.  I wasn't very clear with my original question.
    I'm creating an instance of my Java class from within CF using createObject("java", "com.example.MyClass").  So based on the sample code in my original post on the CF side I'd like to do something like this:
    <cfscript>
         myObj = createObject("java", "com.example.MyClass");
         myObj.doSomeStuff();
         myCFQuery = myObj.getQuery();  // Return a CF query from my java class
    </cfscript>
    ... then do stuff like ...
    <cfquery name="mySortedQuery" dbtype="query">
         select     *
         from       myCFQuery
         order      by color
    </cfquery>
    I appriciate your suggestions so far.  I have other solutions working already but they are not ideal.  I was just hoping someone had a clean and as-hack-free-as-possible way of creating a ColdFusion query result set in Java and passing it back to CF.
    Thanks again,
    Mike

  • Xcelsius with XMLA or XML Query Result Set

    Hi Experts,
    I want a direct connection from Xcelsius to my BW-Data. Because the new connection, coming with Fix Pack 2.1 is only avaiable for EHP 1 for NW 7.0 I tried to configure with XMLA and XML Query Result Set.
    This Document tells the necessary steps: How to integrate Xcelsius 2008 with SAP NetWeaver BI without Integration Kit.pdf.
    When I test my XML connection over http://<host>:<port>/TXmla/srvlet/TestXmla my Cubes will display.
    So I do a Webservice-Connection with WSDL-URL. At Input-Values there are some entries like CUBE_NAME, CATALOG_NAME...
    Output values arent avalible. How do I use these elements to show my Data in Xcelsius?
    My Problem with the XML Query Result Set Connection is, that when I Log On to VC the following error appears:
    You are not authorized to view the requested resource.
    So I get the authorisationobjects: S_DEVELOP and S_RS_COMP as describe in 'How To... Resolve Visual Composer Issues'.
    What values have I to enter by S_RS_COMP? And how can I enter my External Service in S_SERVICE. At the type WS the service isnt't avaiable.
    Regards,
    Jan

    To use XMLA web service you need a wrapper function build to convert the XMLA output to the Xcelsius format. There are some documents available in SDN on how to do this.
    You can use Live Office or Query as a Web service option to connect from Xcelsius to BW.
    S_RS_COMP is the query ID which you are trying to access, S_SERVICE you can either give * or try to set up authorization log and see the expected value.

Maybe you are looking for

  • Technical Architecture for ARIS

    Hi, I'm new to ARIS and SAP, I'm looking for a document/white paper that describes the technical implementation of ARIS and Netweaver for BPM and solution manager integration.

  • Help in Shell Script

    Hi , I need to find a strin inside a file I googled this, to write afeter sqlplus -s etc #while IFS=$(echo '\012\001') read LINE ; # do # case ${LINE} in ORA-*|SP2-*) ord.extractor_porven.sh # echo " JUSTO Dentro del error ORACLE se ha producido" # *

  • 360 degree panorama spin in Edge Animate (was: 360 degree panorama )

    I am trying to create 360 degree panorama. I've got an existing panoramic image made in photoshop which I imported into edge animate. I need the image move continuously and start over at the beginning seamlessly when the animation gets to the end of

  • How to Pass C_TBW45_70 Exam

    Hi EveryOne,                 I have around one year of Experience in ABAP and I am also SAP ABAP certified. I want to give exam of C_TBW45_70 . DO I need to have practical experience or if I study the books or join academy I can pass. Can anyone help

  • Lion - Multiple windows in Full Screen Mode

    Loving Lion.  Loads of great new features - some features do need a bit of breaking in, but all in all I am really enjoying using it. But... One niggling gripe I have is with using full-screen mode.  I am fishing for any better ideas or workarounds.