Cannot use sqlplus variable in create sequence statement

Hello!
I would like to create a sequence object starting with a number retrieved from a select statement:
var max_resp_no number;
begin
select max(substr(resp_no,2)) into :max_resp_no from brc_mast
where substr(resp_no,1,1)='Z';
end;
print max_resp_no;
drop sequence p659_resp;
create sequence p659_resp start with :max_resp_no;
It tells me that :max_resp_no is an 'invalid number';
TIA,
habeeb

You need to do this entirely in PL/SQL. You can either create a procedure, or use an anonymous block. The procedure version is below. Just change the CREATE to a DECLARE to get an anonymous block.
CREATE OR REPLACE PROCEDURE new_seq IS
max_resp_no NUMBER;
BEGIN
SELECT to_number(MAX(SUBSTR(resp_no,2)))
INTO max_resp_no
FROM brc_mast
WHERE SUBSTR(resp_no,1,1)='Z';
EXECUTE IMMEDIATE 'DROP SEQUENCE p659_resp';
EXECUTE IMMEDIATE 'CREATE SEQUENCE p659_resp START WITH '|| max_resp_no;
END;
SQL> CREATE SEQUENCE p659_resp START WITH 1;
Sequence created.
SQL> SELECT p659_resp.nextval from dual;
   NEXTVAL
         1
SQL> SELECT * FROM brc_mast;
RESP_
Z001
Z002
Z003
Z075
SQL> exec new_seq;
PL/SQL procedure successfully completed.
SQL> select p659_resp.nextval from dual;
   NEXTVAL
        75Note that the user creating this procedure will need to have CREATE SEQUENCE granted explicitly for the procedure to work. The anonymous block version should work if CREATE SEQUENCE is granted through a role.
John

