Quantcast
Channel: SCN: Message List - SAP Advantage Database Server
Viewing all 997 articles
Browse latest View live

Re: Executing Store Procedure random timeouts

$
0
0

Ok.

 

When I execute a query using the Java driver, I do get the column names back.  When I execute that same query as a stored procedure, I get the error.  My guess is that metadata is not coming back from variable output stored procedures, or I have a configuration error.


Re: Executing Store Procedure random timeouts

$
0
0

I suspect the former.  I think variable output SPs are new in 11 so there may be a bug.  A support incident would be best.

Re: Executing Store Procedure random timeouts

$
0
0

hello

i,m oracle Developer

i have problem in  ADS 10

how can read Data from Oracle11G how can connect  it

file data in ADS  = .ADD

thank you

Re: Executing Store Procedure random timeouts

$
0
0

sorry From ADS TO ORACLE 11G

thank you

Re: Executing Store Procedure random timeouts

$
0
0

Edgar,

 

We have found that if you get an error in the query, you will get a result set that is marked as opened, the column names exist but the EOF marker is missing.  That was causing us to loop forever and time out.

Store Procedures do not delete temp tables created in that procedure

$
0
0

We have noticed that when we use a temp table in a stored procedure and then execute the procedure, the temp table remains.  So if we execute the procedure again, it will fail with a table already exists error.

 

Are we missing something?  Here is what we are trying to do:

 

CREATE PROCEDURE SessionVariableGetMany

   (

      SessionId CHAR ( 16 ),

      VarNames CHAR ( 2000 ),

      CURSOR VARYING OUTPUT

   )

 

 

