powered by simpleCommunicator - 2.0.53     © 2025 Programmizd 02
Форумы / Oracle [игнор отключен] [закрыт для гостей] / sqlplus... данные в один файл, количество записей в другой ...в одном скрипте
2 сообщений из 2, страница 1 из 1
sqlplus... данные в один файл, количество записей в другой ...в одном скрипте
    #39767262
dake
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Всем привет! Можно ли используя sqlplus из клиента 12.2 и опцию
Код: plsql
1.
set markup csv on delimiter ';' quote off 


сделать тоже самое что я делал раньше... сливать данные в один файл, а количество в другой...
примерно вот так
Код: plsql
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.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
set embedded on
set verify off
set feedback off
set echo off
set termout off
set term off
set heading off
set trimout on
set trimspool on
set pagesize 0
set linesize 2000
whenever sqlerror exit failure;
alter session set optimizer_mode=all_rows;
alter session set nls_numeric_characters = '. ';

variable row_cnt number;

column row_cnt_col NEW_VALUE row_cnt;

spool out.csv

select 
	t.*,
	count(*) over() AS row_cnt_col
from 
(
select
       1
||';'||2
||';'||t.source_file_id
||';'||t.id
||';'||t.source_group_id
||';'||t.service_date
||';'||t.device
||';'||t.detail
||';'||t.service_count
||';'||t.service_count1
||';'||t.service_count2
||';'||t.service_count3
||';'||t.order_date
||';'||t.report_date_id
||';'||t.town_id
||';'||t.device_group_id
||';'||t.abonent_id
||';'||t.abonent_group_id
||';'||t.detail_type_id
||';'||t.tariff_type_id
||';'||t.service_pack_type_id
||';'||t.factor_type_id
||';'||t.date_factor_type_id
||';'||t.nds_type_id
||';'||t.discount_type_id
||';'||t.service_count_group_id
||';'||t.debit
||';'||t.tdr_group_id
||';'||t.bill_type_id
||';'||t.dbill_type_id
||';'||t.bill_id
||';'||t.vat_rate
||';'||t.personal_discount
||';'||t.discount_amt
||';'||t.day_type
||';'||t.period_name
||';'||t.rpr9_usage_interface_id
||';'||t.event_id
||';'||t.subscriber_id
||';'||t.user_name
from db.tdr t, db.bill b
where t.bill_id=b.id and
      t.report_date_id=b.report_date_id and
      b.report_date_id=extract(month from to_date('10.01.2019', 'dd.mm.yyyy')) and
      trunc(t.order_date) = to_date('10.01.2019', 'dd.mm.yyyy')) t;

spool off;

execute :row_cnt := &row_cnt;

spool out.crc

print row_cnt;

spool off;

exit;



если нет, то как можно еще сделать
...
Рейтинг: 0 / 0
sqlplus... данные в один файл, количество записей в другой ...в одном скрипте
    #39767278
Фотография Vadim Lejnin
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
dake,

а что изменилось?
кроме select
По моему проще проверить чем ждать ответ
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / Oracle [игнор отключен] [закрыт для гостей] / sqlplus... данные в один файл, количество записей в другой ...в одном скрипте
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]