How to use concatenated sequence name in pl/sql

how can we have a sequence concatenated with another sequence
name eg
select ab.nextvalue into var1 from dual;
where a is a sequence and b is another sequence
null

Try this Puneet:
TO_NUMBER(TO_CHAR(a.nextvalue)

Similar Messages

  • How to use get column name.vi in SQL toolkit 2.0?

    Due to the vi "get column name.vi" paremeters,no table name has connected to the vi. So, I want to ask how to use this vi for gain one column name of a table. Maybe there are some other ways to solve column name getting.
    Thanks.

    Thanks!
    Error 4101 Description:
    Execute SQL - The connection, statement, or query handle you provided is not valid.
    I don't just used the toolkit in a while,now, I am developing a irrigation system. For the table field names defined by users,column names must be known before any select operations. Do you have any other good idea about drawing out the columnname parameters?
    As you know, a valid DSN and table have been also available. The database I used is Access. The bad thing to me is that there is no any text information gotten. And I think, it may be some problems in connection way which I don't find out.
    Really appreciated by your reply.
    Could you give me some example in the aspect?
    Thank you again.

  • How to find which sequence name is used in a table

    Hi..
    I have a table.. it uses some sequence name..
    But how can we find that the table is using so and so sequence...
    From which USER_* table is used for that
    thanks

    user5451445 wrote:
    I know this is an old thread but I was in the position of the original author and I use this, based on responses here I make this query that can be useful when the sequence is attached to the table using triggers (the most common scenario). I would agree that the most common use of a sequence is probably to generate a PK for a table.
    I would agree that, when using a sequence to generate a PK, using a trigger is best practice.
    But those two agreements do NOT add up to validating you assumption that "attaching" a sequence to a table using a trigger is the most common scenario.. Many shops feel that triggers are inherently evil and forbid there use. Even without that, many developers refuse to use the facilities of the database and insist on putting everything in their app code. Thus, even when using a sequence, they embed it in their app, thus allowing the use of the sequence to be bypassed by other code.
    And in the case of someone trying to locate the use of the trigger, they must keep in mind that not all application code is in PL/SQL modules - it may very well exist completely outside of the database and thus be invisible to any query you could run on the database.
    Let's say we have a table tblproceso and a sequence proceso_id_seq, we wrote a trigger that put the next value from the sequence on every INSERT. With this query we can see in what table we use sequences like 'proceso_id_seq':
    select trigger_body, table_name
    from user_triggers
    where triggering_event = 'INSERT'
    and UPPER(dbms_metadata.get_ddl ('TRIGGER', trigger_name)) LIKE '%PROCESO_ID_SEQ%'
    This will show the trigger body and the name of the table where it's used
    Hope this can help other users with this scenario

  • I want to know how to use my domain name in business catalyst

    please I want to know how to use my domain name in business catalyst

    Hello marionussen,
    This issue of your's is specific to Buisness Catalyst and me have a forum for Buisness Catalyst. I would suggest you to post your query to forum: http://forums.adobe.com/community/business_catalyst for help.
    Let me know for any further query.
    Regards,
    Ratandeep Arora

  • How to use a Sybase table in Oracle SQL statement?

    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.

    user12088323 wrote:
    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.Any Oracle client connected to the Oracle database can access Sybase data through the <font style="background-color: #FFFFCC">Database Gateway for Sybase</font> (it requires an additional license) or the <font style="background-color: #FFFFCC">Database gateway for ODBC</font> (it's free).
    The Oracle client and the Oracle database can reside on different machines. The gateway accepts connections only from the Oracle database.
    A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and Sybase database.
    Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement.
    To access the Sybase server, you must create a <font style="background-color: #FFFFCC">database link</font>. A public database link is the most common of database links.
    SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO
    2  "user" IDENTIFIED BY "password" USING 'tns_name_entry';
    --dblink is the complete database link name.
    --tns_name_entry specifies the Oracle Net connect descriptor specified in the tnsnames.ora file that identifies the gatewayAfter the database link is created you can verify the connection to the Sybase database, as follows:
    SQL> SELECT * FROM DUAL@dblink;
    Configuring Oracle Database Gateway for Sybase
    <font style="background-color: #FFFFCC">{message:id=10649126}</font>

  • How to find which sequence name is used in a table - Redux

    (The other thread was locked before I could respond, so I'm posting this here as a non-question.)
    Beginning with 12c, there is now a way to associate a sequence with a table.  It's a new feature called an Identity column.
    create table t
    (some_id number generated as identity --< creates a system generated sequence
    ,name varchar2(30)
    insert into t (name) values ('Smith');
    insert into t (name) values ('Jones');
    insert into t (name) values ('Anderson');
    commit;
    select * from t;
            SOME_ID NAME
                  1 Smith
                  2 Jones
                  3 Anderson
    select table_name, column_name, data_default from user_tab_columns where table_name = 'T' and column_name = 'SOME_ID';
    TABLE_NAME COLUMN_NAME DATA_DEFAULT
    T          SOME_ID     "C##SELSE"."ISEQ$$_91955".nextval
    select * from user_sequences;
    SEQUENCE_NAME
    ISEQ$$_91955

    There's nothing stopping you from using the generated sequence for something else, however you can NOT override it when doing an insert (as long as you've specified ALWAYS which is the default).
    SQL> create table t
      2  (some_id number generated as identity
      3  ,name varchar2(30)
      4  );
    Table created.
    SQL> select * from user_sequences;
    SEQUENCE_NAME
    ISEQ$$_91970
    SQL> select ISEQ$$_91970.nextval from dual;
                 NEXTVAL
                       1
    SQL> select ISEQ$$_91970.nextval from dual;
                 NEXTVAL
                       2
    SQL> insert into t values (99,'smith');
    insert into t values (99,'smith')
    ERROR at line 1:
    ORA-32795: cannot insert into a generated always identity column

  • How to use sub sequences as sources

    Hi
    I want to take a section from a sequence, and use it for source material later on for a recap. I mark an in/out on the sequence, hit 'make subclip' then load it in the viewer monitor. When I splice it into the sequence, it is not made up of it's original cut clips, it is a whole clip called 'sequence name' subclip. How can I get the overwrite/splice from the subclip sequence to contain the original cuts. As is so often the case with FCP in my experience, this can be done without a fuss in seconds on Avid.
    Cheers for your time
    Mark.

    Hold the Command key as you make the edit either with the canvas edit overlay or with the F keys.
    Or even drag and drop editing ... the command key is the trick.
    A lot of folks like this to be the default behavior too ... so if you remap the existing Insert with Contents (Cmd-F9) and Overwrite with Contents (Cmd-F10) commands to the regular F9 and F10 keys then you get the best of both worlds.
    Cheers
    Andy

  • How to use the column names generated from Dynamic SQL

    Hi,
    I have a problem with Dynamic SQL.
    I have written an SQL which will dynamically generate the Select statement with from and where clause in it.
    But that select statement when executed will get me hundreds of rows and i want to insert each row separately into one more table.
    For that i have used a ref cursor to open and insert the table.
    In the select list the column names will also be as follows: COLUMN1, COLUMN2, COLUMN3,....COLUMNn
    Please find below the sample code:
    TYPE ref_csr IS REF CURSOR;
    insert_csr ref_csr;
    v_select VARCHAR2 (4000) := NULL;
    v_table VARCHAR2 (4000) := NULL;
    v_where VARCHAR2 (4000) := NULL;
    v_ins_tab VARCHAR2 (4000) := NULL;
    v_insert VARCHAR2 (4000) := NULL;
    v_ins_query VARCHAR2 (4000) := NULL;
    OPEN insert_csr FOR CASE
    WHEN v_where IS NOT NULL
    THEN 'SELECT '
    || v_select
    || ' FROM '
    || v_table
    || v_where
    || ';'
    ELSE 'SELECT ' || v_select || ' FROM ' || v_table || ';'
    END;
    LOOP
    v_ins_query :=
    'INSERT INTO '
    || v_ins_tab
    || '('
    || v_insert
    || ') VALUES ('
    || How to fetch the column names here
    || ');';
    EXECUTE IMMEDIATE v_ins_query;
    END LOOP;
    Please help me out with the above problem.
    Edited by: kumar0828 on Feb 7, 2013 10:40 PM
    Edited by: kumar0828 on Feb 7, 2013 10:42 PM

    >
    I Built the statement as required but i need the column list because the first column value of each row should be inserted into one more table.
    So i was asking how to fetch the column list in a ref cursor so that value can be inserted in one more table.
    >
    Then add a RETURNING INTO clause to the query to have Oracle return the first column values into a collection.
    See the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/returninginto_clause.htm#sthref2307

  • How to use parallel sequence for split the operation qty. urgent or other o

    PP guru
    My scenario is as follows.
    I ve one material suppose…xyz.
    For that material I' ve created bom, routing.
    In routing I' ve mention only one operation. 0010.
    Now I' ve the production order of 1000 kg.
    I want to use two work centers to run this production order. ( e.g.work center a and b)
    In routing I used work center a.
    In short I want split that operation.
    So what I ve to do or use parallel sequence and how???
    or else is there any other option to split the order to two or more machines/work center?
    Pls explain me in brief.
    Regards,
    Ram

    Hi,
      If you want to carry the production with two different work centers , first you need to split the operation qty.
    For this in the order type dependent parameters OPL8
    in the controlling tab page enable the indicator Cost collector
    and set the default rule as PP2.
      Create a Product cost collector with KKF6N.
       Now in the production order , select the operation and choose functions--->>> split.
       Now enter the operation split quantity and execute.
       Now in MD04 you can see two production order.
       In the second production order change the work center in the operation overview as desired and save.
      Regards,
    nandha

  • How to use a table name in the select statement using a variable?

    Hi Everybody,
                       I got a internal table which has a field or a variable that gets me some tables names. Now I need to retrieve the data from all these tables in that field dynamically at runtime. So could you suggest me a way out to use the select query which uses this variable as a table ?
    Regards,
    Mallik.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How to use new sequence when one is reached its maxvalue in PL SQL code

    Hi,
    Currently, I am populating a unique product serial number in a table column using a sequence call to generate new number. For different products, I have different sequences and in my PL SQL code usiing IF..Else block I populate serial number for different products. For one most selling product sequence, we are reaching a Max value in production in a month and to make sure that application will continue to work fine for various end users without getting any error on their screens, I want my code to switch to new sequence automatically. I just need to add another if condition but my problem is how to find accurately when max value is reached for old sequence.
    As call to old sequence can happen in different sessions there could be inconsistency and can end up at error. My new sequence value has to start with AV1000. Please suggest.
    My old sequence look like this :
    SEQUENCE Prd
    INCREMENT BY 1
    START WITH AS1000
    MAXVALUE AS9999
    MINVALUE AS1000
    CYCLE NOCYCLE
    CACHE 2
    Order Yes;
    Edited by: user11695088 on Jul 15, 2009 12:14 AM

    Catch the exception and use your new sequence. But somehow, I'm not liking your alternative approach.
    SQL> set line 300
    SQL> set pages 50000
    SQL> set serveroutput on
    SQL> create sequence testing_seq increment by 1 start with 1 maxvalue 3
      2  /
    Sequence created.
    SQL>
    SQL> create or replace procedure test_seq_proc(p_seq out number)
      2  is
      3  begin
      4     select testing_seq.nextval
      5     into p_seq
      6     from dual;
      7  --
      8     dbms_output.put_line(p_seq);
      9  --
    10  end;
    11  /
    Procedure created.
    SQL> declare v_out number;
      2  begin
      3     test_seq_proc(v_out);
      4  end;
      5  /
    1
    PL/SQL procedure successfully completed.
    SQL> /
    2
    PL/SQL procedure successfully completed.
    SQL> /
    3
    PL/SQL procedure successfully completed.
    SQL> /
    declare v_out number;
    ERROR at line 1:
    ORA-08004: sequence TESTING_SEQ.NEXTVAL exceeds MAXVALUE and cannot be instantiated
    ORA-06512: at "ETL_ADMIN.TEST_SEQ_PROC", line 4
    ORA-06512: at line 3
    SQL>Cheers
    Sarma.

  • How to use ODI sequences ??

    I have an interface which need an ODI sequence.
    When I execute it the value of the sequence is always the same.
    I have seen on another thread that it may pass by an agent but...
    I have 2 tables (source and target) from the same connexion which don't and won't have agent.
    How can I do ??
    My connexion is on an Oracle 10g RDBMS and I'm using an IKM SQL Control Append.
    This is not the first time I have problem with the ODI Sequence but this time I can't create an RDBMS one ...
    Thanks in advance,
    BM

    Hi guys,
    I have some questions, I am trying to create a dimension and it should use a sequence, but I am getting the same issue as you guys. I can't not generate a unique key because my sequence is the same value for all rows.
    So if I really understood there are two ways to use a sequence in ODI. One is using ODI sequence (creating it inside ODI) and other is using a RDBMS sequence.
    First: What I have to do to use a RDBMS sequence? (Step by step please)
    Second: I can't use an IKM SQL to SQL append in my interface. This interface is pretty simple - source is a flat file target is an Oracle table, I just need to move all flat files columns to Oracle table adding a sequence. I understood that my Staging area should be different than my Target area based on posts above. I already created a new datastore to be my new staging area, but I don't know how to make an association between interface and new stage area.
    Can you please provide me the easiest solution?
    Thanks
    Leo

  • HT2486 i created a group in address book and when wanted to use it it does not allow me to use it in email how do use a group name i created?

    I created a group in address book and wanted to use it, it does not allow me to use it in email how do I use a group name i created?

    How many in the group? Some ISP's have a restriction on that. Check with your ISP.

  • HOW TO USE a sequence in merge load

    Hi,
    Someone can help me with a solution for loading a table with merge option and one of the column has values from a sequence.
    regards
    Babu

    Can we use a sequence to load a table with IKM Oracle Incremental Update (MERGE)?

  • How to bind a column name in PL/SQL

    i have this code in a transaction report.
    DECLARE
    q VARCHAR2 (1000);
    t VARCHAR2 (15);
    BEGIN
    t := '11110000';
    q := q || 'select STARTDATE, PHONESOURCE, PHONETO, DURATION ';
    q := q || 'from TRANSACTION ';
    q := q || 'where TRANS_ID = ' ||t|| 'and STARTDATE between :P3_DATE_FROM and :P3_DATE_TO ';
    q := q || 'and PHONESOURCE = :P3_FILTER_BY_TEXT';
    RETURN q;
    END;
    I have a combo box item which suppose to select between 2 different columns (PHONESOURCE & PHONEDEST) lets call this combo box: P3_FILTER_BY.
    I need to replace 'PHONESOURCE' (marked) with this combo box in order to set the query dynamically. the question is: is it possible? and if so how?
    i tried few variaton of replacing it, but it wouldn't work.

    thank u for your answer,
    However, i've thought about it and tried it before. but it gave me this error when applying the edit page:
    "LS-00103: Encountered the symbol "&" when expecting one of the following..."
    even when i checked the "Use Generic Column Names (parse query at runtime only)" check box it gave me this error in runtime.
    so, what should i do ??

Maybe you are looking for

  • Function module for vendor balance

    i m creating a creditor report for that i use any bapi as well as function module available in sap for better perfomance and better quality of report. waiting for reply thanking you in advance

  • Acrobat X Pro crashes when document closed if launched from COM API

    Environment: Windows 7 Acrobat X Pro I'm seeing some unusual behaviour when running the following code which simply launches the Acrobat Application and opens up a document with Acrobat X Pro.  Closing the document causes the program to become unresp

  • Refresh itab is not getting triggered

    hi, SELECT ebeln bukrs ernam lifnr spras FROM ekko INTO CORRESPONDING FIELDS OF TABLE g_it_ekko WHERE lifnr IN r_lifnr. DESCRIBE TABLE g_it_ekko LINES n. grid-lines = n. IF sy-subrc = 0. MESSAGE s002(zsan) WITH n. ELSE. REFRESH g_it_ekko. MESSAGE e00

  • I have problem with some gosts on the side of the display !?

    I have problem with some gosts on the side of the display !? and I want to make a back up of my mac and to take it to the store for the problem I gut !

  • 7921 and aironet 1200 problem

    I have set up a network consist of 2 7921 wireless phones and an aironet 1200 AP. I'm able to scan the network and get connected to the network using my laptop, however, the wireless phones keep prompting 'Locating Network Services' then 'Connection