Oracle 7.3.4 select into using long datatype

How do I copy values using plain SQL
Scenario
Table T1 (C1 int, C2 long)
Table T2 (C1 int, C2 long)
T1 has the following value in the respective columns
C1 = 1
C2 = ('A','B')
Now I tried the following
Insert into T1 select * from T2 ;
This is Illegal
How do I workaround and Is there a workaround ??
Thanks in Advance
null

Hi Gopal,
The earliest version (if Client & Server) Oracle supported on Windows 2000 was 8.1.6, now de-supported.
Currently certified are 8.1.7 and 9.0.1.
7.3.4 is long out of support, and there have been some fairly radical changes to Oracle and the Oracle network products since then, so I'd not be surprised it doesn't work.
Bob

Similar Messages

  • Error when using LONG Datatype

    Hi,
    I am transferring data from oracle to oracle. In my source table and target table i have a column of "long" datatype. When i execute the interface i am getting the following error.
    997 : 42000 : java.sql.SQLException: ORA-00997: illegal use of LONG datatype
    Cause: A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause.
    How can we resolve this issue in ODI?
    Thanks in Advance,
    Ram Mohan T

    Cezar,
    I am bit confused with the steps.
    1)     Create first interface with IKM Control append and flow_control yes but no long mapping
    This is the real interface to be created with out the Long Column mapping.
    2) Create second interface with IKM PL/SQL and "flow_control" NO and a "not exists "filter to "E$" (from first interface)
    Do I need to duplicate the same mapping here. I couldn’t understand this line Cezar. “and a "not exists "filter to "E$" (from first interface)”
    Does ODI doesnt provide any direct way to resolve this issue? When ever a table with Long datatype, do we need to do this steps?
    Thanks in Advance,
    Ram Mohan T

  • Oracle Function with a select into problem

    Here is one that I cannot figure out. I'm trying to select the median of a set of events in a purchase qty. I have the selects working in SQL. It returns the correct answer for several sets of test data. However, when I put this into a function to be able to call during more complex queries it doesn't work. I've tested the function several different ways and it's looking like the select median into v_median2... is not working. Please help!
    Here is the code... When this is run what ever is in v_plant is returned. IE: If you pass 1122 into with getmedian('4567','12345678-0001') this returns 4567 at the output. I've bypassed the v_plant and v_material in the select part below and it still output 4567.
    If you run the select (with test data put in place of v_plant and v_material in a sqlplus window without the INTO v_median2) it would return a 12.
    If you run this function as is it would return 4567.
    Here is the output from the dbms_output tests.
    4567
    12345678-0001
    4567
    12345678-0001
    4567
    WHY?
    CREATE OR REPLACE FUNCTION getmedian(v_plant IN VARCHAR2, v_material IN VARCHAR2)
    RETURN NUMBER
    AS
    v_median2 NUMBER;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(v_plant);
    DBMS_OUTPUT.PUT_LINE(v_material);
    SELECT MEDIAN INTO v_median2
    FROM (SELECT ROWNUM as rownums,MEDIAN
    FROM (SELECT abs(quantity_in_unit_entry) AS MEDIAN
    FROM tbl_transactions
    WHERE plant = v_plant
    AND material = v_material
    AND movement_type IN ('961','261','201')
    ORDER BY quantity_in_unit_entry DESC))
    WHERE ROWNUMs = ( select round(COUNT(1)/2,0) AS TOTAL2
    from tbl_transactions t
    WHERE plant = v_plant
    AND material = v_material
    AND t.movement_type IN ('961','261','201'));
    DBMS_OUTPUT.PUT_LINE(v_plant);
    DBMS_OUTPUT.PUT_LINE(v_material);
    DBMS_OUTPUT.PUT_LINE(v_median2);
    RETURN v_median2;
    END;

    It looks like another one of those cases where the pl/sql engine doesn't yet handle everything that the sql engine does. The usual solution is to execute the part that only works in sql dynamically. Try this:
    CREATE OR REPLACE FUNCTION getmedian
      (v_plant    IN VARCHAR2,
       v_material IN VARCHAR2)
      RETURN         NUMBER
    AS
      v_rownums      NUMBER          := 0;
      v_sql          VARCHAR2 (4000) := NULL;
      v_median2      NUMBER          := 0;
    BEGIN
      SELECT ROUND (COUNT (1) / 2, 0)
      INTO   v_rownums
      FROM   tbl_transactions
      WHERE  plant = v_plant
      AND    material = v_material
      AND    movement_type IN
             ('961', '261', '201');
      v_sql :=
      'SELECT median
       FROM   (SELECT ROWNUM AS rownums,
                      median
               FROM   (SELECT   ABS (quantity_in_unit_entry)
                                    AS median
                       FROM     tbl_transactions
                       WHERE    plant = :v_plant
                       AND      material = :v_material
                       AND      movement_type IN
                                (''961'', ''261'', ''201'')
                       ORDER BY quantity_in_unit_entry DESC))
       WHERE  rownums = :v_rownums';
      EXECUTE IMMEDIATE v_sql INTO v_median2
      USING v_plant, v_material, v_rownums;
      RETURN v_median2;
    END getmedian;

  • Select into using  parameters versus real values

    Can anyone please explain how PL/SQL operates in a condition where you pass in a value versus
    hardcoding it ? When it's hard coded, I get a 1 row response and the correct information
    When I pass in the value through the call statement, I get exact fetch returns more rows than requested number of rows. ORA - 01422
    Here is the command line pl/sql --
    declare
    n_count number;
    aa char(255);
    bb char(255);
    cc char(255);
    begin
    select vol_id, orig_id, incoming_msg
    into aa, bb, cc
    from
    table_name where file_name ='123456'
    and incoming_msg ='I';
    n_count :=sql%rowcount;
    DBMS_OUTPUT.Put_line ('sqlcode is' || sqlcode);
    end;
    sqlcode is 1.
    The above returns one row ... which is what I want
    Now if I wrap it to pass in the file_name That is where I get the fetch returns more rows.
    create or replace procedure test(file_name IN VARCHAR2)
    authid CURRENT_USER
    IS
    n_count number;
    aa char(255);
    bb char(255);
    cc char(255);
    begin
    select vol_id, orig_id, incoming_msg
    into aa, bb, cc
    from
    table_name where file_name =file_name
    and incoming_msg ='I';
    n_count :=sql%rowcount;
    DBMS_OUTPUT.Put_line ('sqlcode is' || sqlcode);
    end;
    procedure is successfully created..
    then
    Call TEST('123456');
    error at line 1p
    ORA-10422: exact fetch returns more than requested number of rows
    ORA -06512 at TEST, line 17
    Line 17 is the select vol_id, orig_id, incoming_msg
    into aa, bb, cc
    so what is it about select and into in a procedure that causes this error ... AND how to get around it ?
    Many Thanks in advance.

    sgonos wrote:
    Can anyone please explain how PL/SQL operates in a condition where you pass in a value versus
    hardcoding it ? When it's hard coded, I get a 1 row response and the correct information
    When I pass in the value through the call statement, I get exact fetch returns more rows than requested number of rows. ORA - 01422
    Now if I wrap it to pass in the file_name That is where I get the fetch returns more rows.
    create or replace procedure test(file_name IN VARCHAR2)
    authid CURRENT_USER
    IS
    n_count number;
    aa char(255);
    bb char(255);
    cc char(255);
    begin
    select vol_id, orig_id, incoming_msg
    into aa, bb, cc
    from
    table_name where file_name =file_name
    and incoming_msg ='I';
    n_count :=sql%rowcount;
    DBMS_OUTPUT.Put_line ('sqlcode is' || sqlcode);
    end;
    procedure is successfully created..
    then
    Call TEST('123456');
    error at line 1p
    ORA-10422: exact fetch returns more than requested number of rows
    ORA -06512 at TEST, line 17
    Line 17 is the select vol_id, orig_id, incoming_msg
    into aa, bb, cc
    so what is it about select and into in a procedure that causes this error ... AND how to get around it ?Perhaps this part...
    where file_name =file_namewhich of course will be true for every row.
    I would suggest you rename your parameter to p_file_name and have the SQL read:
    where file_name = p_file_name

  • How to get length of data on column with long datatype

    How to get length of data on column with long datatype without using pl/sql block

    ...another reason not to use LONG datatype for columns.
    Oracle advises to switch to LOB columns instead
    SQL> create table t
      2  (x long)
      3  /
    Table created.
    SQL> insert into t values (rpad ('x', 10000, 'x'))
      2  /
    1 row created.
    SQL> alter table t
      2  modify x clob
      3  /
    Table altered.
    SQL> desc t
    Name                                      Null?    Type
    X                                                  CLOB

  • Using long vs. clob datatype with Oracle 8.1.7 and interMedia

    I am trying to determine the best datatype to use for a column I
    wish to search using the interMedia contains() function. I am
    developing a 100% java application using Oracle 8.1.7 on Linux.
    I'd prefer to use the standard JDBC API's for PreparedStatement,
    and not have to use Oracle extensions if possible. I've
    discovered that there are limitations in the support for LOB's
    in Oracle's 100% java driver. The PreparedStatement methods
    like setAsciiStream() and setCharacterStream() are documented to
    have flaws that may result in the corruption of data. I have
    also noticed that socket exceptions sometimes occur when a large
    amount of data is transferred. If I use the long datatype for
    my table column, the setCharacterStream() method seems to
    transfer the data correctly. When I try to search this column
    using the interMedia contains() function, I get strange
    results. If I run my search on Oracle 8.1.6 for Windows, the
    results seem to be correct. If I run the same search on Oracle
    8.1.7 for Linux, the results are usually incorrect. The same
    searches seem to work correctly on both boxes when I change the
    column type from long to clob. Using the clob type may not be
    an option for me since the standard JDBC API's to transfer data
    into internal clob fields are broken, and I may need to stick
    with standard JDBC API's. My customer wishes to purchase a
    version of Oracle for Linux that will allow us to implement the
    search capability he requires. Any guidance would be greatly
    appreciated.

    I've finally solved it!
    I downloaded the following jre from blackdown:
    jre118_v3-glibc-2.1.3-DYNMOTIF.tar.bz2
    It's the only one that seems to work (and god, have I tried them all!)
    I've no idea what the DYNMOTIF means (apart from being something to do with Motif - but you don't have to be a linux guru to work that out ;)) - but, hell, it works.
    And after sitting in front of this machine for 3 days trying to deal with Oracle's, frankly PATHETIC install, that's so full of holes and bugs, that's all I care about..
    The one bundled with Oracle 8.1.7 doesn't work with Linux redhat 6.2EE.
    Don't oracle test their software?
    Anyway I'm happy now, and I'm leaving this in case anybody else has the same problem.
    Thanks for everyone's help.

  • Use variables in a SELECT INTO FROM command

    Hi,
    How do I use variables within a select into from command? I want to loop through SYS.DBA_TABLES using a cursor and count the number of rows in a
    selection of tables an then insert into a cardinality table.
    The count of rows will be stored in a variable called CNT, that bit is easy however I need a variable in the FROM clause because that
    value changes with every iteration of the cursor.
    e.g.
    CNT := 0;
    TN := "MyTable";
    select count(*) into CNT FROM TN;
    insert into cardinality (table_name, row_count) values (TN, CNT);
    This is Oracle 9i and I need the row counts in a separate table as they are shipped over to a different environment for analysis purposes.
    Any ideas?
    Regards
    Dave
    Edited by: Yorky001 on Sep 15, 2010 10:32 AM

    Hi,
    Thanks for the info, unfortunately I can get neither example to work on this 9i system, could well be pilot error as I only ever get
    to do any Oracle about once per year. In the first query I have tried both "user_tables" and SYS.DBA_TABLES, same result.
    set serveroutput on size 1000000;
    DECLARE
    row_count INTEGER;
    vstr VARCHAR2(500);
    vstr1 VARCHAR2(500);
    BEGIN
    vstr := 'SELECT count(*) FROM ';
    dbms_output.put_line(vstr);
    FOR i IN (SELECT table_name FROM user_tables WHERE rownum < 10) LOOP
    vstr1 := vstr || i.table_name;
    EXECUTE IMMEDIATE vstr1
    INTO row_count;
    dbms_output.put_line(i.table_name || ':' || row_count);
    END LOOP;
    END;
    This one complains about the execute immediate line.
    Error report:
    ORA-00933: SQL command not properly ended
    ORA-06512: at line 12
    00933. 00000 - "SQL command not properly ended"
    *Cause:   
    *Action:
    BEGIN
    FOR i IN (select
    table_name,
    to_number(
    extractvalue(
    xmltype(
    dbms_xmlgen.getxml('select count(*) c from '||table_name))
    ,'/ROWSET/ROW/C')) count
    from user_tables
    where rownum<6) LOOP
    dbms_output.put_line(i.table_name || ':' || i.count);
    END LOOP;
    END;
    ORA-19206: Invalid value for query or REF CURSOR parameter
    ORA-06512: at "SYS.DBMS_XMLGEN", line 121
    ORA-06512: at line 1
    ORA-06512: at line 2
    19206. 00000 - "Invalid value for query or REF CURSOR parameter"
    *Cause:    The queryString argument passed to DBMS_XMLGEN.newContext was not a valid query, or REF CURSOR.
    *Action:   Rewrite the query so that the queryString argument is a valid query or REF CURSOR.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Converting MS-Access select * into... to run in Oracle

    I have this stored procedure in MS Access:
    create procedure foo as
    begin
    if exists(select name from sysobjects where name='cif_retail)
    drop table 'cif_retail'
    select * into cif_retail from cif where cstresf=1
    end
    The above stored procedure checks if table cif_retail exists and if it exists it drops it and then it creates a new table cif_retail with data from cif with the condition cstresf=1.
    How can I do the above in Oracle SQL? I tried the following but it comlains about the drop command, and when i remove it, it complains about the create table command too. Please help:
    create or replace procedure foo as
    begin
    drop table w;
    CREATE TABLE w AS SELECT * FROM x;
    end;
    Thanks,
    Theodora

    You can Also Use
    FORMS_DLL
    Example
    PROCEDURE Create_N_Column_Number_Table (n NUMBER) IS
    my_stmt VARCHAR2(2000);
    BEGIN
    my_stmt := 'create table tmp(COL1 NUMBER';
    FOR I in 2..N LOOP
    my_stmt := my_stmt||',COL'||TO_CHAR(i)||' NUMBER';
    END LOOP;
    my_stmt := my_stmt||')';
    ** Now, create the table...
    Forms_DDL(my_stmt);
    IF NOT Form_Success THEN
    Message ('Table Creation Failed');
    ELSE
    Message ('Table Created');
    END IF;
    END;

  • MS-SQL - Oracle SELECT INTO conversion problem...

    Under MS-SQL (T-SQL) Select statement is defined as follows:
    SELECT select_list
    [INTO new_table_]
    ^^^^^^^^^^^^^^^^^^^^^
    FROM table_source
    [WHERE search_condition]
    [GROUP BY group_by_expression]
    [HAVING search_condition]
    [ORDER BY order_expression [ASC | DESC] ]
    Q:How under PL/SQL can one redirect sorted (ORDERed BY) results
    from SELECT query to another table.
    Slawek
    null

    I have asked the question because of the following reason:
    I have a large select query that returns rows from a table in
    different sort orders depending on user inputs, and I wonder if
    there is any way to return just the rows between two specified
    positions.
    I figured that I'm going to either create one temporary table
    with all the data (1000 records for example), sort the data in
    the prefered order and use the rownum method to obtain the row
    range (works fine under T-SQL). Other way is to try an inline
    view that return the rownumber. I can then restrict the numer of
    fields, e.g.
    select empid, rowNumber from emp,
    (select empid as id, rownum as rowNumber from emp) x
    where empid = id
    and rowNumber between 2 and 5
    The problem is that under Oracle the subquery is not allowed to
    have an ORDER BY clause (even if it had, rownum reflects row
    numbers before they were sorted) and there is no SELECT into
    TABLE_NAME.
    Michael Malicky (guest) wrote:
    : Slawek (guest) wrote:
    : : Under MS-SQL (T-SQL) Select statement is defined as follows:
    : : SELECT select_list
    : : [INTO new_table_]
    : : ^^^^^^^^^^^^^^^^^^^^^
    : : FROM table_source
    : : [WHERE search_condition]
    : : [GROUP BY group_by_expression]
    : : [HAVING search_condition]
    : : [ORDER BY order_expression [ASC | DESC] ]
    : : Q:How under PL/SQL can one redirect sorted (ORDERed BY)
    results
    : : from SELECT query to another table.
    : : Slawek
    : Order by is irrelevant when creating a new table out of a
    : query, as the rows are NOT stored in any order in a table.
    : The syntax for creating a new table out of an existing one
    : is:
    : CREATE TABLE new_table AS
    : SELECT select_list FROM old_table
    : WHERE ...
    : etc.
    : /mike
    null

  • How to modify a Procedure "select into" statement to use a cursor

    The below code fails with exception too many rows. How do I modify the Procedure's Select Into statement to use a cursor?
    CREATE OR REPLACE PROCEDURE Track_Asset(
       business_date IN NUMBER DEFAULT NULL,
       missing_table_name  OUT VARCHAR2)
    IS
       ln_business_date NUMBER;
        incorrectdateformat EXCEPTION;
    BEGIN
       IF business_date < 0
       THEN
          RAISE incorrectdateformat;
       ELSE
          DECLARE
            ln_business_date NUMBER;
          BEGIN
             SELECT MAX(business_date)
             INTO ln_business_date
             FROM sproof ;
          EXCEPTION
            WHEN NO_DATA_FOUND THEN
             dbms_output.put_line('NO MATCH FOUND');
            WHEN OTHERS THEN
            dbms_output.put_line('ORACLE ERROR :' || SQLERRM);       
          END;
          DECLARE
            missedfeedfnd EXCEPTION;
          BEGIN
             SELECT 'Missing Value : ' || table_name
             INTO missing_table_name
             FROM (
                SELECT UPPER(table_name) table_name
                FROM filespec
                WHERE data_table_name IN ('TABLE1','TABLE2','TABLE3')
                MINUS (
                SELECT DISTINCT UPPER(first_table_name)
                FROM dpca
                WHERE business_date = ln_business_date
                AND first_table_name IN ('TABLE1','TABLE2','TABLE3')
                GROUP BY UPPER(first_table_name) UNION
                SELECT UPPER(first_table_name)
                FROM dpca
                WHERE business_dt_num = TO_NUMBER( SUBSTR('201111', 1, 6) || '01' )
                AND first_table_name = 'TABLE4'
                GROUP BY UPPER(first_table_name) ));
                IF missing_table_name  IS NOT NULL THEN
                   dbms_output.put_line('Missing Value : '|| missing_table_name);
                   RAISE missedfeedfnd;
                ELSE
                  NULL;
                END IF;
          EXCEPTION
             WHEN TOO_MANY_ROWS THEN
       DBMS_OUTPUT.PUT_LINE (' SELECT INTO statement retrieved multiple rows');
              WHEN missedfeedfnd THEN
              raise_application_error ( - 20003, 'Missed Feed');
          END;
        END IF;
          EXCEPTION
       WHEN incorrectdatevalue
       THEN
          raise_application_error ( - 20001, 'Incorrect/Bad Date Entered');
    END;

    ok try this - OUT param will be populated with comma separated list of table names:
    PROCEDURE Track_Asset(
       business_date IN NUMBER DEFAULT NULL,
       missing_table_name  OUT VARCHAR2)
    cursor c_table_names is
    select datatablename
    from   ( select upper(datatablename) datatablename
             from   filespec
             where  data_table_name in ('TABLE1','TABLE2','TABLE3'                                 )
            MINUS
            ( select upper(first_table_name)
              from   dpca
              where  business_dt_num = [-- this date is retrieved by getting the MAX(business_date) from sproof table]
                     and fus_data_table_name in ('TABLE1','TABLE2','TABLE3'
              group  by
                     upper(first_table_name)
             UNION
              select upper(first_table_name)
              from   dpca
              where  business_dt_num = to_number( substr('201111',1,6) || '01' )
                     and first_table_name = 'TABLE4'
              group  by
                     upper(first_table_name)
    begin
       for rec in c_table_names
       loop
           missing_table_name  := missing_table_name  || rec.datatablename ||',';
       end loop;
       missing_table_name  := rtim(missing_table_name , ',');
    end ;HTH
    Edited by: user130038 on Dec 28, 2011 8:46 AM

  • Using SELECT INTO statement to transfer data from one DB to another?

    Hello,
    I need to move data from an SAP table to another downstream SQL server box without flat file in between. I have set up the DBCON interface, so that my ABAP code on SAP can connect to the remote SQL Server, then I can run INSERT command as Native SQL inside the ABAP.
    However, INSERT has performance problem. The best performer as I can find is SELECT INTO statement. But then I am stuck at how to use SELECT INTO to query my local SAP table and send (via INTO) to remote database. I am not even sure whether I should use Open SQL or Native SQL.
    Any suggestion? BTW, I understand the limitation of Native SQL, but we are OK to use it.
    Thanks!

    It appears that this is some kind of migration project due to the scope of the data contained in the single file? If so whatever you do is like ly to be trow away once the migration of data is completed.
    You have a couple of options:
    1) Get the data extracted from HFM in multiple files instead of one bulk file, broken down by scanario,year & period
    2) Take the single data dump file produced by FDM and manipulate it yourself to get the data in a more usuable format for processing through FDM.
    Option 2 could be achieved via any ETL tool or a custom file parsing script. What may be more attractive to you and allow you to fully leverage your investment in FDM is that you could use the PULL adapter that ships as part of the FDM adapter suite to perform this transformation exercise. The PULL adapter takes a flat file input and allows you to use all the in built functionality of FDM to transform it and output a modified flat file (or series of flat files). You could use it to produce multioload files or a series of files broken down by scenario,year,period.
    Whatever you do I would suggest that break the single data file down into smaller chunks as this will help with the iterative debugging process you will inevitably have to undetake whislt migrating the data to the new application.

  • "select into" query statements using the DI API

    I am trying to use the DI API (6.5) t create a temp table based on an existing table.  For example, here is a query string....
    select * into ORDR_TEMP from ORDR
    Code...
    oRecordSet := IRecordset(oCompany.GetBusinessObject(BoRecordset));
    oRecordset.DoQuery(sSql);
    Error I get...
    1). [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use SELECT INTO in browse mode. 2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared
    For any other regular select statements the previous code works.  Does anyone know for sure if a "select into" statement is not possible using the DI API?

    Hi Bill,
    I´m not really sure if select into is avaiable. But here you´ve got a hint: You could use a user defined function to do it, and just call the function from your code.
    SELECT dbo.MyFunction()
    Having this function defined in your SQL Server:
    CREATE function MyFunction ()
    returns char(2)
    AS
    Begin
    select * into ORDR_TEMP from ORDR
    Return ('OK')
    End
    Hope this helps,
    Ibai Peñ

  • Select * into table_name in oracle

    Hi,
    I would like to create a table in Oracle much like the way I do it in Sybase
    SELECT * INTO mytable FROM t WHERE 1 = 2
    gothanks,
    Ashok

    Try this (CTAS)
    CREATE TABLE t AS SELECT * FROM mytable WHERE 1 = 2;Note that unlike Sybase where you need database option 'SELECT INTO' turned on for SELECT INTO, the above wiil work with no issue in Oracle.
    As usual ensure that you have enough free space in Oracle database. CTAS will not create any other DDL statement like primary key constaint or indexes as they were on the original table (mytable).
    HTH,
    Mich

  • Combine two ints into a long without using chars or strings.

    Hi
    I have two ints and i need to combine (not add) them into a long value. The reason for this is because I need the make keys for a DB containing both values.
    eg.
    int1 = 3567453647
    int2= 6368535795
    long combination = combine(int1, int2);
    and the value of combination should be 35674536476368535795
    I know you can doing it by turning the ints into strings, combining the strings and then using the combined string as intput to a new Long(String) but I really need a faster way using pure maths (maybe bit shift?) as this combination function will be used billions of times.
    Thanks
    Edited by: user8908143 on 29-Sep-2010 19:52

    It's also a good way to get rid of boneheaded comments once one realizes how boneheaded they were. :-)A posteriori editing is another way :o)
    [OT: Forum features and moderators] A posteriori edition ( self- or mod- )
    Edited by: jduprez on Sep 30, 2010 6:21 PM
    That being said (and mocked), the binary shift left solution seems correct (although I'd definitely go for a custom class and double-column key instead).

  • Using select * into within a function

    What I'm wanting to do is to have a select query with many select fields and automatically create a new table (with the same schema) and insert the select result set in this new table.
    I can't seem to figure it out and doing the EXECUTE 'select * into dest_table from orig_table'; wouldn't work (not implemented yet).
    One reason I would like to do it this way is because the field attributes of orig_table may be different from one client to another.
    Thanks for any advice.

    Thanks very much.
    When I tried the execute immediate '...'; in the function I got an error stating: 'type "immediate" does not exist
    I tried to do some research on 'execute immediate' to see what might be the problem but couldn't find anything substantial to my cause.
    I just installed postgreSQL 8.2 this afternoon, and took all the installation defaults, so it may be something I need to configure.
    Anways, however, I just took the actual sql from the execute immediate call and that worked for me.
    Are there any pitfalls to doing it that way.
    Again, thanks for your quick and helpful reply.

Maybe you are looking for