I am trying to run the update query below in Teradata but getting an error message 'Expecting something between ')' and the 'AS' keyword. I am missing anything? I have checked some previous update and it worked for other developers in my company.
WHEN MATCHED THEN UPDATE SET
PRSCRBR_LAST_NM = COALESCE(M.PRESCRIBER_LAST_NAME,'ZZZZ1') AS PRSCRBR_LAST_NM,
Thanks
Related
I got "Wrong key or corrupt data" error when executing a query in my code, so I inserted a debug line before the execution of the query to see what it looks like. I used QSqlQuery::lastQuery() to get the query text.
The query looked fine except the WHERE clause:
SELECT ... FROM patient WHERE "idx" = ?
And the debug line happened right after QSqlQuery::addBindValue() was executed to replace the placeholder ? with the real idx value.
I suspect addBindValue() somehow didn't work but I want to be sure. Is it possible lastQuery() still returns the query with placeholder in place even though addBindValue() has been run?
The following piece clearly does not have any reference to an 'as' in it:
<telerik:GridCalculatedColumn
DataFields="MemberFirstName, MemberLastName" DataFormatString="{1} + ', ' + {0}" />
Yet it yields this error:
Telerik.Web.UI.ParseException: No property or field 'as' exists in type 'MyEntity'
As you can see, I'm not looking for an 'as' anywhere and it strictly fails on this specific column only. MemberFirstName and MemberLastName will both populate my grid when I separate them from the GridCalculatedColumn. Somehow I am able to use this column type without problems anywhere else.
I know it's looking for 'as', but I can't find out where or why. Any ideas what is wrong here?
I need to trim instance name from complete dblink name .For example The select query returns result like HHVISDEV.TRINITI.COM. I need to get HHVISDEV. And ofcourse There are such multiple results. So I need to use cursor and print the final result. I am getting Warning: Procedure created with compilation errors., when I compile. And when I call the procedure I am getting ERROR at line 1:
ORA-06575: Package or function DELETEDBLINKS1 is in an invalid state. Can any one please guide me.
create or replace procedure DeleteDBLinks1 is
cursor mycursor is
SELECT SUBSTR(DB_LINK, 1, INSTR(DB_LINK, '.', 1, 1) - 1)
FROM dba_db_links;
myvar dba_db_links.dblinks%TYPE;
BEGIN
OPEN mycursor;
LOOP
FETCH mycursor
INTO myvar;
EXIT WHEN mycursor%NOTFOUND;
DBMS_OUTPUT.put_line(myvar);
END LOOP;
CLOSE mycursor;
end;
/
If you see Warning: Procedure created with compilation errors, then, I can guess, you compile your procedure in SQL*Plus. In SQL*Plus you can run command
show errors
and you will see errors list. Your procedure looks OK, so I think problem is - you have no access to dba_db_links view. Try to use all_db_links or user_db_links instead.
Along with what Dmitry said about you probably not having access to dba_db_links table, you also had a typo in the myvar variable definition. It should have been:
myvar dba_db_links.db_link%TYPE;
SQL*Plus> SHOW ERRORS will help you in your PL/SQL endeavors, until you start using a PL/SQL IDE like SQL Developer or (my favorite) PL/SQL Developer, which will show you the errors automatically.
I am trying to make a trigger that when data is inserted, it trims the data that is being inserted.
Here is what I am trying ..
CREATE OR REPLACE TRIGGER trig_trim
BEFORE INSERT ON triggertest
FOR EACH ROW
BEGIN
TRIM(:new.testchar);
END;
/
I do an insert like this
INSERT INTO triggertest (testnum, testchar) VALUES (9, ' r9 ');
and I am getting this error...
04098. 00000 - "trigger '%s.%s' is invalid and failed re-validation"
*Cause: A trigger was attempted to be retrieved for execution and was
found to be invalid. This also means that compilation/authorization
failed for the trigger.
*Action: Options are to resolve the compilation/authorization errors,
disable the trigger, or drop the trigger.
When I just run the code to create the trigger I get this
TRIGGER TRIG_TRIM compiled
Errors: check compiler log
and in the compiler log it says "'TRIM' is not a procedure or is undefined"
Is my syntax wrong or my logic? I don't know why this is failing.
Your assignment syntax is wrong. Try this:
:new.testchar := TRIM(:new.testchar);
TRIM has to return the result to something. I think you want:
:new.testchar := TRIM(:new.testchar);
I have to pass the user name from one report to another report in ABAP.
I am using the following code.
SUBMIT zpgm_to WITH fld_pgm2 eq fld_pgm1 .
'zpgm_to ' is the report to where i have to pass the value.
'fld_pgm2' is the field in report zpgm_to .
'fld_pgm1' is the field in report zpgm_from which contains the value to be passed.
While i am using debugging i found that the value is not passing to the zpgm_to report.
I could not find where i had done the mistake. If anyone cross this issue before, pls do the needful.
I can' t see a problem in your example code.
If you have a typo in fld_pgm2 and you use an undefined parameter, the syntax check does not report an error.
Please try the extended syntax check:
Program->Check->Extended Syntax Check
Check if External program interfaces is checked.
Run the check. If there is a typo, you get an error ___ is not a parameter or a select option in report ___
Check the definition of fld_pgm2. it must define as PARAMETER ,not Data.