DatabaseProcedure with return type prefixed with schema name

Hi (Paco)
I have a question about the DatabaseProcedure class. We are using Oracle proxy users for our database connections.
Everything is accessed via a database role that are granted to the logged on user. All our database objects, tables etc are protected with this database role.
When I want to call a database function/procedure I need to add the schema name as a prefix to the custom database object that we uses for parameters/return types.
So far so good. I can also define a parameter prefixed with schema name via the DatabaseProcedure.registerArrayType ...
But when I try to define a function call that uses this parameter I get an error saying "Declaration is not valid".
The problem is located to the PROCEDURE_DEFINITION regular pattern:
private static final Pattern PROCEDURE_DEFINITION = Pattern.compile("\\s* (FUNCTION|PROCEDURE) \\s+ ([\\w.$]+) \\s* (?:\\((.*?)\\))? \\s* (?:RETURN\\s+(\\w+))? \\s* ;? \\s*", CASE_INSENSITIVE | COMMENTS | DOTALL); The return type cannot be prefixed with the schema name.
Any good suggestions or workarounds?!
I actually did change the pattern runtime via reflection to make it work - but I really don't like this solution in the long run!
/Torben
Edited by: Zonic on 2013-05-07 10:52

Hi Torben,
I think I have a workaround for the issue that might work for you. If you look at the source of <font face="courier">DatabaseProcedure.registerArrayType</font> you find that it actually calls <font face="courier">DatabaseProcedure.registerCustomParamType</font>.
public static void registerArrayType(String name)
  registerCustomParamType(name, Types.ARRAY, Array.getORADataFactory(), name);
}As a workaround you could replace your calls to <font face="courier">DatabaseProcedure.registerArrayType</font> with calls to <font face="courier">DatabaseProcedure.registerCustomParamType</font> as follows.
// Instead of DatabaseProcedure.registerArrayType("NAME.WITH.DOTS") call:
DatabaseProcedure.registerCustomParamType("anyNameWithoutDots", Types.ARRAY, Array.getORADataFactory(), "NAME.WITH.DOTS"); // Don't forget to use uppercase here.
DatabaseProcedure dp = DatabaseProcedure.define("procedure my.procedure(param1 in out anyNameWithoutDots)");
DatabaseProcedure.ParamType type = dp.getParamDef(0).getType();
System.out.println(type.getName() + " is " + type.getTypeName()); // ANYNAMEWITHOUTDOTS is NAME.WITH.DOTSThis way you don't have to use the "illegal" name in the DatabaseProcedure definition.
Regards,
Paco van der Linden