BEGIN

  Declare @Sql char(2000);

  @Sql = 'Select SV_Key, SV_Value Into #tempSVGM From SessionV Where SV_CustNum = ''' + _SessionID + ''' And SV_Key In (' + RTrim(_VarNames) + ');';

 

 

  Execute Immediate RTrim(@Sql);

 

 

  Select * From #tempSVGM;

 

 

END;

 

Any insight into this would be greatly appreciated.

 

Dave Anderson

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

Hi Dave,

 

That would be expected.  The temp table will continue to be available until it is dropped or the connection is closed.

 

This behavior lets a Stored Procedure create and populate a temp table that is then available to further query at a later time if needed (i.e. another sql statement or another stored procedure)

 

There are two possibilities.

 

A) Use a TRY/CATCH block to create the table / delete the contents

TRY

Create table #tempSVGM ....
CATCH ALL

delete from #tempSVGM...
END TRY

 

B) Use an if exists with sp_GetTables
if exists execute procedure sp_GetTables(null, null, 'tempSVGM', 'LOCAL TEMPORARY').....

 

(I've not had a chance to try B, but I'm confident it would work).

 

Edgar

Re: ADS v11.1 and Windows server2012 R2 and Hyper-V

$
0
0

Generally speaking it should work though I am not aware of any specific testing with this particular setup.  (Most testing I believe is done with VMWare).

 

I have seen issues in the past where ADS ear marks a certain amount of memory for cache and then Hyper-V thinks it is actually in use and refuses to start or throws errors.  ADS only ear marks the memory but will release it as the machine indicates it needs more.

 

You may try and reduce the max cache memory.  See this KB Item

 

http://devzone.advantagedatabase.com/dz/content.aspx?Key=17&RefNo=100210-2248


Concatenated fields

$
0
0

We currently have indexed fields that are concatenated fields with up three values.  We currently are able to parse the fields with Left, Right and Mid commands using native FoxPro with little or no speed degradation.  The field are all Char.

 

An example is a field called OD_CustItm where the first 6 characters are Store number, then next 6 are the Customer number, and the last 6 are the Item number.

 

When we access the fields with a Left, Right or Mid command, Sybase takes a considerable amount of time.   How can improve the speed to be equal or better than native FoxPro.

Re: Concatenated fields

$
0
0

I am assuming you are using SQL with a WHERE clause specifying left,mid, right or a filter of some sort?

 

You will need to create indexes to match the where clause / filter.  Typically ADS optimizes the best if you have an index on each, but in some cases you can get away with a single index as long as you order your filter / where clause to  match the index.

 

 

If you are using SQL you can also use ARC to run the query and choose the Show Plan option.  Look at the tab execution plan (graphical) and anywhere you see a red dot hover over it and it should give you some clues as to what indexes it is able to use to optimize.

 

 

One a side note.  Assuming you are using the REMOTE server, ADS is a bit slower than non client-server drivers for a single user.  Just having one other user opening the table and you should see ADS as faster.

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

Edgar,

 

We tried your first example to do a create of the temporary table but the following Execute Immediate throws an error when it is changed to an Insert Into statement.  The records still seem to get populated, at least when tried in the sql query window (not tried in the sp yet).  I am not sure why an error is thrown and it a non-descript ISAM error.  We also tried to drop the table in the try catch instead of creating the table and leaving the select into statement as is, but it says that it is locked and does not drop the table, so this does not work either.  Are we going to have to trap the execute immediate error as well and just ignore?

 

Thank you,

 

Dave Anderson

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

Not sure.  A quick test didn't reproduce the issue.  Can you tweak the following to show me the error?

 

try

create table #temp (id integer);

catch all

delete from #temp;

end try;

 

 

execute immediate 'insert into #temp (id) values (1)';

 

 

select * from #temp;

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

Below is the stored procedure we are trying to create.  Below that is the ISAM error we get when doing the insert into the temporary table.  It is very similar to your example but the select is coming out of a temporary table.  The parameters used were '0000321234695246' and '''Cust_Delivery_Info'',''Pickup_Delivery'''.  I have tried removing the "And SV_Key In(..." statement but I get the same error either way.  Any insights would be helpful and appreciated.

 

Create PROCEDURE SessionVariableGetMany

   (

      SessionId CHAR ( 16 ),

      VarNames CHAR ( 2000 ),

CURSOR VARYING OUTPUT

   )

BEGIN

  Declare @Sql char(2000);

  @Sql = 'Insert Into #tempSVGM (SV_Key, SV_Value) Select SV_Key, SV_Value From SessionV Where SV_CustNum = ''' + _SessionID + ''' And SV_Key In (' + RTrim(_VarNames) + ');';

 

  Try

    Create Table #tempSVGM (SV_Key Char( 50 ), SV_Value Char( 254 ));

  Catch All

    Delete From #tempSVGM;

  End Try;

 

  Execute Immediate RTrim(@Sql);

 

  Select * From #tempSVGM;

 

END;

 

poQuery: Error 7200:  AQE Error:  State = HY000;   NativeError = 5154;  [iAnywhere Solutions][Advantage SQL][ASA] Error 5154: 

Execution of the stored procedure failed.   Procedure Name: SessionVariableGetMany. Error 7200:  AQE Error:  State = S0000;  

NativeError = 2004;  [iAnywhere Solutions][Advantage SQL Engine][ISAM]ISAM error <identifier> - EXECUTE IMMEDIATE  --

Location of error in the SQL statement is: 310 (line: 10 column: 21)

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

Hmm...

This works for me.  Just changed the base table in the select statement to one I had already.

 

I was running this on 11.10.0.20 (and upgraded to 11.10.0.22 just in case it introduced something)

 

Some things that come to mind. 

A) Is there anything logged into the ads_err.adt / ads_err.dbf at the same time?

B) Is it possible you already have another temp table created with a bit different structure?  - If you are using ARC, maybe close the ARC SQL window and run it again?

 

Are you running this in a different client?  Shouldn't matter, but just checking.

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

We found the issue.  It has to do with null values in the fields of the table being selected from that are to be inserted into the temporary table.  Even though the temporary table is created to accept nulls when the insert is attempted it fails with the ISAM error.  If the select is changed to do an IsNull(<fieldName>. '') the process completes without failure.  There seems to be an issue with inserting nulls into temporary tables.


Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

I'm glad you were able to work it out, but that again is odd.

 

What version of ADS?  Also, what table type is the base table?  Just tested with 11.10.0.22 and ADT base table and it works ok.   Maybe some other combination is needed.

 

Edgar

Re: Store Procedures do not delete temp tables created in that procedure

$
0
0

We are using ADS 11.10.0.22 as well.  The base table, however, is a Foxpro table.  We suspect that there is an issue in the translator for this value.  We should use the work around for now, unless you have other ideas or we are not importing or querying the Foxpro tables properly.

 

Thank you again for your help in narrowing down what the issues were,

 

Dave

Re: Advanatage Database Server v8.10

$
0
0

Advantage works just fine in a virtualized environment. We use virtual machines for development and testing on a regular basis.

Re: Advanatage Database Server v8.10

Collation Errors for Installation in Australia

$
0
0

We are getting a collation error when we try to use our application on a Windows 7 OS on a computer in Australia.  We have over 1,000 users of our product in North America.  95% of them run local server.  We have one installation of our product in the UK.  We have ZERO issues with these installations.  We are trying to get an installation up and running in Australia.  When our application first started after installation we received errors that indicated a 5175 error message.  We then tried to open our database in Advantage Data Architect and we received the same error message when we tried to open any tables.  ADA suggested reindexing.  Which we did.  We could then open the tables but we are unable to add new/change data via ADA.  So we have removed our application from the equation by using ADA and we still cannot work with the data.

 

Does anyone have experience with building and using applications that are to be run in Australia?  We are a North American company.

 

Thank you,

 

CPGood

Viewing all 997 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>