advantage-database-server

Custom sort order for dataset after executing query?

醉酒当歌 提交于 2019-12-12 10:42:43
问题 I want the result set of a database query to have a certain order. The information I want to order by is not contained in the database, but dynamically generated in code (so I cannot use ORDER BY ). Is there a way to sort a dataset after executing the database query? (I don't need indexed access but only want to iterate over all records.) 回答1: There is a possibility that shares similarities with Jens' answer (+1) but gets to the result in a slightly different fashion. Given an existing table:

How to define a current user?

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:25:36
问题 Is it possible to define a current user? I found a stored procedure 'sp_mgGetConnectedUsers'. It returns a result set with the only unique field 'Address'. How could I associate an executing query with such 'Address'. Please advice. Note: As far as I understand, another way to get the current user is to set a unique application Id for each connection, but I don't like this way much. 回答1: If using a data dictionary you can use the user scalar function: select user() from system.iota; and

Splitting a String into rows

馋奶兔 提交于 2019-12-11 06:17:55
问题 I have a table with a field consisting of multiple strings seperated by a '+'. Each part of the string has a length of either 2 or 3 chars. Example: 'ab+cde+fg' . Each row has 1 to 3 parts (so some rows don't need spliting). The above example should return 3 rows: 'ab' , 'cd' and 'fg' . I have searched the internet for stored procedures, but none seem to work for my particular needs. I don't have the SQL-skills myself to write such procedure. 回答1: The general algorithm works like this:

Advantage PHP PDO Driver on PHP7

限于喜欢 提交于 2019-12-11 05:19:53
问题 How can I install advantage PHP PDO driver on PHP7 on Ubuntu Server 14.04? I have followed the instructions here: https://devzone.advantagedatabase.com/dz/webhelp/Advantage11/index.html But I'm having an error when trying to execute the make command /var/www/php-7.0.9/ext/advantage/php_ads.c: In function ‘zif_ads_tableprivileges’: /var/www/php-7.0.9/ext/advantage/php_ads.c:4065:31: error: expected expression before ‘ads_connection’ ZEND_FETCH_RESOURCE2(conn, ads_connection *, &pv_conn, -1,

What is difference between the Advantage Database Server free table and Advantage Database Server Normal table

别等时光非礼了梦想. 提交于 2019-12-11 04:58:45
问题 What is difference between the Advantage Database Server free table and Advantage Database Server normal table. Thanks ! 回答1: Free table - The table is independent of a data dictionary, it's just a set of files in the fs (table.adt, table.adi, table.adm). Dictionary table - The table con only be used after logging into the specific data dictionary that owns the table. The technical difference is that some bytes in the adt file header are different, so that you can't open a dictionary table

What is the proper connection string for Advantage Database Server?

江枫思渺然 提交于 2019-12-10 11:44:18
问题 I am running Sybase Advantage Database Server and a bit new to PHP coding. Advantage Database's knowledge base with code samples went offline awhile back, so I don't have much to go off of. What would be the proper database connection string to use with Sybase's Advantage Database 10 in php? This string works perfect in classic ASP: <% Set AdvConn = Server.CreateObject("ADODB.CONNECTION") AdvConn.Open "DSN=AdvantageWintux" Set Colors = AdvConn.Execute("SELECT * FROM Colors ORDER BY Color") If

Advantage to SQL 2008 Linked Server Access Denied Error

☆樱花仙子☆ 提交于 2019-12-08 12:30:27
问题 I am trying to create a linked server in SQL 2008 to an Advantage v7 database server. I've successfully created the linked server in SQL 2008 using the commands below and the connection tests out fine. Also, the Advantage DB I'm connecting to does not have a data dictionary. SQL to create the Linked Server EXEC master.dbo.sp_addlinkedserver @server = N'ADVANTAGE', @srvproduct=N'Advantage', @provider=N'Advantage.OLEDB', @datasrc=N'\\asc1\questtest$\spaulrun' /* For security reasons the linked

How to convert columns data in comma separated list

丶灬走出姿态 提交于 2019-12-08 06:27:56
问题 I am in little strange situation. It is a third party application which from front end doesn't allow user procedures or udf/scalar functions to be called. Only option is to write SQL and below is how my data looks. First pic has a mistake last PID was suppose to be 1 and second last 2. What I need it to be is this, This can be easily done using UDF/cursor in this Advantage Database Server 9 but I don't have a choice. I don't know if it is really possible. In Sybase there exist a function

How to convert columns data in comma separated list

折月煮酒 提交于 2019-12-06 16:49:36
I am in little strange situation. It is a third party application which from front end doesn't allow user procedures or udf/scalar functions to be called. Only option is to write SQL and below is how my data looks. First pic has a mistake last PID was suppose to be 1 and second last 2. What I need it to be is this, This can be easily done using UDF/cursor in this Advantage Database Server 9 but I don't have a choice. I don't know if it is really possible. In Sybase there exist a function called list which does this sort of work very easily but not sure here. Application does allow to call

Create ERD for Advantage Database Server 10

混江龙づ霸主 提交于 2019-12-06 15:22:50
I need to create an ERD for an ADS 10 database. Reverese Engineering would be nice, since the database already exists. Unfortunately, I didn't found a ERD-Tool which supports this database. Does anybody knows a tool which supports this features? You can use the Advantage Data Architect to get a model of a database. As far as I know this only works on data dictionaries, but you can easily add free tables to a dictionary if necessary. I don't know of any other ADS compatible modelling tools. It may be worth your while to take a look at TOAD Data Modeler by Quest Software. TDM Version 2