Similar Messages

  • Function with return type boolean

    I have created a function with return type boolean as:
    CREATE OR REPLACE FUNCTION fn RETURN BOOLEAN
    AS
    exp EXCEPTION;
    BEGIN
    return TRUE;
    EXCEPTION
    when OTHERS then RAISE exp;
    END;
    FUNCTION fn compiledThen I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'Can someone please help me understand, why this happened?
    Is this because of boolean return type?

    952040 wrote:
    I have created a function with return type boolean as:
    Then I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    What is the parameter signature for DBMS_OUTPUT.put_line() ?
    Is is string - as detailed in Oracle® Database PL/SQL Packages and Types Reference guide.
    So how can you pass a boolean data type as parameter value, when the parameter's data type is string?
    PL/SQL supports implicit data conversion. So you can for example pass a number or date value to DBMS_OUTPUT.put_line() - and the PL/SQL engine automatically (and implicitly) converts that (using the TO_CHAR() functions) to a string.
    However, the TO_CHAR() parameter signature supports number and date - not boolean. It cannot convert a boolean value into a string.
    So passing a boolean value means the implicit conversion fails - and results in the above error.
    To make it work, you need to perform an explicit conversion. As as a data type conversion function from boolean to string is not available, you need to write a user defined function. E.g.
    SQL> create or replace function BoolToChar( b boolean ) return varchar2 is
      2  begin
      3    case
      4       when b then return( 'TRUE' );
      5       when not b then return( 'FALSE' );
      6    else
      7      return( null );
      8    end case;
      9  end;
    10  /
    Function created.
    SQL>
    SQL> exec DBMS_OUTPUT.put_line( 'Flag is '||BoolToChar(true) );
    Flag is TRUE
    PL/SQL procedure successfully completed

  • How to create a webservice with return type File

    Hi All,
    I have a class Letter and I am trying to expose viewReport as webservice.
    In Jdeveloper -> Business teir -> webservices -> Java web service and I have selected my method i.e. viewReport
    Now it throws error "The return type java.io.File of method viewReport can not be serialized into XML"
    I unserstood the issue but How can I achive this in JDeveloper
    public class Letter {
    public Letter() {
    super();
    public File viewReport(String name) {
    File folder = new File("C:\\APPS\\root\\pdf\\10052011");
    File[] listOfFiles = folder.listFiles();
    return listOfFiles[0];
    }

    You can't as File is nor serializable. It won't make sense as you would try to give a handle to a file on the server hosting the service to a remote system.
    Can you explain the use case in more detail?
    Timo

  • Dynamic prefix of schema name in PL/SQL objects

    I have a requirement where schema name would be passed as a parameter to the procedure and I am supposed to write some DML statements on some of the fixed tables. The table names are common among any schemas, but then only the schema names change.
    This weird requirment is because, here they do not maintain same names for schemas on DEV,QA,UAT and PROD databases, and I can not change that. My thoughts are that it can be acheived only using Dynamic SQL. I want to know whether any alternate ways exist since this is going to be the case on various packages and procedures. For example I have a package with around 80 procedures in it which have couple of DML statements in it. Now they want to pass the schema name to main procedure and want the 80 procedures to perform the DML on the schema name passed :)
    So, should I change all the 80 procedures and make all the DML in it to Dynamic SQL (I am afraid I might end up doing that)? Please not that I can not change all the environments to same schema names (Not in my hands)
    Please suggest.

    You can make use of this inside you programs. We do this.
    You can prefix the value before the object names.
    When the procedure can run from same user who has privs on other schemas.
    Just set the current_schema to HR , SCOTT or others.
    You will not need to Pass Parameters for each procedure.
    Current User can be same as the procedure run from or owner of the procedure.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    SCOTT
    SQL> alter session set current_schema=hr;
    Session altered.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    HR
    SQL> alter session set current_schema=scott
    Session altered.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    SCOTTSS

  • Working with table type any with mapping according to keys

    Hi All ,
    I have table type any with data and I need to fill structure type any according to respective  key and verify that the field is have mapping .
    i.e. I have a table <lt_itab> and I need to find the specific entry on it according to the key and the mapping .
    I guess that the best way is to give example.
    <lt_itab> -  Is type any and can have lot of entries
    lt_key  -  Is specified table with field_name and value
    lt_map  -  Table with field_name which have mapping (have unique field name in every entry of the table )from f1..fn -
    I need to fill fields in <ls_output> just if they appear in lt_map
    <ls_output> - Is structure type any that in the end should have all the data from <ls_itab> according to the mapping and the keys of the table
    <lt_itab> - table
    f1  f2  f3  f4  f5 f6
    1   2    3  4   5  6 
    5   5    4  3   8  4 
    6   9    2  5   3  5
    1   3    3  4   2  1
    lt_key  - table
    field_name   value
    f1            1
    f2            3
    lt_map  - table
    field_name
    f1
    f2
    f5
    f6
    <ls_output> - structure
    field  value
    f1  -   1
    f2  -   2
    f3  "Not in mapping so it's empty
    f4  "Not in mapping so it's empty
    f5  -   2
    f6  -   1
    <ls_output> have the field values of the last entry of <lt_itab> according to the key of f1 and f2 and according to the mapping f3 and f4 are empty
    since they are not appaer in lt_map
    Regards
    Joy

    Hi
    You have to loop fully your main table in order to get the records in according to they keys:
    LOOP AT <LT_ITAB> ASSIGNING <WT_ITAB>.
       L_KO = SPACE.
       LOOP AT LT_KEY.
            ASSIGN COMPONENT LT_KEY-FIELDNAME OF STRUCTURE <WT_ITAB> TO <FS_KEY>.
            IF <FS_KEY> NE LT_KEY-VALUE.
               L_KO = 'X'.
               EXIT.
            ENDIF.
        ENDLOOP.
        CHECK L_KO IS INITIAL.
        LOOP AT LT_MAP.
            ASSIGN COMPONENT LT_MAP-FIELDNAME OF STRUCTURE <WT_ITAB>      TO <FS_FROM>.
            ASSIGN COMPONENT LT_MAP-FIELDNAME OF STRUCTURE <WT_OUTPUT> TO <FS_TO>.
            <FS_TO> = <FS_FROM>.
        ENDLOOP.
        APPEND <WT_OUTPUT> TO <LT_OUTPUT>.
    ENDLOOP.
    Max

  • IDoc generation with Message Type HRMD_A with filter on Personnel Area

    Hello All,
    We are facing an issue in generating IDoc using the standard message type HRMD_A.
    When we have no filters on the Distribution Model, the IDoc is generated through RBDMIDOC. When we use the filter on BUKRS, it generates the IDoc but gives an error status "Cross-system company code XXXX does not exist". I know to how resolve this issue. But, we tried to filter the changes with Personnel Area this time. So I have used the field PERS_AREA in BD59 with segment type E1PLOGI. When I run the standard report RBDMIDOC it gives the message "No data selected for distribution".
    I have checked the field name PERS_AREA from table TBD10, and it is mapped to T500P-PERSA. Change pointers are triggered and stored in BDCP2. Request experts to suggest what could be wrong with this.
    Thanks,
    Anil

    Hello Michele,
    If you have added BUKRS in BD59 for the message type, you will see Company Code (not filter1) in your filter criterion in BD64.
    Have you included the following code in FILTER_VALUES_SET method of the BADI implementation.
      CHECK OTYPE = 'P '.
      SELECT * FROM PA0001
               INTO PA0001 WHERE PERNR =  OBJID
                           AND   BEGDA <= SY-DATUM
                           AND   ENDDA >= SY-DATUM.
    record is valid today, no authorization check
        EXIT.
      ENDSELECT.
      IF SY-SUBRC = 0.
        FILTER1 = PA0001-BUKRS.   ELSE.
        CLEAR FILTER1.
      ENDIF.
    Lastly, just make sure the record you are testing for has your desired company code PGPB.
    Regards,
    Anil

  • Loop at table with unspecified type but with where-condition

    Hi,
    Doing a loop over an internal table with unspecified type and in addition using a condtion may be done as follows: Thereby the
    condition would be "... WHERE parentid EQ i_nodeid" if the type of <it_htab> would be static. However dynamic specification of a component through bracketed character-type data objects is not possible.
    FIELD-SYMBOLS: <it_htab> TYPE STANDARD TABLE,
                                    <wa_htab> TYPE ANY,
                                    <parentid> TYPE rsparent.
      ASSIGN me->ref_htab->* TO <it_htab>.
      LOOP AT <it_htab> ASSIGNING <wa_htab>.
        ASSIGN COMPONENT 'PARENTID' OF STRUCTURE <wa_htab> TO <parentid>.
        CHECK <parentid> EQ i_nodeid.
      ENDLOOP.
    Since you have to loop over the whole table and to check within the loop whether the condition is fullfilled, this is rather bad for performance.
    Questions: Are there any tricks to do this better?
    Best Regards and Thank you,
    Ingo

    >
    Lalit Mohan Gupta wrote:
    > you can put the condition in the where clause....
    only if you have the upcoming 7.0 EhP2 (Kernel 7.02 or 7.20) the following dynamic where works:
    DATA cond_syntax TYPE string.
    cond_syntax = `parentid = i_nodeid`.
    LOOP AT <it_htab> ASSIGNING <wa_htab>
                           WHERE (cond_syntax).
    in older releases you would have to use program generation to achieve a dynamic where... .
    Kind regards,
    Hermann

  • Joint 2 datatable with column type double with a seperater

    Can anyone please tell me how to merge 2 datatable of column type double with a seperator (|). one with datetime header and 2nd table with integer headers, like this
    table 1
    01/02/2015   01/03/2015
      12346          47894
    table 2
    1               2
    7899       45678
    to become
    01/02/2015        01/03/2015
    12346 | 7899    47894 | 45678
    thanks

    Hi Sysaide,
    According to your description, you'd like to migration the two dataTable to one.
    What is the corresponding relationship of these two DataTables? Or when you migrating, the 01/02/2015 column and 1 column are fixed to one column. what is the relationship between these two columns?
    Or, Does the first column of table1 correspond to the first column of table2? the second correspont to the second? ...
    If the column index is corresponding each other. you could use the following way.
    Getting out the value of each cell, then rebuild a new table to get this new value.
    In your example, your column type is DataTime, but the value in the column is still string type. The below sample is used two different column type, string and int. And I show the result in a dataGridView.
    DataTable dt1 = new DataTable();
    dt1.Columns.Add("01/02/2015", typeof(string));
    dt1.Columns.Add("01/03/2015", typeof(string));
    DataRow dr = dt1.NewRow();
    dr["01/02/2015"] = "11";
    dr["01/03/2015"] = "12";
    dt1.Rows.Add(dr);
    dr = dt1.NewRow();
    dr["01/02/2015"] = "21";
    dr["01/03/2015"] = "22";
    dt1.Rows.Add(dr);
    DataTable dt2 = new DataTable();
    dt2.Columns.Add("1", typeof(int));
    dt2.Columns.Add("2", typeof(int));
    DataRow dr2 = dt2.NewRow();
    dr2["1"] = 1111;
    dr2["2"] = 1122;
    dt2.Rows.Add(dr2);
    dr2 = dt2.NewRow();
    dr2["1"] = 2211;
    dr2["2"] = 2222;
    dt2.Rows.Add(dr2);
    DataTable dt = new DataTable();
    dt = dt1.Clone();
    for (int i = 0; i < dt1.Rows.Count; i++)
    dt.Rows.Add();
    for (int j = 0; j < dt1.Columns.Count; j++)
    dt.Rows[i][j] = dt1.Rows[i][j].ToString() + " | " + dt2.Rows[i][j].ToString();
    this.dataGridView1.DataSource = dt;
    Result:
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Implementing Empty Versions of Interface Methods with Return Types

    Subject probably is probably a bit long but I was stumped for a brief way to summarize my question. Let's say I have the interface below:
    public interface DAO {
        ...snip...
        public Object get(int id);
        public Object[] get(String clause);
        ...snip...
    }From this I want to make two concrete classes, say ClassOne and ClassTwo. Given the type of data each one is fetching, ClassOne only needs (and should only) implement get(int id) and ClassTwo only needs (and should only) implement get(String clause). This is because the first class will always deal with only one record from table_a and the second class will always deal with one or more records from table_b. So my question is what is the correct way to provide empty implementations for the unnecessary methods?
    I've thought of using an adapter to implement empty methods but a) I'm not sure that makes sense and b) I still end up have to return something. Another option was maybe having multiple interfaces, one returning a single object and the other returning an array. Neither of those options felt right and looked a bit goofy when I prototyped them out. It seems to me that I wouldn't want the classes using the concrete DAO classes to be able to call the wrong method, but I don't know how to hide the unused method. Right now I just return an empty Object or Object[] for the unused method but that seems goofy too, and makes the class using ClassOne or ClassTwo know the innards of the implementations.
    Anyway, any tips appreciated.
    Thanks,
    Pablo

    It sounds as if the methods weren't meant to be together, and so I'm wondering if you aren't better off with two distinct interfaces, one for each method. Otherwise one solution would be to implement a method that throws an exception if it is not meant to be called.
    edit: D'oh! Just when you least expect them, Ninjas! They're everywhere!
    Edited by: Encephalopathic on Apr 30, 2009 1:41 PM

  • Not able to fetch order type prefixed with 0.

    Hi Techies,
    I have a problem in getting order category field .
    The value for order category is '00',but iam getting this value as empty.
    iam getting this value from aufk and iam assigning this value to a local structure.
    if i pass autyp= '01' iam getting only 1.
    both the data types in table and my structre are same numc(2).
    iam confused,pls guide me further.
    Thanks

    Hi ,
    try this way..
    data :  v_autyp type aufk-autyp.
    move '00' to v_autyp.
    if aufk-autyp = w_autyp.
      "write your logic
    endif.
    or
    ranges : r_autyp for aufk-autyp.
    r_autyp-low  = 'I'.
    r_autyp-option  = 'EQ'.
    r_autyp-sign  = 'I'.
    append r_autyp.
    r_autyp-low  = '2'.
    r_autyp-option  = 'EQ'.
    r_autyp-sign  = 'I'.
    append r_autyp.
    if aufk-autyp in r_autyp.
      "write your logic
    endif.
    Prabhudas

  • Throw userDefinedException cannot work with return type

    Hi all,
    I have a servlet which will call method A. method A does some database sql statements.
    public static Vector methodA(..) throws UserDefinedException {
    ....ResultSet...
    ....Connection...
    ....Vector returnVector=new Vector;
    ....try {
    .......access database for whatever purpose
    catch (UserDefinedException) {
    throws new UserDefinedException.MY_MESSAGE;
    finally () {
    return returnVector;
    in the servlet, which calls MethodA, it looks like this :
    ....Vector myVector = null;
    try {
    ...myVector = <SomeClass>.methodA(...)
    catch (UserDefinedException e) {
    System.out.println("Exception is thrown out");
    somehow, if there is user defined exception being thrown in methodA, its not catch in the calling servlet. ie
    the println is not printed out.
    However, when i remove the return vector, make methodA return void (nothing), the user defined exception is caught. Why is this so ?

    A finally block always gets executed no matter what
    happens, so when there is a return statement Java
    seems to "forget" about the fact that an exception has
    been thrown.
    My advice: never return from anywhere in a try ..
    catch .. finally block.Hmm...why would java forget it has to throw something ? Sounds funny. But i think your advice is good, never return anything from a try /catch/finally block. Should i return the object in the last line of my methodA then ? Because by then, everything should go smoothly and the return object should be a valid one.

  • Currency traslation with rule type "routine with unit" in trasformations

    hi all,
    i am loading a flat file.in that file i am getting just amount.in target i have to load amount and currency as USD.i have to use the option " routine with unit" in trasformations.
    can any one please through some light.can any one provide sample code
    thanks
    srinivas

    Hi Srivinas,
    See the following sample code.
         RESULT = SOURCE_FIELDS-doc_currcy .
         CURRENCY = 'USD'.
    Hope this helps.
    Regards,
    Vidya Sagar

  • Same functions with different return types in C++

    Normally the following two functions would be considered the same:
    int getdata ( char *s, int i )
    long getdata ( char *s, int i )
    Every other compiler we use would resolve both of these to the same function. In fact, it is not valid C++ code otherwise.
    We include some 3rd party source in our build which sometimes messes with our typedefs causing this to happen. We have accounted for all of the function input types but never had a problem with the return types. I just installed Sun ONE Studio 8, Compiler Collection and it is generating two symbols in our libraries every time this occurs.
    Is there a compiler flag I can use to stop it from doing this? I've got over 100 unresolved symbols and I'd rather not go and fix all of them if there is an easier way.

    Normally the following two functions would be
    considered the same:
    int getdata ( char *s, int i )
    long getdata ( char *s, int i )Not at all. Types int and long are different types, even if they are implemented the same way.
    Reference: C++ Standard, section 3.9.1 paragraph 10.
    For example, you can define two functions
    void foo(int);
    void foo(long);
    and they are distinct functions. The function that gets called depends on function overload resolution at the point of the call.
    Overloaded functions must differ in the number or the type of at least one parameter. They cannot differ only in the return type. A program that declares or defines two functions that differ only in their return types is invalid and has undefined behavior. Reference: C++ Standard section 13.1, paragraph 2.
    The usual way to implement overloaded functions is to encode the scope and the parameter types, and maybe the return type, and attach the encoding to the function name. This technique is known as "name mangling". The compiler generates the same mangled name for the declaration and definition of a given function, and different mangled names for different functions. The linker matches up the mangled names, and can tell you when no definition matches a reference.
    Some compilers choose not to include the return type in the mangled name of a function. In that case, the declaration
    int foo(char*);
    will match the definition
    long foo(char*) { ... }
    But it will also match the definitions
    myClass foo(char*) { ... }
    double foo(char*) { ... }
    You are unlikely to get good results from such a mismatch. For that reason, and because a pointer-to-function must encode the function return type, Sun C++ always encodes the function return type in the mangled name. (That is, we simplify things by not using different encodings for the same function type.)
    If you built your code for a 64-bit platform, it would presumably link using your other compilers, but would fail in mysterious ways at run time. With the Sun compiler, you can't get into that mess.
    To make your program valid, you will have to ensure your function declarations match their definitions.

  • MIGO error with Return Delivery

    Dear guru ,
    We have a requirement where we:
    1.) Create a PO for a material using ME21N.
    2.) Post GR using MIGO
    3.) Post Return Delivery using MIGO with movement type 122, with "Return Delivery" flag set.
    When I post return delivery the system send me this error :
    VL 384  Sales Unit is not valid for item 000010
    How can I solve this problem ?
    Thanks in advance

    Hi,
    For return delivery, system always check the settings of material master in the distribution channel of intercompany transfer.
    If you have 2 dis channels for e.g 01 , 02
    And 02 is your intercompany dis channel then you have to maintainmaterial master in 02 for retur delivery.
    Kindly check the sales unit in this dis channel. You may get some help for this.
    Regards
    Karan

  • Transport error failure with return code 12

    Hello Experts
    I was trying to transport a request which consists of four Cubes, Infosources, datasources, Update rules and communication structure from QA to Test. The transport went without any problems from Dev to QA. However, while transporting to Q, it finished with errors with return code 12 with the following error: I tried to import it thrice with no success
    Program terminated (job: RDDEXECL, no.: 21120900)
    I checked in SM37 and the background job for this transport gets terminated everytime with the following dump:
    Error analysis                                                                               
    An exception occurred which is explained in detail below.  The exception, which is assigned to class 'CX_RSR_X_MESSAGE', was not caught and therefore caused a runtime error. The reason for the exception is: No text available for this exception   
    Does anyone has a clue about this?
    Thanks
    Rishi

    Hi Rishi ,
    The Issue may be with the buffer capacity while transporting .
    As i see from the post that you have captured all the objects
    in one request and sent to target system . As per my experience never include all the objects in one Request .
    Try to separate them depending on the onject types ,i mean datasource , infosource , ODS & cube seperately .
    IF you cannot solve the problem , i think it is better to create a new request as i said in Development and try to move them to production .If next time request fail then you can look at the only that particuler Request only .
    IF you have more information please share .
    Thanks
    Santosh

Maybe you are looking for

  • PL/SQL Table use in report region query

    Hello, I have a package function which return pl/sql table. I want to create a report region based on this pl/sql table. Is it possible to do this kind of report in HTMLDB? Please guide me in this area. Thanks HA

  • Is there an add on to attach a hyperlink to a word or phrase

    Say you are making a comment on a web page or blog and want to attach a hyperlink to a word or phrase - is there an add on for Firefox to do this

  • Print PDF Pages quality not high enough

    I'm pretty happy with using Aperture to design relatively simple photo books. Its great to stay in one tool. But I'm not happy with how it exports JPGs from the book I designed. Don't think its a problem with my automator workflow file either.  I'm u

  • HT4507 How do I connect my Canon ImageClass 4000 BW printer on Lion?

    Hello every one, I have a Canon ImageClass 4000 printer which was working fine with my OS 10.6, but since I installed Lion, I can not print. I would really appreciate if you could help me with this. Thanking you in advance.

  • Camcorder minidisc transfer to iMovie

    I have a number of DVD-RW minidiscs with video footage taken with a Canon camcorder. How can I transfer them to my MacBook so that I can edit them with iMovie?