SAK }‘ŠŮ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŮEƒJƒtƒF ˆę—— SAK Streets ŒŸő
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SQL Šî‘b•Ň (‚ť‚̏\) SQL*Plus ƒRƒ}ƒ“ƒh - describeAvariableAexecuteAspool

Oracle ‚Ě SQL*Plus ‚Ě‹@”\‚đŕ–ž‚ľ‚Ü‚ˇB

ĄŽŔsƒpƒ‰ƒƒ^

sqlplus.exe sak/sak
            |   |_ ƒpƒXƒ[ƒh
            |_ ƒ†[ƒU

ĄÚ‘ąƒRƒ}ƒ“ƒh

connect SAK/SAK@ƒT[ƒrƒX–ź;
        |   |   |_ •Ę–ź
        |   |_ ƒpƒXƒ[ƒh
        |_ ƒ†[ƒU

ĄI—šƒRƒ}ƒ“ƒh

exit;

ĄƒXƒL[ƒ}ƒe[ƒuƒ‹ˆę——•\ŽŚ

select * from tab;

Ą•\\‘˘•\ŽŚ(ƒe[ƒuƒ‹ƒŒƒCƒAƒEƒg)

describe Žó’m;
         |_ ƒe[ƒuƒ‹A‚Ü‚˝‚́Aƒrƒ…[

ĄSQL ŽŔsAPL/SQL ŽŔsAƒXƒgƒAƒhƒRƒ“ƒpƒCƒ‹

start sqlfile;
      |_ SQL ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(Šg’ŁŽqČ—Ş‚Í .sql)

@sqlfile;
 |_ SQL ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(Šg’ŁŽqČ—Ş‚Í .sql)

  ** ƒJƒŒƒ“ƒg‚Ĺ‚Č‚˘ę‡‚́AƒpƒX•t‚Ť‚ĹŽw’股‚éB
     @g:\tmp\sqlfile;

@@path\sqlfile;
 |_ SQL ƒeƒLƒXƒgƒtƒ@ƒCƒ‹(Šg’ŁŽqČ—Ş‚Í .sql)

  ** start ‚Ć“Ż—l‚Ě“Ž‚Ť‚đ‚ˇ‚éB
     @ ‚ł́AƒlƒXƒg‚ľ‚˝ sql ƒtƒ@ƒCƒ‹‚đŒŠ‚Â‚Ż‚ç‚ę‚Č‚˘B

ĄƒXƒgƒAƒhƒGƒ‰[•\ŽŚ

show errors;

ĄDBMS_OUTPUT Žg—pŽž‚Ě•\ŽŚÝ’č

set serverout on;

set serveroutput on size 1000000;
                         |_ ƒoƒbƒtƒ@ƒTƒCƒY
                            Č—Ş’l‚Í 20000
                            ĹŹ’l‚Í 2000
                            Ĺ‘ĺ’l‚Í 1000000

Ą•Ď”éŒž

variable •Ď”–ź ƒ^ƒCƒv;
variable rcd number;
variable name varchar2(20);
variable cu refcursor;
var i number;

  ** var ‚ĆČ—Ş‚ľ‚Ä‚ŕ—Ç‚˘B

ĄƒXƒgƒAƒhŽŔs

exec ŽŔs•ś;
execute ŽŔs•ś;
execute :name := 'abc';
execute :rcd := TestFnc(10, 20, :name, :cu);
execute TestPrc(10, :name);

  ** ƒoƒCƒ“ƒh•Ď”‚́u:•Ď”–źv‚Ɓu:v‚ĹŽn‚ß‚éB

Ą•Ď”“ŕ—e•\ŽŚ

print •Ď”–ź;
print rcd;
print name;

Ąƒtƒ@ƒCƒ‹o—Í (SQL*Plus ‚Ě“ŕ—e‚đƒeƒLƒLƒXƒgƒtƒ@ƒCƒ‹‚ɏ‘‚­)

spool ƒtƒ@ƒCƒ‹–ź;
...
...
spool off;

ĄŒŠo‚ľ•\ŽŚs”Ý’č

set pagesize 20;
             |_ s”

ĄŒ…”Ý’č

set linesize 200;
             |_ Œ…”

ĄORA-xxxxx ƒGƒ‰[‚ĚˆÓ–Ą•\ŽŚ

  E—á‚Ś‚΁AORA-00904 ‚ĚˆÓ–Ą‚𒲂ׂé‚Č‚çAŽŸ‚̂悤‚É‚ˇ‚éB
    sqlerrm ‚Ěƒpƒ‰ƒƒ^‚Ć‚ľ‚ẮAxxxxx •”•Ş‚đƒ}ƒCƒiƒX‚ĹŽw’股‚éB
    Œ‹‰Ę‚́AuORA-00904: —ń–ź‚Ş–łŒř‚Ĺ‚ˇBv‚̂悤‚É•\ŽŚ‚ł‚ę‚éB

var msg varchar2(200);
execute :msg := sqlerrm(-904);
print msg;

ĄSQL*Loader (SQL ƒ[ƒ_[)

  ECSV ƒeƒLƒXƒg‚Č‚Ç‚Š‚烌ƒR[ƒh‚đˆęŠ‡“o˜^‚Ĺ‚Ť‚éB

-- test.csv (ƒf[ƒ^ƒtƒ@ƒCƒ‹)
a001,10,20,30
b002,11,21,31
c003,12,22,32

-- test.ctl (ƒRƒ“ƒgƒ[ƒ‹ƒtƒ@ƒCƒ‹)
load data infile 'test.csv' append into table ƒeƒXƒgm
fields terminated by "," optionally enclosed '\n'
trailing nullcols
(
ƒL[,
ƒf[ƒ^1,
ƒf[ƒ^2,
ƒf[ƒ^3
)

-- sql*loader (ƒRƒ}ƒ“ƒh)
sqlldr userid=sak/sak control=test.ctl log=log.txt

ĄSQL Šî‘b•ŇŽ‘—ż
ĄSQL Šî‘bŽŔ’n•ŇŽ‘—ż
ĄSQL ƒ`ƒ…[ƒjƒ“ƒO•ŇŽ‘—ż
ĄOracle PL/SQL •ŇŽ‘—ż
ĄPostgreSQL •ŇAJAVA ServletAJSP •ŇŽ‘—ż
ĄMySQL •ŇŽ‘—ż
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŮEƒJƒtƒF ˆę—— SAK Streets ŒŸő



Copyright (C) 1999-2017 Y.SAK