Insert query not working?

i have created the following table in sql
CREATE TABLE cw06_student
     (registrationno VARCHAR2(8) CONSTRAINT registrationno_pk PRIMARY KEY,
     course NUMBER(4) CONSTRAINT student_course_nn NOT NULL,
     tutor NUMBER(4),
     title VARCHAR2(4) CONSTRAINT student_title_cc CHECK ((title = 'Mr') OR (title = 'Miss')
          OR (title = 'Ms') OR (title = 'Mrs')),
     firstname VARCHAR2(25) CONSTRAINT student_firstname_nn NOT NULL,
     lastname VARCHAR2(25) CONSTRAINT student_lastname_nn NOT NULL,
     password VARCHAR2(16) CONSTRAINT student_password_nn NOT NULL,
     CONSTRAINT student_course_fk FOREIGN KEY (course) REFERENCES cw06_course(coursecode),
     CONSTRAINT student_tutor_fk FOREIGN KEY (tutor) REFERENCES cw06_staff(staffno));
Now i have designed the form. on the SMART TRIGGER OF WHEN BUTTON PRESSED of INSERT button, i have written the following block:
INSERT INTO cw06_student(registrationno,course,tutor,title,firstname,lastname,password)
VALUES(:REGNO,:COURSE,:TUTOR,:title,:LASTNAME,:FIRSTNAME,:PASSWORD);
when i press insert, no error is generated but the record has not been saved to the cw06_student table in sql .
plz help me to rectify the problem

I have written the following:
INSERT INTO cw06_student(registrationno,course,tutor,title,firstname,lastname,password)
VALUES(:REGNO,:COURSE,:TUTOR,:title,:LASTNAME,:FIRSTNAME,:PASSWORD);
commit_form
it generates Erro:
Expecting the Symbol END ..
INSERT INTO cw06_student(registrationno,course,tutor,title,firstname,lastname,password)
VALUES(:REGNO,:COURSE,:TUTOR,:title,:LASTNAME,:FIRSTNAME,:PASSWORD);
commit_form;
when i put semicolon, it returns following error:
IDENTIFIER CW06_STUDENT must be declared.
plz give me full specs how i cope with it.

