Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
Ну братцы, всего 4 дня с этой радостью имею счастье - задрал он меня своей простотой. Как вообще с varchar или image можно работать то в ESQL ? (нужно из Кобола но и для C++ как пример подойдет) 1. Похоже что элементарных вещей оно не хавает: create table T(m IMAGE) Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. SELECT errcode = -16843013, error: ct_bind(): user api layer: external error: An illegal value of 2 given :-)) Ну ладно, допустим вынуть то с грехом пополам я выну (select datalength(m), m into ...) а как вставить/заменить ????????????????????????? 2. C++ дает банальные ошибки компилируя после препроцессора. Приходится или руками cast вставлять или на обычный C сваливать :-((( Вот уж правду говорят дрянная база... -- Сергей ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.01.2006, 01:04 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
Плохому танцору яйца мешают, а плохому программисту - база. Пример из документации: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.01.2006, 17:38 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
2 White Owl Ну-ну... Врубил на всю катушку Dynamic SQL и назвал ska плохим танцором... Нехорошо. Извиницца надо.... 2 ska по существу: Зря вы ESQL + ASE. Не стоит оно того. Один лишь геморрой. С++ - сразу отбрасывайте. уходите на ODBC+ХП, только так можно что-то приличное получить. (ИМХО) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.01.2006, 17:52 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
Тут http://www.sybase.com/detail?id=20375 вроде есть text_image sample, не поможет - откройте case с Sybase. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.01.2006, 19:13 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
gardenman 2 ska по существу: Зря вы ESQL + ASE. Не стоит оно того. Один лишь геморрой. С++ - сразу отбрасывайте. уходите на ODBC+ХП, только так можно что-то приличное получить. (ИМХО) Ах Сударь, если бы речь шла о новой разработке... Примерно 300 кобольных программ с ESQL :-(( Работают терпимо с Oracle, DB2 (rs6000, 390, as400) и даже MSSQL. С++ немного - только для связки. ODBC в solaris ? Хммм. Наверное перенести INSERT/UPDATE в ХП таки здравая идея. По крайней мере хоть какой-то вариант сделать запись переменной длины в IMAGE или TEXT из кобола. Пока другого варианта не вижу. Спасибо за совет Сергей ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.01.2006, 19:23 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
ZhoraТут http://www.sybase.com/detail?id=20375 вроде есть text_image sample, не поможет - откройте case с Sybase. Угу, токмо фактическая длина поля не регулируется и получается равной размеру описанного буфера (как и положено в коболе добитого справа пробелами). Задать же фактическую длину не знаю как, если вообще возможно. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.01.2006, 00:50 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
White OwlПлохому танцору яйца мешают, а плохому программисту - база. Пример из документации: Код: plaintext 1. 2. 3. 4. sybtestc.pc:16: error: `LONGVARCHAR' undeclared (first use in this function) fgrep LONGVARCHAR $SYBASE/OCS-12_5/include/* - нету И хде енто Вы вычитали ? :-)) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.01.2006, 04:18 |
|
||
|
ASE 12.5, OCE / ESQL C - как IMAGE вынуть ?
|
|||
|---|---|---|---|
|
#18+
Embedded SQL Programming Sending and retrieving long valuesThe method for sending and retrieving LONG VARCHAR and LONG BINARY values in embedded SQL applications is different from that for other data types. Although the standard SQLDA fields can be used, they are limited to 32 kb data as the fields holding the information (sqldata, sqllen, sqlind) are 16-bit values. Changing these values to 32-bit values would break existing applications. The method of describing LONG VARCHAR and LONG BINARY values is the same as for other data types. For information about how to retrieve and send values, see Retrieving LONG data, and Sending LONG data. Static SQL usage Separate structures are used to hold the allocated, stored, and untruncated lengths of LONG BINARY and LONG VARCHAR data types. The static SQL data types are defined in sqlca.h as follows: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. For dynamic SQL, set the sqltype field to DT_LONGVARCHAR or DT_LONGBINARY as appropriate. The associated LONGBINARY and LONGVARCHAR structures are as follows: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Embedded SQL Programming Sending and retrieving long values Retrieving LONG dataThis section describes how to retrieve LONG values from the database. For background information, see Sending and retrieving long values. The procedures are different depending on whether you are using static or dynamic SQL. To receive a LONG VARCHAR or LONG BINARY value (static SQL) Declare a host variable of type DECL_LONGVARCHAR or DECL_LONGBINARY, as appropriate. Retrieve the data using FETCH, GET DATA, or EXECUTE INTO. Adaptive Server Anywhere sets the following information: indicator variable The indicator variable is negative if the value is NULL, 0 if there is no truncation, and is the positive untruncated length in bytes up to a maximum of 32767. For more information, see Indicator variables. stored_len This DECL_LONGVARCHAR or DECL_LONGBINARY field holds the number of bytes retrieved into the array. It is never greater than array_len. untrunc_len This DECL_LONGVARCHAR or DECL_LONGBINARY field holds the number of bytes held by the database server. It is at least equal to the stored_len value. It is set even if the value is not truncated. To receive a value into a LONGVARCHAR or LONGBINARY structure (dynamic SQL) Set the sqltype field to DT_LONGVARCHAR or DT_LONGBINARY as appropriate. Set the sqldata field to point to the LONGVARCHAR or LONGBINARY structure. You can use the LONGVARCHARSIZE( n ) or LONGBINARYSIZE( n ) macros to determine the total number of bytes to allocate to hold n bytes of data in the array field. Set the array_len field of the LONGVARCHAR or LONGBINARY structure to the number of bytes allocated for the array field. Retrieve the data using FETCH, GET DATA, or EXECUTE INTO. Adaptive Server Anywhere sets the following information: * sqlind This sqlda field is negative if the value is NULL, 0 if there is no truncation, and is the positive untruncated length in bytes up to a maximum of 32767. stored_len This LONGVARCHAR or LONGBINARY field holds the number of bytes retrieved into the array. It is never greater than array_len. untrunc_len This LONGVARCHAR or LONGBINARY field holds the number of bytes held by the database server. It is at least equal to the stored_len value. It is set even if the value is not truncated. The following code snippet illustrates the mechanics of retrieving LONG VARCHAR data using dynamic embedded SQL. It is not intended to be a practical application: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.01.2006, 18:13 |
|
||
|
|

start [/forum/topic.php?fid=55&msg=33477481&tid=2013137]: |
0ms |
get settings: |
9ms |
get forum list: |
19ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
48ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
52ms |
get tp. blocked users: |
1ms |
| others: | 222ms |
| total: | 368ms |

| 0 / 0 |