Similar Messages

  • Using dynamic query to create sequence

    Hello,
    I created the sequence dynamically in a Procedure, but when I executed, it gave me an Insufficient privileges error:
    SQL> create table dummy (id number, module_id varchar2(20), p_order number, status varchar2(1));
    SQL> insert into dummy values (10, 'test', 0, 'D');
    SQL> CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
    V_MOD DUMMY.MODULE_ID%TYPE;
    v_query1 varchar2(200);
    v_query2 varchar2(200);
    V_COUNT NUMBER;
    begin
    v_query1 := 'drop sequence unqid';
    v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
    SELECT COUNT(*)
    INTO V_COUNT
    FROM USER_SEQUENCES
    WHERE SEQUENCE_NAME = 'UNQID';
    IF V_COUNT = 0 THEN
    execute immediate v_query2;
    ELSE
    execute immediate v_query1;
    execute immediate v_query2;
    END IF;
    SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    update dummy
    set P_order = 0, status = 'D'
    WHERE ID = P_ID
    and module_id = v_mod;
    --COMMIT;
    execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = V_MOD AND STATUS = ''A''';
    --COMMIT;
    END PRO_SEQ_ARRNGE;
    SQL> exec PRO_SEQ_ARRNGE(10);
    BEGIN PRO_SEQ_ARRNGE(10); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SYSTEM.PRO_SEQ_ARRNGE", line 15
    ORA-06512: at line 1
    Can you please advise how to resolve it?
    Thanks in advance,
    Tinku

    When I try it, I get a different error
    SQL> create table dummy (id number, module_id varchar2(20), p_order number, status varchar2(1));
    Table created.
    SQL>  insert into dummy values (10, 'test', 0, 'D');
    1 row created.
    SQL>  CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
      2  V_MOD DUMMY.MODULE_ID%TYPE;
      3  v_query1 varchar2(200);
      4  v_query2 varchar2(200);
      5  V_COUNT NUMBER;
      6  begin
      7  v_query1 := 'drop sequence unqid';
      8  v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
      9  SELECT COUNT(*)
    10  INTO V_COUNT
    11  FROM USER_SEQUENCES
    12  WHERE SEQUENCE_NAME = 'UNQID';
    13
    14  IF V_COUNT = 0 THEN
    15  execute immediate v_query2;
    16  ELSE
    17  execute immediate v_query1;
    18  execute immediate v_query2;
    19  END IF;
    20
    21  SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    22
    23  update dummy
    24  set P_order = 0, status = 'D'
    25  WHERE ID = P_ID
    26  and module_id = v_mod;
    27  --COMMIT;
    28
    29  execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = V_MOD AND STATUS = ''A''';
    30  --COMMIT;
    31
    32  END PRO_SEQ_ARRNGE;
    33  /
    Procedure created.
    SQL> exec PRO_SEQ_ARRNGE(10);
    BEGIN PRO_SEQ_ARRNGE(10); END;
    ERROR at line 1:
    ORA-00904: "V_MOD": invalid identifier
    ORA-06512: at "SCOTT.PRO_SEQ_ARRNGE", line 29
    ORA-06512: at line 1The problem is that you can't refer to a local variable like V_MOD in a dynamic SQL statement. You'd need to use a bind variable
    SQL> ed
    Wrote file afiedt.buf
      1   CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
      2  V_MOD DUMMY.MODULE_ID%TYPE;
      3  v_query1 varchar2(200);
      4  v_query2 varchar2(200);
      5  V_COUNT NUMBER;
      6  begin
      7  v_query1 := 'drop sequence unqid';
      8  v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
      9  SELECT COUNT(*)
    10  INTO V_COUNT
    11  FROM USER_SEQUENCES
    12  WHERE SEQUENCE_NAME = 'UNQID';
    13  IF V_COUNT = 0 THEN
    14  execute immediate v_query2;
    15  ELSE
    16  execute immediate v_query1;
    17  execute immediate v_query2;
    18  END IF;
    19  SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    20  update dummy
    21  set P_order = 0, status = 'D'
    22  WHERE ID = P_ID
    23  and module_id = v_mod;
    24  --COMMIT;
    25  execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = :1 AND STATUS = ''A'''
    26    using v_mod;
    27  --COMMIT;
    28* END PRO_SEQ_ARRNGE;
    29  /
    Procedure created.
    SQL> exec pro_seq_arrnge(10);
    PL/SQL procedure successfully completed.Of course, I'm not using the SYSTEM schema. You should really, really avoid SYS and SYSTEM-- things often work differently there than they do normally. I also join the other folks that have tried to help you in suggesting that creating a sequence dynamically in a procedure is a very poor idea and almost certainly indicates that you need to reconsider your design.
    Justin

  • How do I use a variable within a sql statement

    I am trying to use a local variable within an open SQL step but I keep getting an error.
    My sql command looks like this "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  locals.CurrentSerialNo
    If I replace the locals.CurrentSerialNo with an actual value such as below the statement works fine.
    "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  " 'ABC001' " 
    Can someone tell me how to correctly format the statement to use a variable?

    Hi,
    Thanks for the reply. I have changed the required variable to a string, but with no success. I have reattached my updated sequence file and an image of the error.
    When looking at the Data operation step I see that the sql statement is missing everything after the last quotation mark.
    Thanks again,
    Stuart
    Attachments:
    Database Test Sequence.seq ‏10 KB
    TestStand error.JPG ‏37 KB

  • How to use bind variable in this select statement

    Hi,
    I have created this procedure where table name and fieldname is variable as they vary, therefore i passed them as parameter. This procedure will trim leading (.) if first five char is '.THE''. The procedure performs the required task. I want to make select statement with bind variable is there any possibility to use a bind variable in this select statement.
    the procedure is given below:
    create or replace procedure test(tablename in varchar2, fieldname IN varchar2)
    authid current_user
    is
    type poicurtype is ref cursor;
    poi_cur poicurtype;
    sqlst varchar2(250);
    THEVALUE NUMBER;
    begin
         sqlst:='SELECT EMPNO FROM '||TABLENAME||' WHERE SUBSTR('||FIELDNAME||',1,5)=''.THE ''';
         DBMS_OUTPUT.PUT_LINE(SQLST);
    OPEN POI_CUR FOR SQLST ;
    LOOP
         FETCH POI_CUR INTO THEVALUE;
              EXIT WHEN POI_CUR%NOTFOUND;
              DBMS_OUTPUT.PUT_LINE(THEVALUE);
              SQLST:='UPDATE '||TABLENAME|| ' SET '||FIELDNAME||'=LTRIM('||FIELDNAME||',''.'')';
              SQLST:=SQLST|| ' WHERE EMPNO=:X';
              DBMS_OUTPUT.PUT_LINE(SQLST);
                   EXECUTE IMMEDIATE SQLST USING THEVALUE;
    END LOOP;
    COMMIT;
    END TEST;
    Best Regards,

    So you want to amend each row individually? Is there some reason you're trying to make this procedure run as slow as possible?
    create or replace procedure test (tablename in varchar2, fieldname in varchar2)
    authid current_user
    is
       sqlst      varchar2 (250);
       thevalue   number := 1234;
    begin
       sqlst := 'update ' || tablename || ' set ' || fieldname || '= ltrim(' || fieldname || ',''.'')  where substr(' || fieldname
          || ',1,5) = ''.THE ''';
       dbms_output.put_line (sqlst);
       execute immediate sqlst;
    end test;will update every row that satisfies the criteria in a single statement. If there are 10 rows that start with '.THE ' then it will update 10 rows.

  • Using computer variables in task sequence "Run Command Line"

    I am attempting to deploy VMs through VMware's vRealize Automation tool using CM. The process creates a CM computer object then creates a direct rule on a CM collection for the new computer object. During the creation of the computer object vRA creates computer
    variables provided by me on the computer object. I see the computer object built and i see the custom variables on the computer object:
    Name Value
    dns1 10.10.10.10
    dns2 10.10.10.11
    gateway 10.10.10.1
    ipAddress 10.10.10.2
    netMask 255.255.255.0
    In the task sequence the last step is to "Run Command Line":
    cmd /c netsh int ip set address name="Ethernet0" static %ipAddress% %netMask% %gateway% & cmd /c netsh int ip set dns name="Ethernet0" static %dns1% & cmd /c netsh int ip set dns name="Ethernet0" static %dns2% index=2
    When the TS gets to that step it doesn't substitute the variables in the command with the computer variables listed above. Looking at the smsts logs after the deployment is complete I see lines stating:
    Set Command Line:...
    Start executing command line:...
    Executing command line:...
    ProgramName = ...
    All of those lines show the command exactly as it is above with the %variables% intact.
    The command immediately fails with the error:
    Invalid address parameter (%ipAddress%). It should be a valid IPv4 address.
    Does anyone have a suggestion on why the TS isn't using the variables? I found this article https://technet.microsoft.com/en-us/library/bb693541.aspx but its for 2007 not 2012. I wasn't able to find something comparable for 2012.

    I don't know why anyone here thinks you *need* sccm osd to achieve fully automated customizations.
    Customer selects base image (2008 r2 core, 2008r2 gui, 2012 r2 core, 2012 r2 gui), which should be thin and with zero customizations anyway,
    vaai accelerated clone creates vm,
    ip addr/gateway/dns config is injected with powercli,
    customers config management engine agent of choice is installed via powercli script injection/execution (we have puppet users, ConfigMgr users, saltstack users, IEM users, Cheff users),
    the clone completes in ~2 minutes and a VM is presented to the customer in less than 5 minutes 
    Deploying windows VMs via SCCM OSD is not only slow, but requires dev work on the customer side to get things rolling which wastes everyone's cycles including your own

  • How to use presentaion variable in the SQL statement

    Is there any special syntax to use a presentation variable in the SQL Statement?
    I am setting a presentation variable (Fscl_Qtr_Var)in the dashboard prompt.
    If i set the filter as ADD->VARIABLE->PRESENTATION, it shows the statement as 'Contract Request Fiscal Quarter is equal to / is in @{Fscl_Qtr_Var} '.
    And this works fine but when i convert this to SQL, it returns
    "Contract Request Date"."Contract Request Fiscal Quarter" = 'Fscl_Qtr_Var'
    And this does not work.It is not being set to the value in the prompt.
    I need to combine this condition with other conditions in the SQL Statement. Any help is appreciated. Thanks

    Try this: '@{Fscl_Qtr_Var}'

  • I cannot use my pogo account as it states firefox has a bug in it and will not let java open

    I cannot use my pogo account this is what it states, how do I fix this, it worked fine this morning and tonight it isn't working
    It looks like you’ve the new version of Firefox. Unfortunately, there is currently a bug that is preventing players from playing Java games with version 3.6.14 of Firefox.

    See this: <br />
    https://support.mozilla.com/en-US/kb/pogo-and-other-java-pages-dont-work

  • Using toUpperCase variable in an If Statement

    Hi all,
    I am monitoring a user's input in my command-line program, and by converting their input to upper case, I can easily check whether they've input the correct string. However when I use the String in an If statement, it doesn't like it. Here's the simple test code I've been using:     public static void main(String[] args) {     
    BufferedReader keyboardInput = new BufferedReader(new InputStreamReader(System.in));     
    String priceOfPlayers = null;
    try  {
         System.out.print("Price Of Players: ");
         priceOfPlayers = keyboardInput.readLine();
         priceOfPlayers = priceOfPlayers.toUpperCase();                         
         System.out.println(priceOfPlayers);          
         if (priceOfPlayers != "ORIGINAL PRICE" && priceOfPlayers != "CURRENT PRICE") {
              System.err.println("\nYou Have Entered An Invalid Option!\n");          
         } catch (Exception e) {
              e.printStackTrace();
              System.exit(1);
         }However if I type in say 'original price' or 'current price' or 'ORIGINAL PRICE', it still brings up the error message that I have written! I do not understand why it doesn't interpret the String value properly.
    Any help explaining this would be superb!
    thanks

    Hi
    String comparison should use the equals method instead of ==
    if (!priceOfPlayers.equals("ORIGINAL PRICE") &&  !priceOfPlayers .equals("CURRENT RICE")) {
              System.err.println("\nYou Have Entered An Invalid Option!\n");          
         }

  • Can a strored procedure contain Drop Sequence /Create Sequence statement?

    I am trying to schedule a job to update the starting value of a sequence. So I need to write a strored procedure to drop and then recreate the sequence. But when i tried to cimpile the follwing stored procedue, it gave me the error "'DROP' is not a valid identifier". Is it illegal to have "Drop Sequence /Create Sequence " in a stored procedue? If this is true, is there any way to accomplish my task (simply recreate the same sequence with different starting value every month)? Thanks!
    Begin
    DROP SEQUENCE TEST_SEQ;
    CREATE SEQUENCE TEST_SEQ
    START WITH 0
    MAXVALUE 999999999999
    MINVALUE 0
    NOCYCLE NOCACHE NOORDER;
    End

    In general, it is a bad idea to try to encode information into a key because it
    - complicates queries in the future
    - complicates updates to the data in the future
    - can easily be generated on the fly from other data elements
    Inevitably, if you do something like what was proposed, you'll find out that the data encoded in the key gets out of date from the data stored in the row, that users are writing queries that do things like strip off the first 6 characters of the string in order to do date searches, and that users discover they want to be able to modify the data to fix the data that's encoded in the keys, which can be terribly expensive if there are child tables.
    Rather than trying to do this, I would store a DATE value and a non-reset sequence. You can always generate the reference number for the user by doing a TO_CHAR on the DATE and concatenating the output of an appropriate ranking function. If the users decide that they need to correct the DATE of an event, the reference number will be updated automagically since it was never stored in the database. A number generated in the query can also be guaranteed to be gap-free, which tends to please users.
    Justin

  • Using partition variable in task sequence

    I need to configure a piece of software as part of a task sequence to direct some of its files to a specific partition.  I have the ts creating 3 partitions and I'm specifying variables for each: DataDisk = 10GB, UsersDisk = 100GB, OSDisk = 100% remaining
    free space.
    The 100GB partition is the one I need the software to use. In the "Custom Tasks" section of the ts "Dump MDT Variables" step dumps all MDT variables to a text file on the local machine so I can see at that time UsersDisk = D:\, DataDisk
    = C:\ and OSDisk = V:\, but after the deployment finishes UsersDisk = E:\.  Also in the "Custom Tasks" section I'm running the "Configure Data Igloo" to configure the program.  Is there a way to set UsersDisk = E:\ before I run
    the "Configure Data Igloo" step when there's also an internal DVD drive likely using E:\?
    Edit: I should add that it's all working properly at the moment but the "Configure Data Igloo" step is referencing E:\, not %UsersDisk% and I see this causing problems latter.  Does anyone know how the drive letters are assigned?  That is,
    why does %DataDisk% = D:\ and %UsersDisk%= E:\ after deployment, why not the reverse?

    Thanks for the reply Keith.  I'm not thrilled about having to customize the partition structure either but because we use Deep Freeze we need use Data Igloo to cache user profiles on a partition other than C:\.
    What I've ended up doing is using the 'Set Task Sequence Variable' tasks to set DataDisk = D:\ and UsersDisk = E:\ and then I can reference these variables for the task that configures Data Igloo.  To be clear for anyone trying to follow this, I'm not
    actually changing the letter assigned to the partitions, I'm just assigning a value to a variable which is then referenced in later task sequence steps.
    The thing that I'm not sure about is how the partition letters are assigned.  In my case the DataDisk partition is always assigned D:\ and UsersDisk is always assigned E:\.  I thought it might be alphabetical but I changed the 'Format and Partition
    Disk' step to rename UsersDisk to ADisk and it still gets letter E:\. 
    This isn't a big deal but if anyone knows how the letters are assigned please let me know.

  • Using sql:variable in an insert statement

    I'm writing an insert statement for a table with an XML column.  Most of the XML is static, but I need to replace the value of an element with the value of a T-SQL variable, as shown here:
    CREATE TABLE [dbo].[OrderDetail](
    [OrderID] [int] NULL,
    [OrderDetail] [xml] NULL
    GO
    DECLARE @XMLData XML;
    DECLARE @ItemID INT;
    SET @ItemID = 1000;
    SELECT @XMLData = N'
    <OrderDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    </OrderDetail>
    SET @XMLData.modify('insert <ItemID>[sql:variable("@ItemID")]</ItemID> into (/OrderDetail)[1]')
    INSERT INTO [dbo].[OrderDetail] ([OrderID], [OrderDetail])
    VALUES (@ItemID, @XMLData);
    When I run this, it inserts "[sql:variable("@ItemID")]" instead of the value of @ItemID.  If someone could show me the proper syntax, I would really appreciate it.  Thanks.

    Yes, that worked.  Now I want to change it a little.  I also have an attribute that I need to update with the value of a variable.
    DECLARE @XMLData XML;
    DECLARE @SetID INT;
    DECLARE @SetIDStr VARCHAR(12);
    DECLARE @SetIDXML XML;
    SET @SetID = 9999;
    SET @SetIDStr = CONVERT(VARCHAR(12), @SetID);
    SET @SetIDXML = CONVERT(XML, @SetIDStr);
    SELECT @XMLData = N'
    <OrderDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ItemID>1000</ItemID>
    <RightOperand ID="15524" Name="ItemName" Value="15524" />
    </OrderDetail>
    SET @XMLData.modify('replace value of (/OrderDetail/RightOperand/@ID)[1] with sql:variable("@SetIDXML")');
    INSERT INTO [dbo].[OrderDetail] ([OrderID], [OrderDetail])
    VALUES (@SetID, @XMLData);
    SELECT * FROM [dbo].[OrderDetail];
    I'm trying to replace "ID="15524"" with the value of @SetID.  This code throws an exception:
    Msg 9342, Level 16, State 1, Line 23
    XQuery [modify()]: An XML instance is only supported as the direct source of an insert using sql:column/sql:variable.
    Thanks again for your help.

  • How do I use bind variables for the SQL statements having IN clause

    SELECT id, name FROM t
    WHERE id in (10,20,30)
    As the IN list will have 'n' number of values, I am not able to specify fixed number of bind
    variables like
    SELECT id, name FROM t
    WHERE id in (?,?,?....)

    452051 wrote:
    I am not able to specify fixed number of bind variablesYou could use collection:
    SQL> create or replace force
      2    type NumList
      3      as
      4        table of number
      5  /
    SQL> select ename from emp where deptno member of NumList(10)
      2  /
    ENAME
    CLARK
    KING
    MILLER
    SQL> select ename from emp where deptno member of NumList(10,20,30)
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> This way you have one bind variable - collection.
    SY.

  • Using a Variable to create the SQL Query

    I need to create a "dynamic" Update query. I want to store
    the meet of the command in a variable and then reference the
    variable in in query.
    Example:
    <cfquery name="fred" datasource="mydb">
    update db_table_name set
    pbname = 'Fred Flintstone',
    pbnumber = '555-555-1234'
    pbage = 25
    where recnum = 24
    </cfquery>
    I would like use code this:
    <cfset upst = "pbname = 'Fred Flintstone', pbnumber =
    '555-555-1234', pbage = 25">
    <cfquery name="fred" datasource="mydb">
    update db_table_name set
    #upst#
    where recnum = 24
    </cfquery>
    When I run this, I get the following error message:
    Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression ''Fred Flintstone''.
    The SQL line is:
    update db_table_name set pbname = ''Fred Flintstone'',
    pbnumber = ''555-555-1234'', pbage = 25 where recnum = 24
    I know its hard to see, but the '' are 2 ' not 1 " . I have
    no idea why Coldfusion (or maybe the ODBC driver??) is placing the
    2nd ' in the command which causes the errors.
    Can anyone shed some light on this topic?
    While this is a simple example, my application is far more
    complex. I have over 50 fields in the udpate and depending on
    changes to the form values, I may need to update all the fields,
    some of the fields or NONE of the fields.
    I can use <cfif> to test if any fields have changed and
    if so, include them in the update command, but if NONE of the
    fields have changed, I would have an empty update command and
    therefore get an error. I want to avoid having to test for changes
    twice (once to determine if I am doing the update and twice to
    perform the update).
    Thanks,
    Mike.

    cf automatically escapes the single quotes, so you need to
    preserve them
    <cfquery name="fred" datasource="mydb">
    update db_table_name set
    #PreserveSingleQuotes(upst)#
    where recnum = 24
    </cfquery>
    Ken

  • IScript problem - Cannot use an input in a sql statement

    I get the input from an input box and it is correct
    &param = %Request.GetParameter("Dept");
    I try to use it in a sql statement lke this and nothing displays even though it its entered correctly and the value exists in the table
    Local SQL &usersCursor = CreateSQL("SELECT EMPLID, BIRTHDATE, NAME FROM PS_EMPLOYEES WHERE DEPTNAME_ABBRV = '&param'");
    If I leave out the single quotes around and do it like this &param then it errors out
    Local SQL &usersCursor = CreateSQL("SELECT EMPLID, BIRTHDATE, NAME FROM PS_EMPLOYEES WHERE DEPTNAME_ABBRV = &param");
    I need help structuring this correctly
    Thanks,
    Allen Cunningham

    Hi,
    CreateSQL does not execute the sql statement, it just creates an SQL object, which you have to execute.
    Something like this:
    &param = %Request.GetParameter("Dept");
    Local SQL &usersCursor = CreateSQL("SELECT EMPLID, BIRTHDATE, NAME FROM PS_EMPLOYEES WHERE DEPTNAME_ABBRV = :1", &param);
    While usersCursor.Fetch(&Emplid, &Birthdate, &Name)
    /* do processing*/
    End-While;

  • Using bind variables in creating new recordgroup

    hi
    i am creating a new recordgroup and assigning it to the LOV using forms personalization in new item instance trigger .
    when i use the bind variables in the record group query i am getting errored out. if i remove the bind variables in the query then RG is creating and is assigned to the LOV and i can use it.
    can anyone help me how to refer the values from the exising form to build a dynamic record group query.

    Can you please send me the code you used in Forms Personalization to create new RecordGroup and attach it to an item. my mail id is [email protected]

Maybe you are looking for

  • Collaboration  with vendor  via Portal?

    Hi everyone :    I meet a problem about collaboration with vendor. Our customer has lots of vendor ,and our customer expect that their vendor could query related R/3 report real-time via Portal on Internet .    I had done the SSO between Portal and R

  • Image Capture can no longer download from iPhone

    For some time - I think since Yosemite upgrade, I can no longer download photos from my iPhone 5. (I do not use iCloud, and there are some other issues with iPhoto so I haven't tried.  iTunes can still perform backup.) Back when, I was using Google P

  • IPhone music sorted incorrectly

    Since enabling iTunes in the Cloud, my music is sorted incorrectly on my iPhone. Albums starting with "S" will appear under "T", for instance. Even after disabling iTunes in the Cloud, the problem persists. I've tried synching my phone, to no avail.

  • Printing Street4 Street5 in SAPScript form BA00

    Hello All, I am trying to print additional lines of street address (i.e. Street4 and Street5) in the sales order confirmation SAPScript form (BA00) output. I see that the structure VBDKA is being used to display the Ship-to-party address details. How

  • Wacom Intuos + Yosemite = Freeze

    Just as an FYI to those of you having issues with Wacom Intuos tablets and Yosemite. There is definitely an issue causing lockups/freezing with the Wacom drivers under Yosemite. This is also being discussed over at MacRumors. My combo is: Retina iMac