Similar Messages

  • Update working, but insert is not working.

    Hi friends,
    Im creating a process for the manular tabular form, that im developing.
    Since for the update im giving the below query
    for i in 1..htmldb_application.g_f01.count
    loop
    if htmldb_application.g_f01(i) is not null then                 
        update gen_req_items
        set item_id = replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
           item_uom_id= replace(htmldb_application.g_f04(i),'%'||'null%',null)
          where req_itm_id = htmldb_application.g_f01(i);
    end if;
    end loop;It is working fine, and i can able to update the rows in my tabular form.
    For insert im giving the following query.
    for i in 1..htmldb_application.g_f01.count
    loop
    if htmldb_application.g_f01(i) is not null then                 
        update gen_req_items
        set item_id = replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
           item_uom_id= replace(htmldb_application.g_f04(i),'%'||'null%',null)
          where req_itm_id = htmldb_application.g_f01(i); 
    else if
    if htmldb_application.g_f01(i) is null
    insert into gen_req_items(barcode, item_id, item_uom_id)
    values(htmldb_application.g_f02(i),replace(htmldb_application.g_f03(i),'%'||'null%',NULL),replace(htmldb_application.g_f04(i),'%'||'null%',NULL));
    end if;
    end if;
    end loop;But the insert is not working, as i couldnt able to insert the values. I dont know what went wrong.
    The below is my region source coding of my tabular form.
    select x.req_itm_id,
    x.barcode,
    x.item_id,
    x.item_uom_id
    from (
    select htmldb_item.text(1,req_itm_id) req_itm_id,
    htmldb_item.select_list_from_query(2,barcode,'select distinct barcode, barcode from gen_req_items') barcode,
    htmldb_item.text(3,item_id,10) item_id,
    htmldb_item.text(4,item_uom_id,10) item_uom_id
    from gen_req_items
    union all
    select htmldb_item.hidden(1,null)  req_itm_id,
    htmldb_item.select_list_from_query(2,null,'select distinct barcode, barcode from gen_req_items') barcode,
    htmldb_item.text(3,null,10) item_id,
    htmldb_item.text(4,null,10) item_uom_id
    from dual) xIm developing a manular tabular form by referring the below link, FYR
    http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html_
    what might be wrong with my insert statement.
    As i also created sequence and trigger for my primary key column req_itm_id in tabular form
    Brgds,
    Mini

    Mini wrote:
    But the insert is not working, as i couldnt able to insert the values. I dont know what went wrong.
    You've posted here often enough to know that this isn't really sufficient detail. Regarding the above statement, how did you reach that particular conclusion? It might sound like a stupid question, but it gives us a bit of insight into how you have attempted to diagnose the problem and can speed up its resolution.
    * Does the insert work "standalone" i.e. if you write it as a manual query in, for example, the SQL Window, using bind variables?
    * If it does, do you have any special constraints on one or more of the relevant fields (e.g. "not null" on the barcode field)?
    * If so, have you ensured that the relevant field(s) (e.g. F02) are actually populated with values and are valid for insertion?
    In addition, I'm not sure what the purpose of the nested "If" statement is
    if htmldb_application.g_f01(i) is null
    end if;Indeed, the else if won't work either... the correct syntax is elsif

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Cancel Query not working

    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.

    jemar98 wrote:
    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.Please post the details of the application release, database version and OS.
    Was this working before? If yes, any changes been done recently?
    Please review (Canceling Long Running Queries in Oracle Applications 11i [ID 138159.1]) and make sure you complete all the steps.
    Thanks,
    Hussein

  • PHP-MySQL "INSERT INTO" query not working

    Hi,
    The code below fails to update a MySQL table I have made called "tampa."  I'm not sure why.  The field "id" is an index field, auto-increment, and primary-type.  The field "site" is also an index field, but just unique-type.  Does the fact that these two fields are index fields have anything to do with why the code below won't update the table?
    Thanks in advance,
    John
    <form action="process.php" method="post">
    Add a blog to this category: <input name="site" type="text" size="50">
    <input type="submit" value="Submit">
    </form>
    PHP code in a file called "process.php":
    <?
    $site=$_POST['site'];
    mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
    mysql_select_db("sand2") or die(mysql_error());
    mysql_query("INSERT INTO `tampa` ('id', 'site', 'value') VALUES (NULL, '$site',1)");
    $result = mysql_query("INSERT INTO `tampa` ('id', 'site', 'value') VALUES (NULL, '$site',1)");
    ?>

    The reason it fails is because you have surrounded the column names with quotes. You are also running the insert query twice. And yet another problem: you are inserting a form value into the database without filtering it.
    <?php
    mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
    mysql_select_db("sand2") or die(mysql_error());
    // strip slashes if magic quotes are enabled
    $site = get_magic_quotes_gpc() ? stripslashes($_POST['site'] : $_POST['site'];
    // make form value safe to insert in DB
    $site = mysql_real_escape_string($site);
    mysql_query("INSERT INTO `tampa` (id, site, value) VALUES (NULL, '$site',1)");
    ?>

  • SQL Insert from "Select Query" Not Work when use Order By

    Hai every body...
    I have a problem with T-SQL. I use SQL Server 2012 Express with SP2 on Windows 7 32-bit SP1.
    This is the problem
    -- first, create table
    create table dtoth.tableA (
    id_data TINYINT PRIMARY KEY,
    kd_data VARCHAR(20),
    nm_data VARCHAR(200)
    -- then, insert values
    INSERT INTO dtoth.tableA VALUES (0,'100.001','KAS');
    INSERT INTO dtoth.tableA VALUES (1,'110.001','BANK');
    INSERT INTO dtoth.tableA VALUES (2,'120.001','PIUTANG DAGANG');
    INSERT INTO dtoth.tableA VALUES (3,'121.001','PIUTANG GIRO');
    INSERT INTO dtoth.tableA VALUES (4,'130.001','PERSEDIAAN BARANG DAGANGAN');
    -- then, i create a temporary table
    create table dtoth.temp_tableA (
    kd_data VARCHAR(20),
    nm_data VARCHAR(200)
    -- then, i create a store procedure to call data from temporary table
    CREATE procedure dtoth.report
    AS
    BEGIN
    DELETE FROM dtoth.temp_tableA;
    INSERT INTO dtoth.temp_tableA SELECT kd_data, nm_data FROM dtoth.tableA ORDER BY kd_data desc;
    SELECT * FROM dtoth.temp_tableA;
    END
    GO
    When i execute the the store procedure with
    EXEC dtoth.report;
    the result is not accurate like this (kd_data not sorted desc):
    I want the column "kd_data" sort descending because i use ORDER BY kd_data DESC in insert statement on the store procedure.
    By the way, if i execute code like :
    SELECT kd_data, nm_data FROM dtoth.tableA ORDER BY kd_data desc;
    the result is correct like this
    So, what solution for my code in the store procedure ?
    Thanks.

    to get the data sorted, you should order by in your select in the stored procedure
    sorting while inserting does not guarenatee order..
    remove the order by in insert statement and put that in the select statement
    so, your procedure should be 
    -- then, i create a store procedure to call data from temporary table
    CREATE procedure dtoth.report
    AS
    BEGIN
    DELETE FROM dtoth.temp_tableA;
    INSERT INTO dtoth.temp_tableA SELECT kd_data, nm_data FROM dtoth.tableA;
    SELECT * FROM dtoth.temp_tableA ORDER BY kd_data desc;
    END
    GO
    Hope it Helps!!

  • Oracle 8i - PL/SQL sub query not working in PROC, but works ins SQL

    I have read about certain things not working in 8i and I think this is one of them, but I was wondering if anyone had a work around. In the place of the SELECT SYSDATE FROM DUAL, I have a table look up, where I am going to look up the OCN of the corresponding VENDOR_ID ( a column in the original query ). I am doing it in a decode statement because if the first condition in the decode statement is met, that's it. But if not, it needs to look up the OCN number in this other table. Simple enough, conceptually. I thought of a view but that necessitates a SELECT statement, too. Anyway, here is the code with the appropriate text bolded:
    CREATE OR REPLACE PROCEDURE tstINS_RATE_ROUTE_RECORDS_PROC (GET_CUR_PERIOD IN DATE) IS
         CUR_PERIOD DATE;
         BEGIN
         CUR_PERIOD := GET_CUR_PERIOD;
         Insert into RATE_ROUTE (
           CVBI_KEY
         , VENDOR_ID
         , OCN
         , ST_CD
         , PERIOD
         , MDFY_DT )
         Select
           C.CVBI_KEY
         , C.VENDOR_ID
         <b>, decode( c.send_lca, 'YES', 'XXX', (SELECT SYSDATE FROM DUAL) )</b>
         , decode( c.send_lca, 'YES', 'XX', SUBSTR(C.ZLOC,5,2) )
         , CUR_PERIOD
         , TO_CHAR(SYSDATE)
         FROM
           rpt_ds1_cnt_cat c
         , cogs_resource cr
         , cogs_t1activity ct1
         , rpt_ds1_aloc_zloc_reverse_vw az
         where (C.CVBI_KEY = CR.CVBI_KEY (+)
         and  CR.PERIOD = CUR_PERIOD)
         AND  (C.CVBI_KEY = CT1.CVBI_KEY (+)
         and CT1.PERIOD = CUR_PERIOD)
         and (az.master_route_name=c.aloc||'-'||c.zloc OR az.reversed=c.aloc||'-'||c.zloc)
         END; -- INS_RATE_ROUTE_RECORDS_PROC

    have read about certain things not working in 8i and I think this is one of them,Yes as I said scalar sub-queries were also not recognized within PL/SQL in 8i.
    Re: PLS-00103: Encountered the symbol "SELECT" when expecting one of the fo
    I was wondering if anyone had a work around.Write a function that returns the value. You may incur a performance penalty from a context switch to PL/SQL, but it may be balanced by the decode optimization you are attempting.

  • Mismatch query not working. Not sure what I did wrong.

    In my query, I have created two CTE's. One pulls in the records of all people who are assigned to an audience. The other pulls in all people who are assigned to the same audience AND completed a certain course.
    What I wanted to do from there, was to do a mismatch query, not to find the PEOPLE, but just the departments that were represented in the audience, but had no people in the list of those who completed the course. (In other words, say the HR Department had
    three people in the audience... two completed the course, one did not. The HR Department should NOT show up in my mismatch query because some of their people completed the course. Then, say the IT Department had five people in the audience, and none of them
    have completed the course. The IT Department SHOULD show up in my mismatch query. For this case, I don't care about the people who didn't complete it, just the departments where nobody did yet.)
    I thought I was doing the mismatch query correctly, but I guess I must not. I will share the relevant parts of my query below (there is more to my query, but I don't think you necessarily need to see it to assist with this particular problem). (Side note:
    Yes, I know the way I am doing the fiscal calendar is not ideal, but I've looked up other ways to do it, and do not understand it. Given time, I can break it down and understand it, but I am in a rush to finish this report.)
    gm101certtbl
    AS
    select
    dimUser.EmpFK MeasureEmpFK,
    RIGHT(OrgCode2, LEN(OrgCode2) - 2) MeasurePC,
    audusersName MeasureAudName,
    dimActivity.ActivityName MeasureActName,
    dimActivity.Code MeasureActCode,
    CASE
    WHEN OrgCode2 LIKE 'US%' then 'US'
    WHEN OrgCode2 LIKE 'CA%' then 'CA' END
    CountryCode,
    'ACTUALS_GM101' SOURCESYSTEMID,
    Null CURRENCYCODE,
    'GM101CERT' MEASUREID,
    Null MEASUREDOLLARS,
    CASE
    WHEN GETDATE() Between '20131001 00:00:00' AND '20140930 11:59:59' THEN '2014'
    WHEN GETDATE() Between '20141001 00:00:00' AND '20150930 11:59:59' THEN '2015'
    WHEN GETDATE() Between '20151001 00:00:00' AND '20160930 11:59:59' THEN '2016'
    WHEN GETDATE() Between '20161001 00:00:00' AND '20170930 11:59:59' THEN '2017' END
    FiscalYear,
    CASE
    WHEN MONTH(GETDATE()) = '10' THEN '1'
    WHEN MONTH(GETDATE()) = '11' THEN '2'
    WHEN MONTH(GETDATE()) = '12' THEN '3'
    WHEN MONTH(GETDATE()) = '1' THEN '4'
    WHEN MONTH(GETDATE()) = '2' THEN '5'
    WHEN MONTH(GETDATE()) = '3' THEN '6'
    WHEN MONTH(GETDATE()) = '4' THEN '7'
    WHEN MONTH(GETDATE()) = '5' THEN '8'
    WHEN MONTH(GETDATE()) = '6' THEN '9'
    WHEN MONTH(GETDATE()) = '7' THEN '10'
    WHEN MONTH(GETDATE()) = '8' THEN '11'
    WHEN MONTH(GETDATE()) = '9' THEN '12' END
    FiscalMonthNbr
    from
    dimUser INNER JOIN
    audusers ON audusers.DataSetUsers_EmpFK = dimUser.EmpFK INNER JOIN
    Org ON dimUser.PrimaryDomFK = Org.Org_PK INNER JOIN
    factUserRequiredActivity ON factUserRequiredActivity.UserID = dimUser.ID INNER JOIN
    dimActivity ON dimActivity.ID = factUserRequiredActivity.ActivityID INNER JOIN
    dimRequirementStatus ON factUserRequiredActivity.ReqStatusID = dimRequirementStatus.ID LEFT OUTER JOIN
    UsrOrgs ON dimUser.ID = UsrOrgs.UserID LEFT OUTER JOIN
    UsrDoms ON dimUser.ID = UsrDoms.UserID
    WHERE
    dimActivity.ActivityName = 'GM101 Program Completion'
    AND
    dimRequirementStatus.name = 'Satisfied'
    AND
    (audusersName = @audparam)
    gm101availtbl
    AS
    select
    dimUser.EmpFK MeasureEmpFK,
    RIGHT(OrgCode2, LEN(OrgCode2) - 2) MeasurePC,
    audusersName MeasureAudName,
    Null MeasureActName,
    Null MeasureActCode,
    CASE
    WHEN OrgCode2 LIKE 'US%' then 'US'
    WHEN OrgCode2 LIKE 'CA%' then 'CA' END
    CountryCode,
    'ACTUALS_GM101' SOURCESYSTEMID,
    Null CURRENCYCODE,
    'GM101AVAIL' MEASUREID,
    Null MEASUREDOLLARS,
    CASE
    WHEN GETDATE() Between '20131001 00:00:00' AND '20140930 11:59:59' THEN '2014'
    WHEN GETDATE() Between '20141001 00:00:00' AND '20150930 11:59:59' THEN '2015'
    WHEN GETDATE() Between '20151001 00:00:00' AND '20160930 11:59:59' THEN '2016'
    WHEN GETDATE() Between '20161001 00:00:00' AND '20170930 11:59:59' THEN '2017' END
    FiscalYear,
    CASE
    WHEN MONTH(GETDATE()) = '10' THEN '1'
    WHEN MONTH(GETDATE()) = '11' THEN '2'
    WHEN MONTH(GETDATE()) = '12' THEN '3'
    WHEN MONTH(GETDATE()) = '1' THEN '4'
    WHEN MONTH(GETDATE()) = '2' THEN '5'
    WHEN MONTH(GETDATE()) = '3' THEN '6'
    WHEN MONTH(GETDATE()) = '4' THEN '7'
    WHEN MONTH(GETDATE()) = '5' THEN '8'
    WHEN MONTH(GETDATE()) = '6' THEN '9'
    WHEN MONTH(GETDATE()) = '7' THEN '10'
    WHEN MONTH(GETDATE()) = '8' THEN '11'
    WHEN MONTH(GETDATE()) = '9' THEN '12' END
    FiscalMonthNbr
    from
    dimUser INNER JOIN
    audusers ON audusers.DataSetUsers_EmpFK = dimUser.EmpFK INNER JOIN
    Org ON dimUser.PrimaryDomFK = Org.Org_PK LEFT OUTER JOIN
    UsrOrgs ON dimUser.ID = UsrOrgs.UserID LEFT OUTER JOIN
    UsrDoms ON dimUser.ID = UsrDoms.UserID
    WHERE
    audusersName = @audparam
    missingPC
    AS
    select distinct
    NULL MeasureEmpFK,
    gm101availtbl.MeasurePC,
    gm101availtbl.MeasureAudName,
    gm101availtbl.MeasureActName,
    gm101availtbl.MeasureActCode,
    gm101availtbl.CountryCode,
    gm101availtbl.SOURCESYSTEMID,
    gm101availtbl.CURRENCYCODE,
    'GM101CERT' MEASUREID,
    gm101availtbl.MEASUREDOLLARS,
    gm101availtbl.FiscalYear,
    gm101availtbl.FiscalMonthNbr
    from
    gm101availtbl LEFT OUTER JOIN
    gm101certtbl on gm101certtbl.MeasurePC = gm101availtbl.MeasurePC
    WHERE gm101certtbl.MeasurePC IS NULL
    If anybody can help, I would greatly appreciate it. I'm trying to do this so I can pull these records into a final table to count the records from the other two, but then include these as a 0 count where these departments have nobody certified.
    To test if this was working, I created a query using this Mismatch query instead as the main query. Instead, it seemed to give me the exact opposite. It seemed to be giving me all of the Departments (MeasurePC) where the records were represented.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. We have no sample data, so we cannot even guess. 
    >> In my query, I have created two CTE's. One pulls in the records [sic] of all people who are assigned to an audience. The other pulls in all people who are assigned to the same audience AND completed a certain course. <<
    Please, please learn the basic terms. Rows are not records. And THEN learn what “redundancy” means so you will not write two CTEs in the future. 
    >> What I wanted to do from there, was to do a mismatch query, not to find the PEOPLE, but just the departments that were represented in the audience, but had no people in the list of those who completed the course. (In other words, say the HR Department
    had three people in the audience... two completed the course, one did not. The HR Department should NOT show up in my mismatch query because some of their people completed the course. THEN, say the IT Department had five people in the audience, and none of
    them have completed the course. The IT Department SHOULD show up in my mismatch query. For this case, I don't care about the people who didn't complete it, just the departments where nobody did yet.) <<
    This is a Relational Division. It is one of Dr. Codd's original 8 operations. 
    We do not use the Sybase CURRENT_TIMESTAMP any more. We have DATE data types tody, rtoo. We never tibble in good code; it is a design flaw that used meta-data affixes like “tbl” in schema object _names, PK in column _names, etc. We do not have repeated groups
    like “org_code_2”; we do not use arrays in RDBMS. Why is your data so screwed up you have use 
    CASE 
    WHEN org_code2 LIKE 'US%' THEN 'US'
    WHEN org_code2 LIKE 'CA%' THEN 'CA' END 
    to clean it up in a query; the DDL should have prevented this problem. 
    Why are you doing calendar computing in your query? Where is the Calendar table? 
    “Users.id = UsrOrgs.user_id” says that you have magic, generic “id” that can change its name from table to table. Likewise, a generic, magic “code”, etc. What might be even worse is that totally different data elements have the same name! “Automobiles, squids
    and Lady Gaga” programming is not RDBMS. 
    You have never heard of ISO-11179 and data modeling? 
    Here is a skeleton for fiscal calendar table to replace your current row by row temporal math: 
    CREATE TABLE Calendar 
    (cal_date DATE NOT NULL PRIMARY KEY, 
     fiscal_month CHAR(10) NOT NULL,
    INSERT INTO  Calendar
    VALUES 
    ('2014-10-01', '2015-01-00', ..), 
    ('2014-09-30', '2015-12-00', ..), 
    You can use a spread sheet and a text edit to fill in the table for 50 or 100 years. 
    I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601 data format required by Standard SQL and it is
    language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • SQL Update Query not Working...

      This was working until we had to encrypt the main key.  This has been replaced with an existing autonum field.  When I test the T-SQL query alone on SQL Server,  it works.   But through the ColdFusion progam, nothing happens.  Its as if the submit button reference to this is not working or is ignored.
    Any ideas?
    Here is the code clip were the issue may be occuring.
    <cfparam name="URL.SEQNO" default="1">
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "formUpdateRecord">
      <cfquery name="Section301MI" datasource="301dsn">
      DECLARE @str NVARCHAR(128)
      SET @str = #FORM.SSN#;
      OPEN SYMMETRIC KEY SSN_Key_01
       DECRYPTION BY CERTIFICATE anjalitest
      UPDATE dbo.TableDataRecords SET SSN=
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , verifySSN =
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , LastName=
      <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ "">
        '#FORM.LastName#'
          <cfelse>
          NULL
      </cfif>
      , FirstName=
      <cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ "">
        '#FORM.FirstName#'
          <cfelse>
          NULL
      </cfif>
      , MiddleInitial=
      <cfif IsDefined("FORM.MiddleInitial") AND #FORM.MiddleInitial# NEQ "">
        '#FORM.MiddleInitial#'
          <cfelse>
          NULL
      </cfif>
      , DOB=
      <cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
        '#FORM.DOB#'
          <cfelse>
          NULL
      </cfif>
      , BenefitProgram=
      <cfif IsDefined("FORM.BenefitProgram") AND #FORM.BenefitProgram# NEQ "">
        #FORM.BenefitProgram#
          <cfelse>
          NULL
      </cfif>
      , MedCessDate=
      <cfif IsDefined("FORM.MedCessDate") AND #FORM.MedCessDate# NEQ "">
        '#FORM.MedCessDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramDecision=
      <cfif IsDefined("FORM.ProgramDecision") AND #FORM.ProgramDecision# NEQ "">
        #FORM.ProgramDecision#
          <cfelse>
          NULL
      </cfif>
      , ProgramDecisionDate=
      <cfif IsDefined("FORM.ProgramDecisionDate") AND #FORM.ProgramDecisionDate# NEQ "">
        '#FORM.ProgramDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramType=
      <cfif IsDefined("FORM.ProgramType") AND #FORM.ProgramType# NEQ "">
        #FORM.ProgramType#
          <cfelse>
          NULL
      </cfif>
      , ProgAllowStartDate=
      <cfif IsDefined("FORM.ProgAllowStartDate") AND #FORM.ProgAllowStartDate# NEQ "">
        '#FORM.ProgAllowStartDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgAllowCompDate=
      <cfif IsDefined("FORM.ProgAllowCompDate") AND #FORM.ProgAllowCompDate# NEQ "">
        '#FORM.ProgAllowCompDate#'
          <cfelse>
          NULL
      </cfif>
      , DiaryDate=
      <cfif IsDefined("FORM.DiaryDate") AND #FORM.DiaryDate# NEQ "">
        '#FORM.DiaryDate#'
          <cfelse>
          NULL
      </cfif>
      , DenialReason=
      <cfif IsDefined("FORM.DenialReason") AND #FORM.DenialReason# NEQ "">
        #FORM.DenialReason#
          <cfelse>
          NULL
      </cfif>
      , TermDecisionDate=
      <cfif IsDefined("FORM.TermDecisionDate") AND #FORM.TermDecisionDate# NEQ "">
        '#FORM.TermDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , TermReason=
      <cfif IsDefined("FORM.TermReason") AND #FORM.TermReason# NEQ "">
        #FORM.TermReason#
          <cfelse>
          NULL
      </cfif>
      , Remarks=
      <cfif IsDefined("FORM.Remarks") AND #FORM.Remarks# NEQ "">
        '#FORM.Remarks#'
          <cfelse>
          NULL
      </cfif>
      , EncryptNatIDNum1 = NULL
      , EncryptNatIDNum2 = NULL
      WHERE SEQNO=#URL.SEQNO#
       CLOSE SYMMETRIC KEY SSN_Key_01;
      </cfquery>
      <cflocation url="modifysuccess.cfm">
    </cfif>

    1) This is almost a clone to the Insert form that works.  The main differences are It selects the matching record for editing and then Updates.
    2) The CFDUMP gives me results when I put it in the logic section that responds to the Form Submit button.  But not at the top of the code.
      I added the CFABORT so I could see a result.
    <cfif (IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "formUpdateRecord") OR (IsDefined("FORM.UpdateRecord") AND FORM.UpdateRecord EQ "Update Record")>
       <cfdump var="#form#">
      <cfquery name="Section301MI" datasource="301dsn" username="section301db" password="testdb">
      DECLARE @str NVARCHAR(128)
      <cfif IsDefined("FORM.SSN")>
       SET @str = #FORM.SSN#;
      </cfif>
      OPEN SYMMETRIC KEY SSN_Key_01
       DECRYPTION BY CERTIFICATE anjalitest
      UPDATE dbo.TableDataRecords SET verifySSN=                     <<This is only displayed, but not modified.  Should this even be in the update?
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , [LastName]=
      <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ "">
        '#FORM.LastName#'
          <cfelse>
          NULL
      </cfif>
      , [FirstName]=
      <cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ "">
        '#FORM.FirstName#'
          <cfelse>
          NULL
      </cfif>
      , MiddleInitial=
      <cfif IsDefined("FORM.MiddleInitial") AND #FORM.MiddleInitial# NEQ "">
        '#FORM.MiddleInitial#'
          <cfelse>
          NULL
      </cfif>
      , DOB=
      <cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
        '#FORM.DOB#'
          <cfelse>
          NULL
      </cfif>
      , BenefitProgram=
      <cfif IsDefined("FORM.BenefitProgram") AND #FORM.BenefitProgram# NEQ "">
        #FORM.BenefitProgram#
          <cfelse>
          NULL
      </cfif>
      , MedCessDate=
      <cfif IsDefined("FORM.MedCessDate") AND #FORM.MedCessDate# NEQ "">
        '#FORM.MedCessDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramDecision=
      <cfif IsDefined("FORM.ProgramDecision") AND #FORM.ProgramDecision# NEQ "">
        #FORM.ProgramDecision#
          <cfelse>
          NULL
      </cfif>
      , ProgramDecisionDate=
      <cfif IsDefined("FORM.ProgramDecisionDate") AND #FORM.ProgramDecisionDate# NEQ "">
        '#FORM.ProgramDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramType=
      <cfif IsDefined("FORM.ProgramType") AND #FORM.ProgramType# NEQ "">
        #FORM.ProgramType#
          <cfelse>
          NULL
      </cfif>
      , ProgAllowStartDate=
      <cfif IsDefined("FORM.ProgAllowStartDate") AND #FORM.ProgAllowStartDate# NEQ "">
        '#FORM.ProgAllowStartDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgAllowCompDate=
      <cfif IsDefined("FORM.ProgAllowCompDate") AND #FORM.ProgAllowCompDate# NEQ "">
        '#FORM.ProgAllowCompDate#'
          <cfelse>
          NULL
      </cfif>
      , DiaryDate=
      <cfif IsDefined("FORM.DiaryDate") AND #FORM.DiaryDate# NEQ "">
        '#FORM.DiaryDate#'
          <cfelse>
          NULL
      </cfif>
      , DenialReason=
      <cfif IsDefined("FORM.DenialReason") AND #FORM.DenialReason# NEQ "">
        #FORM.DenialReason#
          <cfelse>
          NULL
      </cfif>
      , TermDecisionDate=
      <cfif IsDefined("FORM.TermDecisionDate") AND #FORM.TermDecisionDate# NEQ "">
        '#FORM.TermDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , TermReason=
      <cfif IsDefined("FORM.TermReason") AND #FORM.TermReason# NEQ "">
        #FORM.TermReason#
          <cfelse>
          NULL
      </cfif>
      , Remarks=
      <cfif IsDefined("FORM.Remarks") AND #FORM.Remarks# NEQ "">
        '#FORM.Remarks#'
          <cfelse>
          NULL
      </cfif>
      , EncryptNatIDNum1 = NULL
      , EncryptNatIDNum2 = NULL
      WHERE SEQNO=#URL.SEQNO#
       CLOSE SYMMETRIC KEY SSN_Key_01;
      </cfquery>
    <cfabort>
      <cflocation url="modifysuccess.cfm">
    </cfif>

  • Inline transform for Sql Query not working in SAP MII 12.1 Version 12.1.8 B

    Hi All,
    I applied an xslt for an sql query which returns an xml file.
    I used inline transform icon in sql query to load an xsl file which has to return me a string
    Any idea why is not working for me..?
    My Sample XML file:
                                     <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="/XMII/CM/BatchDisposition/BatchQueueManagement/StyleSheets/ProductXsl.xsl"?>
    <Rowsets DateCreated="2011-05-05T07:27:45" EndDate="2011-05-05T07:27:45" StartDate="2011-05-05T06:27:45" Version="12.1.8 Build(20)">
         <Rowset>
              <Columns>
                   <Column Description="ProductName" MaxRange="1" MinRange="0" Name="ProductName" SQLDataType="12" SourceColumn="ProductName"/>
              </Columns>
              <Row>
                   <ProductName>Asprin 100mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row>
                   <ProductName>Asprin 300mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row><ProductName>Ibprooven 200mg Tablets 12 x 10 strip</ProductName></Row>
              <Row><ProductName>RipTide 50mg Tablets 40 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 200mg Tablets 6 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 400mg Tablets 12 x10 strip</ProductName></Row>
         </Rowset>
    </Rowsets>
    My Sample XSl File:
                                    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <xsl:text>["</xsl:text>
         <xsl:for-each select="Rowsets/Rowset/Row">
              <xsl:value-of select="ProductName"/>
              <xsl:if test="position() &lt; last()">
                   <xsl:text>","</xsl:text>
                    </xsl:if>
              <xsl:if test="position()=last()">
                           <xsl:text>"]</xsl:text>
                    </xsl:if>
         </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Any Suggestions  are Welcome:
    Thanks

    Something like this should work...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
                   <xsl:copy-of select="/Rowsets/FatalError"/>
                   <xsl:copy-of select="/Rowsets/Messages"/>
                   <Rowset>
                   <Columns>
                        <Column Description="Mycol1" MaxRange="1" MinRange="0" Name="Mycol1" SQLDataType="12" SourceColumn="Mycol1" />
                   </Columns>
                   <Row>
                   <Mycol1>
                   <xsl:text>["</xsl:text>
                        <xsl:for-each select="/Rowsets/Rowset/Row">
                             <xsl:value-of select="." />
                             <xsl:choose>
                                  <xsl:when test="position() &lt; last()"><xsl:text>","</xsl:text></xsl:when>
                                  <xsl:otherwise><xsl:text>"]</xsl:text></xsl:otherwise>
                             </xsl:choose>
                        </xsl:for-each>
                   </Mycol1>
                   </Row>
                   </Rowset>
              </Rowsets>
         </xsl:template>
    </xsl:stylesheet>

  • BW query not working in portal

    Hello Experts,
    We have this issue when we have a BW query which is running well in RSRT but the query is not working in Portal.
    The error message we have is
    User when running the report is getting the error message “Error in File SMT-0454 - Contribution Analysis (Cx) :   Error in formula  Running Total Condition Formula: 'HierarchyLevel (GroupingLevel ({YPAXXM01_YPAXXM01_QC001.[YGLSUBBRD                     GSK1CXBRNDCATH]-NodeId})) = 1' This field name is not known..”
    Explored the possibilties , Could this be issue with BW query.
    We have this query getting fed to BO's. Please advise.
    Thanks,
    Santhosh

    Hi Santhosh,
    Error... This field name is not known, check your formulas in query, there might be some changes happenened with the characteristics used in formula.
    Check the formula by going up to base level, you might removed some field ex: YGLSUBBRD from your query. Repair it appropriately.
    Hope helps - Kumar

  • Switch from MySQL to MS SQL Server, Query not working

    I'm sure there is a simple setting somewhere for this, but cannot seem to find it and really would appreciate some assistance. Have an application which uses JDBC to connect to a MySQL DB to run the following query without an issue:
    SELECT * FROM users
    This returns the desired results. Changed to connect to MS SQL Server 2000 using the JDBC-ODBC bridge and the same query returns no results. The problem, SQL Server wants this query instead:
    SELECT * FROM [users]
    I don't want to have to change queries depending on the DB, as that is supposed to be one of the advantages of JDBC. Is there a setting in MySQL (or the JDBC driver) to have it work correctly if I pass table names in []? Or is there a setting in MS SQL Server (or in the JDBC, or ODBC) to have it accept queries without the []?
    Or is there a different approach that I'm missing which would avoid this whole problem?
    Thanks,
    Matt

    I suspect your database definitions are different. It has nothing to do with your java code.
    The bracket syntax is used to indicate the more standard quoted identifiers in standard SQL.
    Thus you could do this in oracle and in MS SQL Server...
    SELECT * FROM "users"
    I suspect that the above will work for your MS SQL Server database and will not work for your Oracle database. However if you created the table in oracle and specifically used "users" (with the double quotes around the name) when creating the table then it would work.
    Of course if the database definitions are different it means you must use different SQL for each. Just as if the name of the table was 'other' rather than 'users'.

  • In yahoo mail my automatic address insertion does not work with firefox but does with explorer please tell me how to fix this as it is stressful and makes me want to throw your program and my computer and the internet out the window

    When i go to start a new email in yahoo mail the aoutomatic insertion feature that lets me type just a few letters then fills in the rest of the email address do not work in firefox

    *Tools > Options > Privacy > History: Firefox will: "Use custom settings for history"
    *Tools > Options > Privacy > History: "Remember search and form history"
    See also [[Form autocomplete]]

  • Update query not working in the JDBC sender Communication channel

    Hi,
    We are working on JDBC to File scenario. As per the configuration, XI should pick the data from SQL database every 20 secs and should update the corresponding flag. We are using subquery in the select and update statement as both header and detail tables are involved.
    Now the issue is, select query is working fine but update statement is not working as expected. It is somehow updating some other records rather than doing for the ones selected by the adapter.
    Moreover logSQLstatement is also not working. Hence we are unable to identify the records which are getting updated.
    Please advise.

    Hi Rumi,
    See Question 8. Transaction Handling (Sender) in [SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=831162].
    8.  Transaction Handling (Sender)
    Q: If I have the following configured in a JDBC Sender:
    Select Query:
    SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
    Update Query:
    UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
    How do I know that the JDBC adapter will not update newly added rows (rows that were
    added between the time that the SELECT and UPDATE queries were executed) that were
    not read in the initial SELECT query?
    A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements
    have the same view on the database.
    Make sure that both statements use the same WHERE clause. An additional
    requirement for the correct operation of this scenario is the configuration of
    an appropriate transaction isolation level on the database
    (i.e., repeatable_read or serializable). You might also consider using a
    "SELECT FOR UPDATE" statement instead of a plain SELECT statement to
    ensure proper locking on the database. "SELECT FOR UPDATE"
    is not supported in MS SQL database. In this case please make use of an
    appropriate transaction isolation level on the database. For more details
    please contact your DB vendors.
    After, see Transaction Handling Issues in [SAP Note 1039779 - JDBC Adapter issues(Escape character,Transaction handling)|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1039779].
    Best Regards.
    Pedro Baroni

  • Query not working while creating Sales Order... Need suggestions

    Dear All,
    My client requirement involves creation of Sales Orders both as standalone as well as based on Quotations, depending on the case. Now there is a UDF created in the Item Master Data called "U_Unit" which should be populated in another UDF (U_BPQty) in the Sales Order and Sales Quotation which can be changed at the transaction level.
    The requirement is if the Sales Order is created based on Quotation, the system should take the value from 'U_BPQty" of "Sales Quotation" and populate in the Sales Order. if the Sales Order is created as stand-alone, it should take the value from U_Unit field of the Item Master Data. I wrote the following query for that purpose and using it as a FMS but its not working.
    Can you suggest me where I am going wrong?
    Declare @Base varchar
    Declare @Item varchar
    Declare @Draw varchar
    Declare @BaseQty varchar
    Set @Base = (Select Case When $[$38.44.0] is Null then 0 when $[$38.44.0] is not Null then $[$38.44.0] end)
    Set @Item = ($[$38.1.0])
    Set @Draw = (SELECT T0.U_BPQty from QUT1 T0 INNER JOIN OQUT T1 ON T0.DocEntry = T1.DocEntry INNER JOIN RDR1 T2 ON T2.BaseRef = T1.DocNum WHERE T0.ItemCode = @Item)
    Set @BaseQty = (SELECT T0.U_Unit from OITM T0 WHERE T0.ItemCode = $[$38.1.0])
    Select Case when (@Base = 0) then @BaseQty when (@Base <> 0) then @Draw end
    Thanks and regards,
    Bharath S

    Hi Bharath.......
    As you said if SQ not there and SO is directly punched then it should Pick up U_Unit else if SQ has target of SO then U_BP then your query working fine.
    But if SQ not there and Del is directly punched instead of SO then it should Pick up U_Unit else if SQ has target of Delivery and not SO then U_BP. Is it?
    In such case its not working?
    If yes then use this query.......
    declare @basedoc as nvarchar
    set @basedoc=$[DLN1.BaseType.0]
    If @basedoc<1
    Begin
    Select T0.U_Unit from OITM T0 Where T0.ItemCode=$[DLN1.ItemCode.0]
    End
    If @basedoc>1
    Begin
    Select T0.U_BPQty From QUT1 T0 where T0.docentry=$[DLN1.BaseEntry.0] and T0.ItemCode=$[DLN1.ItemCode.0]
    End
    Else use this......
    declare @basedoc as nvarchar
    set @basedoc=$[DLN1.BaseType.0]
    If @basedoc<1
    Begin
    Select T0.U_Unit from OITM T0 Where T0.ItemCode=$[DLN1.ItemCode.0]
    End
    If @basedoc>1
    Begin
    Select T0.U_BPQty From RDR1 T0 where T0.docentry=$[$38.45.0] and T0.ItemCode=$[DLN1.ItemCode.0]
    End
    Regards,
    Rahul

Maybe you are looking for

  • HELP PLEASE!!! Horizontal Spry Menu

    I'm having trouble with my horizontal spry menu. I have added it and it looks great in Firefox. No problems at all, exactly how I like it. But when previewed in Internet Explorer it doesn't show at all. There's nothing. I've inserted the "mark of the

  • Macbook pro install spinning

    I have just downloaded Creative cloud and am trying to install on my 2010 MacBook Pro with OS 10.9.3 When I install I am not getting the signon button, just a blue spinning. I saw the signon button blip by once but then it went right to the spinning.

  • Will ymail be supported by firefox 10 soon? I would like to leave IE completely.

    I tried to enter my email address so I could get my email through firefox, but I got the message that ymail wasn't supported. Will it be soon? Also, I have many, many pages that won't load properly because it says firefox can't update the flash playe

  • ITunes visualizer

    Only possible to use visualizer in full screen. No effect using "F"

  • Previous server email

    Did switching my internet to FIOS somehow disable my previous ip server email?  I can access my email from my previous server but I am not able to receive emails since the switch to FIOS today?  Coincidence?  Is it just a problem with my previous ser