Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I keep getting an error: Identifier expected on the code snippet below.
function InitializeSetup: Boolean;
begin
if (not IsUpgrade()) then
begin
MsgBox(ExpandConstant('{cm:BaseAppMissing}'), mbError, MB_OK);
Result := False;
end;
else
begin
Result := True;
end;
end;
Then when I remove the else part, it works just fine. What is wrong with my code? The begin-end pairing seems okay. What am I missing?
function InitializeSetup: Boolean;
begin
if (not IsUpgrade()) then
begin
MsgBox(ExpandConstant('{cm:BaseAppMissing}'), mbError, MB_OK);
Result := False;
end;
end;
Remove the semicolons after the end keywords inside the if...then...else clause.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
DECLARE
num_small number :=20
num_large number :=10
temp NUMBER;
BEGIN
IF num_small > num_large THEN
temp := num_small;
num_small := num_large;
num_large := temp;
END IF;
DBMS_OUTPUT.PUT_LINE('num_small BEFORE = 20, AFTERWARDS = ' || num_small);
DBMS_OUTPUT.PUT_LINE('num_large BEFORE = 10, AFTERWARDS = ' || num_large );
END;
/
Missing semi-colons in declaration section. Should be
DECLARE
num_small NUMBER := 20;
num_large NUMBER := 10;
temp NUMBER;
BEGIN
IF num_small > num_large
THEN
temp := num_small;
num_small := num_large;
num_large := temp;
END IF;
DBMS_OUTPUT.PUT_LINE ('num_small BEFORE = 20, AFTERWARDS = ' || num_small);
DBMS_OUTPUT.PUT_LINE ('num_large BEFORE = 10, AFTERWARDS = ' || num_large);
END;
/
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
In my for loop I used break statement to break loop after some match. But when I compile my code I got error for break:
Error: Illegal expression
Could you help me? I should add some unit?
for i:=0 to length(carsList)-1 do
begin
if numer <> carsList[i].numer then
begin
tmpKw2 := carsList[i].rectangleRotate(carsList[i].angle);
if((polyLine(tmpKw2,linia.p1.x,linia.p1.y,linia.p2.x,linia.p2.y))) then
begin
kolizja := true;
break:=true;
maxV := carsList[i].v;
Break;
end;
end;
end;
The code below works for me:
program Testbreak;
procedure TestBreakInFor;
var
i : Integer;
begin
for i := 0 to 10 do begin
if Odd(i) then
Break;
end;
end;
begin
TestBreakInFor;
readln;
end.
The reason you are getting the "Illegal expression" error is that you are attempting to use Break as if it were a variable (Break := True) when it is not, it is an execution flow-control instruction, like Continue. Omit the := True and it should compile corrrectly.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I have a compilation error in my PL/SQL code, The audit_client table will be updated if any update or delete occurs on client_master
create or replace trigger t1
after update or delete on client_master
for each row
DECLARE
v1 varchar2(10);
v2 varchar2(80);
v3 number(11);
oper varchar2(15);
BEGIN
v1:= :old.CLIENT_NO
v2:= :old.NAME
v3:= :old.BALANCE
if updating then
oper:='update'
insert into audit_client values(v1,v2,v3,oper,v4,v5);
end if;
if deleting then
oper:='delete'
insert into audit_client values(v1,v2,v3,oper,v4,v5);
end if;
end;
/
Why would you declare those v variables at all? Somewhat simplified:
create or replace trigger t1
after update or delete on client_master
for each row
declare
l_oper varchar2(15);
begin
if updating then
l_oper := 'update';
elsif deleting then
l_oper := 'delete';
end if;
insert into audit_client
(client_no, name, balance, oper, col4, col5)
values
(:old.client_no, :old.name, :old.balance, l_oper, null, null);
end;
/
Instead of v4 and v5 I inserted NULL as you never said what should be put in there.
Also, as a good practice, you should always specify column list you're working with. That's why I made up those column names as I don't know their real names, but you do and you should use them.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to encode a stream of image using EncodeBase64 in encddecd.pass that save to the database in a blob field. And retrieve this using decodebase64 in a bytestream that put into a component for showing.
The process good done but image don't show in component.
Here's digest code:
procedure TProcessSave.Execute;
var
i : Integer;
fileStm : TStream;
memStm : TMemoryStream;
encode_plc : string;
begin
for i := 0 to StrList.Count - 1 do
begin
DM.idb_tbl.Append;
DM.idb_tbl.FieldByName('name').AsString := ExtractFileName(StrList.Strings[i]);
try
fileStm := TFileStream.Create(StrList.Strings[i], fmOpenReadWrite);
memStm := TMemoryStream.Create;
filestm.Seek(0, soFromBeginning);
memStm.LoadFromStream(fileStm);
DM.idb_tbl.FieldByName('file').Value := EncodeBase64(memStm.Memory, memStm.Size);
finally
fileStm.Free;
memStm.Free;
end;
DM.idb_tbl.Post;
end;
end;
and for loading:
procedure TLoadBar.Execute;
var
imgStm : TStream;
begin
with DM.idb_qry do
begin
DatabaseName := DM.idb_db.DatabaseName;
SQL.Text := 'SELECT * FROM pics_tbl';
Open;
First;
while not Eof do
begin
try
imgStm :=TBytesStream.Create(DecodeBase64(FieldByName('file').Value));
idx := imgBar_iemv.AppendImage;
imgBar_iemv.SetImageFromStream(idx, imgStm);
imgBar_iemv.ImageID[idx] := id;
finally
imgStm.Free;
end;
Next;
end;
end;
end;
and then I use imgStm for showing picture in a component but images not showing. I'm sure from component. What are your thoughts for encode and decode in my methods? Is another way that is sure for encode and decode for this problem?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Is the usage of CASE wrong in the code below?
I am getting an error:
"PLS-00103: Encountered the symbol ";" when expecting one of the
following:
case The symbol "case" was substituted for ";" to continue. "
Code is :
create or replace PROCEDURE MIK_3PL_ITEM_ERRORS_PROC_1 IS
i_error_code varchar2(5);
i_desc varchar2(200);
CURSOR c_3pl_error IS
SELECT mie.client_item_id, mie.message_id,
mie.error_desc, mis.process_flag
FROM mik_3pl_item_error_etl mie,
dummy_staging mis
WHERE mie.client_item_id = mis.client_item_id
AND mie.message_id = mis.message_id;
BEGIN
dbms_output.put_line ('hello');
for i in c_3pl_error
loop
dbms_output.put_line ('in loop');
DECLARE
-- L_relations_exist VARCHAR2(1);
L_error_message VARCHAR2(255) := NULL;
L_return BOOLEAN := FALSE;
BEGIN
select error_code
into i_error_code
from mik_3pl_error_desc
where description = i.error_desc;
-- dbms_output.put_line(i_error_code);
CASE i_error_code
WHEN 'E2' THEN dbms_output.put_line ('in case');
END; -- end of CASE */
END; /*End of begin */
end loop;
END MIK_3PL_ITEM_ERRORS_PROC_1;
It needs to be:
...
CASE i_error_code
WHEN 'E2' THEN dbms_output.put_line ('in case');
END CASE; -- end of CASE */
END;
It's trying to treat the END; as the end of the block - matching that END with the BEGIN - and it knows the case is still open.
The documentation for the CASE statement shows that. (Not to be confused with a CASE expression, which does just have END. Ahem. Thank you Nicholas!)